├── .ansible-lint ├── .chglog ├── CHANGELOG.tpl.md └── config.yml ├── .github ├── ISSUE_TEMPLATE │ ├── bug.md │ ├── feature.md │ └── support.md ├── labeler.yml ├── labels.yml ├── lock.yml ├── settings.yml ├── stale.yml └── workflows │ └── labels.yml ├── .gitignore ├── .mergify.yml ├── .yamllint ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── TROUBLESHOOTING.md ├── bump_version.sh ├── defaults └── main.yml ├── handlers └── main.yml ├── meta └── main.yml ├── molecule ├── alternative │ ├── molecule.yml │ ├── playbook.yml │ ├── prepare.yml │ └── tests │ │ └── test_alternative.py ├── default │ ├── molecule.yml │ ├── playbook.yml │ ├── prepare.yml │ └── tests │ │ └── test_default.py └── latest │ ├── molecule.yml │ ├── playbook.yml │ └── tests │ └── test_alternative.py ├── tasks ├── configure.yml ├── install.yml ├── main.yml └── preflight.yml ├── templates ├── alert.rules.j2 ├── prometheus.service.j2 └── prometheus.yml.j2 ├── test-requirements.txt └── vars ├── centos-8.yml ├── centos.yml ├── debian.yml ├── fedora.yml ├── main.yml ├── redhat-8.yml └── redhat.yml /.ansible-lint: -------------------------------------------------------------------------------- 1 | --- 2 | skip_list: 3 | - '106' 4 | - '204' 5 | - '208' 6 | -------------------------------------------------------------------------------- /.chglog/CHANGELOG.tpl.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | {{ if .Versions -}} 4 | ## [**Next release**](https://galaxy.ansible.com/cloudalchemy/prometheus) 5 | {{ if .Unreleased.CommitGroups -}} 6 | {{ range .Unreleased.CommitGroups -}} 7 | ### {{ .Title }} 8 | {{ range .Commits -}} 9 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} 10 | {{ end }} 11 | {{ end -}} 12 | {{ end -}} 13 | {{ end -}} 14 | {{ range .Versions }} 15 | ## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }} 16 | {{ range .CommitGroups -}} 17 | ### {{ .Title }} 18 | {{ range .Commits -}} 19 | - {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} 20 | {{ end }} 21 | {{ end -}} 22 | 23 | {{- if .RevertCommits -}} 24 | **Reverts:** 25 | 26 | {{ range .RevertCommits -}} 27 | - {{ .Revert.Header }} 28 | {{ end }} 29 | {{ end -}} 30 | 31 | {{- if .MergeCommits -}} 32 | **Merged pull requests:** 33 | 34 | {{ range .MergeCommits -}} 35 | - {{ .Header }} 36 | {{ end }} 37 | {{ end -}} 38 | 39 | {{- if .NoteGroups -}} 40 | {{ range .NoteGroups -}} 41 | ### {{ .Title }} 42 | {{ range .Notes }} 43 | {{ .Body }} 44 | {{ end }} 45 | {{ end -}} 46 | {{ end -}} 47 | {{ end -}} 48 | 49 | {{- if .Versions }} 50 | [Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD 51 | {{ range .Versions -}} 52 | {{ if .Tag.Previous -}} 53 | [{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }} 54 | {{ end -}} 55 | {{ end -}} 56 | {{ end -}} 57 | -------------------------------------------------------------------------------- /.chglog/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | style: github 3 | template: CHANGELOG.tpl.md 4 | info: 5 | title: CHANGELOG 6 | repository_url: https://github.com/cloudalchemy/ansible-prometheus 7 | options: 8 | tag_filter_pattern: '^[0-9]' 9 | commits: 10 | # filters: 11 | # Type: 12 | # - feat 13 | # - fix 14 | # - perf 15 | # - refactor 16 | commit_groups: 17 | # title_maps: 18 | # feat: Features 19 | # fix: Bug Fixes 20 | # perf: Performance Improvements 21 | # refactor: Code Refactoring 22 | header: 23 | pattern: "^(\\w*)\\:\\s(.*)$" 24 | pattern_maps: 25 | - Type 26 | - Subject 27 | merges: 28 | pattern: "(#\\w+)" 29 | pattern_maps: 30 | - Source 31 | notes: 32 | keywords: 33 | - BREAKING CHANGE 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Report a bug related to ansible role 4 | labels: bug 5 | --- 6 | 7 | **What happened?** 8 | 9 | **Did you expect to see some different?** 10 | 11 | **How to reproduce it (as minimally and precisely as possible)**: 12 | 13 | **Environment** 14 | 15 | * Role version: 16 | 17 | `Insert release version/galaxy tag or Git SHA here` 18 | 19 | * Ansible version information: 20 | 21 | `ansible --version` 22 | 23 | 24 | * Variables: 25 | 26 | ``` 27 | insert role variables relevant to the issue 28 | ``` 29 | 30 | * Ansible playbook execution Logs: 31 | 32 | ``` 33 | insert Ansible logs relevant to the issue here 34 | ``` 35 | 36 | **Anything else we need to know?**: 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature 3 | about: If you want to propose a new feature or enhancement 4 | labels: enhancement 5 | --- 6 | 7 | **What is missing?** 8 | 9 | **Why do we need it?** 10 | 11 | **Environment** 12 | 13 | * Role version: 14 | 15 | `Insert release version/galaxy tag or Git SHA here` 16 | 17 | * Ansible version information: 18 | 19 | `ansible --version` 20 | 21 | 22 | **Anything else we need to know?**: 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support 3 | about: If you have questions about this ansible role 4 | labels: question 5 | --- 6 | 7 | **What did you do?** 8 | 9 | **Did you expect to see some different?** 10 | 11 | **Environment** 12 | 13 | * Role version: 14 | 15 | `Insert release version/galaxy tag or Git SHA here` 16 | 17 | * Ansible version information: 18 | 19 | `ansible --version` 20 | 21 | 22 | * Variables: 23 | 24 | ``` 25 | insert role variables relevant to the issue 26 | ``` 27 | 28 | * Ansible playbook execution Logs: 29 | 30 | ``` 31 | insert Ansible logs relevant to the issue here 32 | ``` 33 | 34 | **Anything else we need to know?**: 35 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # configuration spec at https://github.com/actions/labeler/blob/master/README.md 3 | area/docs: 4 | - meta/* 5 | - CHANGELOG.md 6 | - CONTRIBUTING.md 7 | - LICENSE 8 | - README.md 9 | area/tests: 10 | - molecule/* 11 | - molecule/**/* 12 | - .ansible-lint 13 | - test-requirements.txt 14 | - tox.ini 15 | area/automation: 16 | - .travis/* 17 | - .github/* 18 | - .github/**/* 19 | - .travis.yml 20 | - .mergify.yml 21 | area/vars: 22 | - defaults/* 23 | - vars/* 24 | - vars/**/* 25 | area/tasks: 26 | - handlers/* 27 | - tasks/* 28 | - tasks/**/* 29 | area/jinja: 30 | - templates/* 31 | - templates/**/* 32 | -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Default GitHub labels 3 | - color: d73a4a 4 | name: bug 5 | description: Something isn't working 6 | - color: cfd3d7 7 | name: duplicate 8 | description: This issue or pull request already exists 9 | - color: a2eeef 10 | name: enhancement 11 | description: New feature or request 12 | - color: 7057ff 13 | name: good first issue 14 | description: Good for newcomers 15 | - color: 008672 16 | name: help wanted 17 | description: Extra attention is needed 18 | - color: e4e669 19 | name: invalid 20 | description: This doesn't seem right 21 | - color: d876e3 22 | name: question 23 | description: Further information is requested 24 | - color: ffffff 25 | name: wontfix 26 | description: This will not be worked on 27 | 28 | # Labels specific to cloudalchemy 29 | - color: 0366d6 30 | name: area/docs 31 | description: Improvements or additions to documentation 32 | - color: 0366d6 33 | name: area/tests 34 | description: Everything related to molecule tests and linters 35 | - color: 0366d6 36 | name: area/automation 37 | description: Bots, bots everywhere 38 | - color: 0366d6 39 | name: area/vars 40 | description: Ansible variables used in role 41 | - color: 0366d6 42 | name: area/tasks 43 | description: Logic behind ansible role 44 | - color: 0366d6 45 | name: area/jinja 46 | description: Templates 47 | -------------------------------------------------------------------------------- /.github/lock.yml: -------------------------------------------------------------------------------- 1 | --- 2 | _extends: auto-maintenance 3 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | --- 2 | _extends: auto-maintenance 3 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | _extends: auto-maintenance 3 | -------------------------------------------------------------------------------- /.github/workflows/labels.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Sync labels in the declarative way 3 | on: 4 | push: 5 | branches: 6 | - master 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@1.0.0 12 | - uses: micnncim/action-label-syncer@v0.3.1 13 | env: 14 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 15 | GITHUB_REPOSITORY: ${{ github.repository }} 16 | with: 17 | manifest: .github/labels.yml 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.retry 2 | *.log 3 | .molecule 4 | .cache 5 | __pycache__/ 6 | .pytest_cache 7 | .tox 8 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | --- 2 | pull_request_rules: 3 | - name: automatic merge and new release from cloudalchemybot 4 | conditions: 5 | - "status-success=Travis CI - Pull Request" 6 | - status-success=WIP 7 | - head~=autoupdate|skeleton 8 | - author=cloudalchemybot 9 | actions: 10 | merge: 11 | method: squash 12 | strict: true 13 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | ignore: | 4 | .github/ 5 | meta/ 6 | 7 | rules: 8 | braces: 9 | max-spaces-inside: 1 10 | level: error 11 | brackets: 12 | max-spaces-inside: 1 13 | level: error 14 | line-length: disable 15 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [**Next release**](https://galaxy.ansible.com/cloudalchemy/prometheus) 4 | 5 | ## [4.0.0] - 2021-05-13 6 | **Merged pull requests:** 7 | 8 | - Merge pull request [#357](https://github.com/cloudalchemy/ansible-prometheus/issues/357) from cloudalchemy/autoupdate 9 | 10 | 11 | ## [3.0.0] - 2021-04-16 12 | **Merged pull requests:** 13 | 14 | - Merge pull request [#354](https://github.com/cloudalchemy/ansible-prometheus/issues/354) from cloudalchemy/superq/update_ci 15 | 16 | 17 | ## [2.17.0] - 2021-04-04 18 | **Reverts:** 19 | 20 | - [ci skip] Automatic changelog update 21 | 22 | **Merged pull requests:** 23 | 24 | - Fix github URL in release step ([#353](https://github.com/cloudalchemy/ansible-prometheus/issues/353)) 25 | - Fix typo in chmod ([#352](https://github.com/cloudalchemy/ansible-prometheus/issues/352)) 26 | - Merge pull request [#351](https://github.com/cloudalchemy/ansible-prometheus/issues/351) from cloudalchemy/superq/docker_layers 27 | - Merge pull request [#350](https://github.com/cloudalchemy/ansible-prometheus/issues/350) from cloudalchemy/superq/git-chglog 28 | - Merge pull request [#347](https://github.com/cloudalchemy/ansible-prometheus/issues/347) from cloudalchemy/superq/bump_script 29 | - Merge pull request [#346](https://github.com/cloudalchemy/ansible-prometheus/issues/346) from cloudalchemy/superq/destroy_alt_test 30 | - New prometheus/prometheus upstream release! ([#345](https://github.com/cloudalchemy/ansible-prometheus/issues/345)) 31 | - Support repeatable flags. ([#343](https://github.com/cloudalchemy/ansible-prometheus/issues/343)) 32 | - Merge pull request [#340](https://github.com/cloudalchemy/ansible-prometheus/issues/340) from cloudalchemy/autoupdate 33 | - Add option for ReadOnlyPaths ([#338](https://github.com/cloudalchemy/ansible-prometheus/issues/338)) 34 | - :tada: automated upstream release update ([#339](https://github.com/cloudalchemy/ansible-prometheus/issues/339)) 35 | - Add support for web config file ([#336](https://github.com/cloudalchemy/ansible-prometheus/issues/336)) 36 | - Update CI tests ([#337](https://github.com/cloudalchemy/ansible-prometheus/issues/337)) 37 | - Merge pull request [#332](https://github.com/cloudalchemy/ansible-prometheus/issues/332) from cloudalchemy/autoupdate 38 | - New prometheus/prometheus upstream release! ([#328](https://github.com/cloudalchemy/ansible-prometheus/issues/328)) 39 | - molecule: fix path to defaults/main.yml file ([#329](https://github.com/cloudalchemy/ansible-prometheus/issues/329)) 40 | 41 | 42 | ## [2.16.3] - 2021-01-13 43 | **Merged pull requests:** 44 | 45 | - :tada: automated upstream release update ([#327](https://github.com/cloudalchemy/ansible-prometheus/issues/327)) 46 | - New prometheus/prometheus upstream release! ([#318](https://github.com/cloudalchemy/ansible-prometheus/issues/318)) 47 | 48 | 49 | ## [2.16.2] - 2020-11-04 50 | **Merged pull requests:** 51 | 52 | - Wait for local file systems before starting prometheus ([#317](https://github.com/cloudalchemy/ansible-prometheus/issues/317)) 53 | 54 | 55 | ## [2.16.1] - 2020-10-20 56 | **Merged pull requests:** 57 | 58 | - New prometheus/prometheus upstream release! ([#316](https://github.com/cloudalchemy/ansible-prometheus/issues/316)) 59 | 60 | 61 | ## [2.16.0] - 2020-09-28 62 | **Merged pull requests:** 63 | 64 | - Bump version ([#315](https://github.com/cloudalchemy/ansible-prometheus/issues/315)) 65 | - [REPO SYNC] add troubleshooting doc skeleton ([#309](https://github.com/cloudalchemy/ansible-prometheus/issues/309)) 66 | - New prometheus/prometheus upstream release! ([#303](https://github.com/cloudalchemy/ansible-prometheus/issues/303)) 67 | - Do not create unused directory conf.d ([#299](https://github.com/cloudalchemy/ansible-prometheus/issues/299)) 68 | - New prometheus/prometheus upstream release! ([#298](https://github.com/cloudalchemy/ansible-prometheus/issues/298)) 69 | 70 | 71 | ## [2.15.5] - 2020-06-09 72 | **Merged pull requests:** 73 | 74 | - New prometheus/prometheus upstream release! ([#293](https://github.com/cloudalchemy/ansible-prometheus/issues/293)) 75 | - [REPO SYNC] Add passlib as a test requirement ([#292](https://github.com/cloudalchemy/ansible-prometheus/issues/292)) 76 | 77 | 78 | ## [2.15.4] - 2020-05-09 79 | **Merged pull requests:** 80 | 81 | - New prometheus/prometheus upstream release! ([#290](https://github.com/cloudalchemy/ansible-prometheus/issues/290)) 82 | 83 | 84 | ## [2.15.3] - 2020-05-07 85 | **Merged pull requests:** 86 | 87 | - New prometheus/prometheus upstream release! ([#289](https://github.com/cloudalchemy/ansible-prometheus/issues/289)) 88 | - improve path_prefix example in defaults ([#266](https://github.com/cloudalchemy/ansible-prometheus/issues/266)) 89 | 90 | 91 | ## [2.15.2] - 2020-04-20 92 | **Merged pull requests:** 93 | 94 | - New prometheus/prometheus upstream release! ([#284](https://github.com/cloudalchemy/ansible-prometheus/issues/284)) 95 | 96 | 97 | ## [2.15.1] - 2020-04-14 98 | **Merged pull requests:** 99 | 100 | - Fix version_compare filter deprecation ([#282](https://github.com/cloudalchemy/ansible-prometheus/issues/282)) 101 | 102 | 103 | ## [2.15.0] - 2020-04-12 104 | **Merged pull requests:** 105 | 106 | - added installation method config to skip install ([#272](https://github.com/cloudalchemy/ansible-prometheus/issues/272)) 107 | - Update Readme variable prometheus_binary_local_dir ([#280](https://github.com/cloudalchemy/ansible-prometheus/issues/280)) 108 | 109 | 110 | ## [2.14.2] - 2020-03-27 111 | **Merged pull requests:** 112 | 113 | - New prometheus/prometheus upstream release! ([#277](https://github.com/cloudalchemy/ansible-prometheus/issues/277)) 114 | - defaults: sync alerts from node-mixin project ([#276](https://github.com/cloudalchemy/ansible-prometheus/issues/276)) 115 | 116 | 117 | ## [2.14.1] - 2020-03-26 118 | **Merged pull requests:** 119 | 120 | - Upstream release update ([#274](https://github.com/cloudalchemy/ansible-prometheus/issues/274)) 121 | 122 | 123 | ## [2.14.0] - 2020-03-15 124 | **Merged pull requests:** 125 | 126 | - :tada: automated upstream release update ([#265](https://github.com/cloudalchemy/ansible-prometheus/issues/265)) 127 | - Do not manage system directory ([#263](https://github.com/cloudalchemy/ansible-prometheus/issues/263)) 128 | - Add binary install directory ([#259](https://github.com/cloudalchemy/ansible-prometheus/issues/259)) 129 | 130 | 131 | ## [2.13.2] - 2020-01-20 132 | **Merged pull requests:** 133 | 134 | - Improve checksum fetching ([#254](https://github.com/cloudalchemy/ansible-prometheus/issues/254)) 135 | - [REPO SYNC] Merge pull request [#4](https://github.com/cloudalchemy/ansible-prometheus/issues/4) from cloudalchemy/travis_fix ([#260](https://github.com/cloudalchemy/ansible-prometheus/issues/260)) 136 | 137 | 138 | ## [2.13.1] - 2020-01-11 139 | **Merged pull requests:** 140 | 141 | - Switch user login shell to /usr/sbin/nologin ([#258](https://github.com/cloudalchemy/ansible-prometheus/issues/258)) 142 | 143 | 144 | ## [2.13.0] - 2020-01-08 145 | ### Tasks 146 | - fix incorrect variable name in detection of last prometheus version 147 | 148 | **Merged pull requests:** 149 | 150 | - New prometheus/prometheus upstream release! ([#256](https://github.com/cloudalchemy/ansible-prometheus/issues/256)) 151 | - [REPO SYNC] use latest available python ([#255](https://github.com/cloudalchemy/ansible-prometheus/issues/255)) 152 | - :tada: automated upstream release update ([#253](https://github.com/cloudalchemy/ansible-prometheus/issues/253)) 153 | - New prometheus/prometheus upstream release! ([#252](https://github.com/cloudalchemy/ansible-prometheus/issues/252)) 154 | - [REPO SYNC] remove IRC link ([#251](https://github.com/cloudalchemy/ansible-prometheus/issues/251)) 155 | - Add CentOS/CentOS-8 support ([#248](https://github.com/cloudalchemy/ansible-prometheus/issues/248)) 156 | - Fix typo ([#249](https://github.com/cloudalchemy/ansible-prometheus/issues/249)) 157 | - [REPO SYNC] add declarative label sync; add autolabelling PRs ([#243](https://github.com/cloudalchemy/ansible-prometheus/issues/243)) 158 | - :robot: sync with cloudalchemy/skeleton (SHA: 4f56c046): molecule: use CI images from quay.io instead of dockerhub ([#241](https://github.com/cloudalchemy/ansible-prometheus/issues/241)) 159 | - add option to propagate binaries without access to internet ([#239](https://github.com/cloudalchemy/ansible-prometheus/issues/239)) 160 | 161 | 162 | ## [2.12.0] - 2019-11-13 163 | **Merged pull requests:** 164 | 165 | - New prometheus/prometheus upstream release! ([#240](https://github.com/cloudalchemy/ansible-prometheus/issues/240)) 166 | - :robot: sync with cloudalchemy/skeleton (SHA: 7fd422dc): Update releaser.sh ([#236](https://github.com/cloudalchemy/ansible-prometheus/issues/236)) 167 | - [REPO SYNC] add support for CentOS8 ([#233](https://github.com/cloudalchemy/ansible-prometheus/issues/233)) 168 | - :tada: automated upstream release update ([#232](https://github.com/cloudalchemy/ansible-prometheus/issues/232)) 169 | 170 | 171 | ## [2.11.0] - 2019-10-05 172 | **Merged pull requests:** 173 | 174 | - :tada: automated upstream release update ([#231](https://github.com/cloudalchemy/ansible-prometheus/issues/231)) 175 | - add RHEL8 and debian buster support; remove testing on debian je… ([#226](https://github.com/cloudalchemy/ansible-prometheus/issues/226)) 176 | - Synchronize files from cloudalchemy/skeleton ([#227](https://github.com/cloudalchemy/ansible-prometheus/issues/227)) 177 | - s/false/no/ ([#225](https://github.com/cloudalchemy/ansible-prometheus/issues/225)) 178 | - :robot: synchronize with last commit in cloudalchemy/skeleton (SHA: 1f68dc21) ([#224](https://github.com/cloudalchemy/ansible-prometheus/issues/224)) 179 | - Moving to python 3 and dropping support for python 2.x (on deplo… ([#223](https://github.com/cloudalchemy/ansible-prometheus/issues/223)) 180 | 181 | 182 | ## [2.10.0] - 2019-08-19 183 | **Merged pull requests:** 184 | 185 | - New prometheus/prometheus upstream release! ([#221](https://github.com/cloudalchemy/ansible-prometheus/issues/221)) 186 | - Support recording rules and always install default alerting rule set. ([#212](https://github.com/cloudalchemy/ansible-prometheus/issues/212)) 187 | - increase systemd service security restrictions ([#211](https://github.com/cloudalchemy/ansible-prometheus/issues/211)) 188 | - :robot: synchronize files from cloudalchemy/skeleton ([#220](https://github.com/cloudalchemy/ansible-prometheus/issues/220)) 189 | 190 | 191 | ## [2.9.3] - 2019-08-14 192 | **Merged pull requests:** 193 | 194 | - New prometheus/prometheus upstream release! ([#219](https://github.com/cloudalchemy/ansible-prometheus/issues/219)) 195 | - New prometheus/prometheus upstream release! ([#217](https://github.com/cloudalchemy/ansible-prometheus/issues/217)) 196 | 197 | 198 | ## [2.9.2] - 2019-07-11 199 | **Merged pull requests:** 200 | 201 | - :tada: automated upstream release update ([#216](https://github.com/cloudalchemy/ansible-prometheus/issues/216)) 202 | 203 | 204 | ## [2.9.1] - 2019-05-27 205 | **Merged pull requests:** 206 | 207 | - New prometheus/prometheus upstream release! ([#209](https://github.com/cloudalchemy/ansible-prometheus/issues/209)) 208 | - add watchdog and clock skew alerts ([#206](https://github.com/cloudalchemy/ansible-prometheus/issues/206)) 209 | 210 | 211 | ## [2.9.0] - 2019-05-04 212 | **Merged pull requests:** 213 | 214 | - Wait for network to be online ([#204](https://github.com/cloudalchemy/ansible-prometheus/issues/204)) 215 | - Synchronize files from cloudalchemy/skeleton ([#205](https://github.com/cloudalchemy/ansible-prometheus/issues/205)) 216 | - New prometheus/prometheus upstream release! ([#203](https://github.com/cloudalchemy/ansible-prometheus/issues/203)) 217 | - Update label for CriticalDiskSpace alert expression. ([#202](https://github.com/cloudalchemy/ansible-prometheus/issues/202)) 218 | - New prometheus/prometheus upstream release! ([#200](https://github.com/cloudalchemy/ansible-prometheus/issues/200)) 219 | - :tada: automated upstream release update ([#199](https://github.com/cloudalchemy/ansible-prometheus/issues/199)) 220 | 221 | 222 | ## [2.8.1] - 2019-03-30 223 | **Merged pull requests:** 224 | 225 | - :tada: automated upstream release update ([#197](https://github.com/cloudalchemy/ansible-prometheus/issues/197)) 226 | - set go_arch as a var instead of calculating it during task execution ([#198](https://github.com/cloudalchemy/ansible-prometheus/issues/198)) 227 | - :robot: synchronize files from cloudalchemy/skeleton ([#196](https://github.com/cloudalchemy/ansible-prometheus/issues/196)) 228 | 229 | 230 | ## [2.8.0] - 2019-03-23 231 | **Merged pull requests:** 232 | 233 | - do not remove '/opt/prometheus' ([#188](https://github.com/cloudalchemy/ansible-prometheus/issues/188)) 234 | - New prometheus upstream release! ([#193](https://github.com/cloudalchemy/ansible-prometheus/issues/193)) 235 | - prometheus.service.j2: stop using tests as filters ([#191](https://github.com/cloudalchemy/ansible-prometheus/issues/191)) 236 | - Parameterise custom static targets file paths ([#187](https://github.com/cloudalchemy/ansible-prometheus/issues/187)) 237 | - Make prometheus config folders writable by group ([#174](https://github.com/cloudalchemy/ansible-prometheus/issues/174)) 238 | - Preflight checks refactor ([#189](https://github.com/cloudalchemy/ansible-prometheus/issues/189)) 239 | 240 | 241 | ## [2.7.0] - 2019-03-04 242 | **Merged pull requests:** 243 | 244 | - :tada: automated upstream release update ([#186](https://github.com/cloudalchemy/ansible-prometheus/issues/186)) 245 | - smaller test suite on PRs ([#175](https://github.com/cloudalchemy/ansible-prometheus/issues/175)) 246 | - Reworked prometheus_alert_rules_files ([#183](https://github.com/cloudalchemy/ansible-prometheus/issues/183)) 247 | 248 | 249 | ## [2.6.0] - 2019-02-19 250 | **Merged pull requests:** 251 | 252 | - Add support for retention by size ([#182](https://github.com/cloudalchemy/ansible-prometheus/issues/182)) 253 | 254 | 255 | ## [2.5.2] - 2019-01-31 256 | 257 | ## [2.5.1] - 2019-01-30 258 | **Merged pull requests:** 259 | 260 | - :tada: automated upstream release update ([#178](https://github.com/cloudalchemy/ansible-prometheus/issues/178)) 261 | - :tada: automated upstream release update ([#172](https://github.com/cloudalchemy/ansible-prometheus/issues/172)) 262 | 263 | 264 | ## [2.5.0] - 2019-01-13 265 | **Merged pull requests:** 266 | 267 | - Change permissions of console templates to 0644. ([#171](https://github.com/cloudalchemy/ansible-prometheus/issues/171)) 268 | - better handling of prometheus user directory ([#170](https://github.com/cloudalchemy/ansible-prometheus/issues/170)) 269 | - New prometheus upstream release! ([#167](https://github.com/cloudalchemy/ansible-prometheus/issues/167)) 270 | - Alert expression fix ([#161](https://github.com/cloudalchemy/ansible-prometheus/issues/161)) 271 | - New prometheus upstream release! ([#159](https://github.com/cloudalchemy/ansible-prometheus/issues/159)) 272 | - Fix running Dry Mode and improved tag usage ([#160](https://github.com/cloudalchemy/ansible-prometheus/issues/160)) 273 | 274 | 275 | ## [2.4.1] - 2018-10-29 276 | **Merged pull requests:** 277 | 278 | - Add clarification surrounding when the .rules file is copied & where it goes ([#156](https://github.com/cloudalchemy/ansible-prometheus/issues/156)) 279 | - Resolves [#153](https://github.com/cloudalchemy/ansible-prometheus/issues/153) prometheus homedir set to /tmp ([#155](https://github.com/cloudalchemy/ansible-prometheus/issues/155)) 280 | - Document alert relabeling in README.md ([#152](https://github.com/cloudalchemy/ansible-prometheus/issues/152)) 281 | 282 | 283 | ## [2.4.0] - 2018-10-07 284 | **Merged pull requests:** 285 | 286 | - Add support for alert relabeling ([#151](https://github.com/cloudalchemy/ansible-prometheus/issues/151)) 287 | 288 | 289 | ## [2.3.4] - 2018-10-05 290 | **Merged pull requests:** 291 | 292 | - move to ansible 2.7 ([#149](https://github.com/cloudalchemy/ansible-prometheus/issues/149)) 293 | - New prometheus upstream release! ([#150](https://github.com/cloudalchemy/ansible-prometheus/issues/150)) 294 | - Fixed adding ansible comment in templates ([#147](https://github.com/cloudalchemy/ansible-prometheus/issues/147)) 295 | - Updates to set ulimit for files to infinity ([#146](https://github.com/cloudalchemy/ansible-prometheus/issues/146)) 296 | - :tada: automated upstream release update ([#145](https://github.com/cloudalchemy/ansible-prometheus/issues/145)) 297 | - newest release ([#143](https://github.com/cloudalchemy/ansible-prometheus/issues/143)) 298 | - New prometheus upstream release! ([#140](https://github.com/cloudalchemy/ansible-prometheus/issues/140)) 299 | 300 | 301 | ## [2.3.3] - 2018-09-06 302 | **Merged pull requests:** 303 | 304 | - Missing protocol causes wrong url generated ([#137](https://github.com/cloudalchemy/ansible-prometheus/issues/137)) 305 | 306 | 307 | ## [2.3.2] - 2018-08-12 308 | **Merged pull requests:** 309 | 310 | - New prometheus upstream release! ([#136](https://github.com/cloudalchemy/ansible-prometheus/issues/136)) 311 | - fixed typo ([#133](https://github.com/cloudalchemy/ansible-prometheus/issues/133)) 312 | 313 | 314 | ## [2.3.1] - 2018-07-15 315 | **Merged pull requests:** 316 | 317 | - Fix custom rule/target file copy ([#132](https://github.com/cloudalchemy/ansible-prometheus/issues/132)) 318 | 319 | 320 | ## [2.3.0] - 2018-07-01 321 | **Merged pull requests:** 322 | 323 | - use tox, ansible 2.6, and allow using remote docker host ([#130](https://github.com/cloudalchemy/ansible-prometheus/issues/130)) 324 | 325 | 326 | ## [2.2.1] - 2018-06-27 327 | **Merged pull requests:** 328 | 329 | - Allow empty value in config_flags_extra ([#128](https://github.com/cloudalchemy/ansible-prometheus/issues/128)) 330 | - Allow role being run in check mode ([#126](https://github.com/cloudalchemy/ansible-prometheus/issues/126)) 331 | - add 'tags' support ([#125](https://github.com/cloudalchemy/ansible-prometheus/issues/125)) 332 | 333 | 334 | ## [2.2.0] - 2018-06-09 335 | **Merged pull requests:** 336 | 337 | - Prometheus 2.3.0 ([#124](https://github.com/cloudalchemy/ansible-prometheus/issues/124)) 338 | - fix prometheus_targets default value. ([#123](https://github.com/cloudalchemy/ansible-prometheus/issues/123)) 339 | 340 | 341 | ## [2.1.2] - 2018-06-02 342 | **Merged pull requests:** 343 | 344 | - Let prometheus rule_files config always be written ([#122](https://github.com/cloudalchemy/ansible-prometheus/issues/122)) 345 | - specify file name for dest in get_url call ([#121](https://github.com/cloudalchemy/ansible-prometheus/issues/121)) 346 | 347 | 348 | ## [2.1.1] - 2018-05-27 349 | **Merged pull requests:** 350 | 351 | - fix architecture var parsing ([#119](https://github.com/cloudalchemy/ansible-prometheus/issues/119)) 352 | - use cloudalchemybot when accessing github api ([#120](https://github.com/cloudalchemy/ansible-prometheus/issues/120)) 353 | 354 | 355 | ## [2.1.0] - 2018-05-25 356 | **Merged pull requests:** 357 | 358 | - Deploy console templates ([#118](https://github.com/cloudalchemy/ansible-prometheus/issues/118)) 359 | - fix condition in systemd template ([#117](https://github.com/cloudalchemy/ansible-prometheus/issues/117)) 360 | 361 | 362 | ## [2.0.0] - 2018-05-17 363 | **Merged pull requests:** 364 | 365 | - remove prometheus 1.8 support ([#113](https://github.com/cloudalchemy/ansible-prometheus/issues/113)) 366 | - [ci skip] explainations ([#114](https://github.com/cloudalchemy/ansible-prometheus/issues/114)) 367 | - Hardening systemd unit for additional security ([#110](https://github.com/cloudalchemy/ansible-prometheus/issues/110)) 368 | - take care of SELinux only when it is enabled ([#112](https://github.com/cloudalchemy/ansible-prometheus/issues/112)) 369 | - Offer a better IRC Web clients to users ([#107](https://github.com/cloudalchemy/ansible-prometheus/issues/107)) 370 | - move to molecule 2.x ([#108](https://github.com/cloudalchemy/ansible-prometheus/issues/108)) 371 | - add checksum verification ([#109](https://github.com/cloudalchemy/ansible-prometheus/issues/109)) 372 | 373 | 374 | ## [1.1.2] - 2018-04-20 375 | **Merged pull requests:** 376 | 377 | - Merge pull request [#102](https://github.com/cloudalchemy/ansible-prometheus/issues/102) from cloudalchemy/issue101 378 | - Merge pull request [#106](https://github.com/cloudalchemy/ansible-prometheus/issues/106) from Porkepix/fix_filters_warnings 379 | 380 | 381 | ## [1.1.1] - 2018-04-17 382 | **Merged pull requests:** 383 | 384 | - Merge pull request [#99](https://github.com/cloudalchemy/ansible-prometheus/issues/99) from cloudalchemy/simplify_targets 385 | - Merge pull request [#100](https://github.com/cloudalchemy/ansible-prometheus/issues/100) from cloudalchemy/paulfantom-patch-1 386 | 387 | 388 | ## [1.1.0] - 2018-04-13 389 | **Merged pull requests:** 390 | 391 | - Merge pull request [#94](https://github.com/cloudalchemy/ansible-prometheus/issues/94) from cloudalchemy/issue90 392 | - Merge pull request [#92](https://github.com/cloudalchemy/ansible-prometheus/issues/92) from cloudalchemy/beautify 393 | - Merge pull request [#91](https://github.com/cloudalchemy/ansible-prometheus/issues/91) from cloudalchemy/paulfantom-patch-1 394 | 395 | 396 | ## [1.0.10] - 2018-04-10 397 | **Merged pull requests:** 398 | 399 | - Merge pull request [#88](https://github.com/cloudalchemy/ansible-prometheus/issues/88) from cloudalchemy/deprecation_warnings 400 | 401 | 402 | ## [1.0.9] - 2018-04-07 403 | **Merged pull requests:** 404 | 405 | - Merge pull request [#87](https://github.com/cloudalchemy/ansible-prometheus/issues/87) from cloudalchemy/paulfantom-patch-1 406 | 407 | 408 | ## [1.0.8] - 2018-04-05 409 | **Merged pull requests:** 410 | 411 | - Merge pull request [#86](https://github.com/cloudalchemy/ansible-prometheus/issues/86) from cloudalchemy/paulfantom-patch-1 412 | 413 | 414 | ## [1.0.7] - 2018-04-03 415 | **Merged pull requests:** 416 | 417 | - Merge pull request [#85](https://github.com/cloudalchemy/ansible-prometheus/issues/85) from cloudalchemy/parametrized_tests 418 | 419 | 420 | ## [1.0.6] - 2018-03-26 421 | **Merged pull requests:** 422 | 423 | - Merge pull request [#82](https://github.com/cloudalchemy/ansible-prometheus/issues/82) from cloudalchemy/bionic 424 | 425 | 426 | ## [1.0.5] - 2018-03-24 427 | **Merged pull requests:** 428 | 429 | - Merge pull request [#84](https://github.com/cloudalchemy/ansible-prometheus/issues/84) from cloudalchemy/new_ansible 430 | 431 | 432 | ## [1.0.4] - 2018-03-22 433 | **Merged pull requests:** 434 | 435 | - Merge pull request [#83](https://github.com/cloudalchemy/ansible-prometheus/issues/83) from swesterveld/fix-warning-jinja2-delimiters-in-when-statement 436 | 437 | 438 | ## [1.0.3] - 2018-03-15 439 | 440 | ## [1.0.2] - 2018-03-15 441 | **Merged pull requests:** 442 | 443 | - Merge pull request [#79](https://github.com/cloudalchemy/ansible-prometheus/issues/79) from cloudalchemy/selinux 444 | - Merge pull request [#81](https://github.com/cloudalchemy/ansible-prometheus/issues/81) from bngsudheer/master 445 | 446 | 447 | ## [1.0.1] - 2018-03-09 448 | **Merged pull requests:** 449 | 450 | - Merge pull request [#80](https://github.com/cloudalchemy/ansible-prometheus/issues/80) from cloudalchemy/version_2.2 451 | 452 | 453 | ## [1.0.0] - 2018-02-25 454 | 455 | ## [0.12.2] - 2018-02-14 456 | **Merged pull requests:** 457 | 458 | - Merge pull request [#78](https://github.com/cloudalchemy/ansible-prometheus/issues/78) from swesterveld/fix_typo_decritpion 459 | 460 | 461 | ## [0.12.1] - 2018-02-14 462 | **Merged pull requests:** 463 | 464 | - Merge pull request [#77](https://github.com/cloudalchemy/ansible-prometheus/issues/77) from swesterveld/fix_daemon_reload_for_role_include 465 | 466 | 467 | ## [0.12.0] - 2018-02-11 468 | **Merged pull requests:** 469 | 470 | - Merge pull request [#76](https://github.com/cloudalchemy/ansible-prometheus/issues/76) from cloudalchemy/remote_read 471 | 472 | 473 | ## [0.11.4] - 2018-02-10 474 | **Merged pull requests:** 475 | 476 | - Merge pull request [#75](https://github.com/cloudalchemy/ansible-prometheus/issues/75) from cloudalchemy/restrict_access 477 | 478 | 479 | ## [0.11.3] - 2018-02-10 480 | **Merged pull requests:** 481 | 482 | - Merge pull request [#71](https://github.com/cloudalchemy/ansible-prometheus/issues/71) from cloudalchemy/linux_hier 483 | - Merge pull request [#72](https://github.com/cloudalchemy/ansible-prometheus/issues/72) from cloudalchemy/non_superuser 484 | 485 | 486 | ## [0.11.2] - 2018-02-07 487 | **Merged pull requests:** 488 | 489 | - Merge pull request [#70](https://github.com/cloudalchemy/ansible-prometheus/issues/70) from cloudalchemy/paulfantom-patch-1 490 | 491 | 492 | ## [0.11.1] - 2018-02-06 493 | **Merged pull requests:** 494 | 495 | - Merge pull request [#59](https://github.com/cloudalchemy/ansible-prometheus/issues/59) from cloudalchemy/issue57 496 | 497 | 498 | ## [0.11.0] - 2018-02-03 499 | **Merged pull requests:** 500 | 501 | - Merge pull request [#69](https://github.com/cloudalchemy/ansible-prometheus/issues/69) from cloudalchemy/superq/FOSDEM-2018 502 | 503 | 504 | ## [0.10.6] - 2018-02-03 505 | **Merged pull requests:** 506 | 507 | - Merge pull request [#68](https://github.com/cloudalchemy/ansible-prometheus/issues/68) from cloudalchemy/paulfantom-patch-1 508 | 509 | 510 | ## [0.10.5] - 2018-01-22 511 | **Merged pull requests:** 512 | 513 | - Merge pull request [#67](https://github.com/cloudalchemy/ansible-prometheus/issues/67) from cloudalchemy/global_defaults 514 | 515 | 516 | ## [0.10.4] - 2018-01-20 517 | **Merged pull requests:** 518 | 519 | - Merge pull request [#66](https://github.com/cloudalchemy/ansible-prometheus/issues/66) from cloudalchemy/paulfantom-patch-1 520 | 521 | 522 | ## [0.10.3] - 2018-01-17 523 | **Merged pull requests:** 524 | 525 | - Merge pull request [#65](https://github.com/cloudalchemy/ansible-prometheus/issues/65) from cloudalchemy/add_alert_rules 526 | 527 | 528 | ## [0.10.2] - 2018-01-17 529 | **Merged pull requests:** 530 | 531 | - a little bit of python3 support ([#64](https://github.com/cloudalchemy/ansible-prometheus/issues/64)) 532 | 533 | 534 | ## [0.10.1] - 2018-01-16 535 | **Merged pull requests:** 536 | 537 | - validate prometheus_config_flags_extra ([#62](https://github.com/cloudalchemy/ansible-prometheus/issues/62)) 538 | 539 | 540 | ## [0.10.0] - 2018-01-15 541 | **Merged pull requests:** 542 | 543 | - [feature] multiple target files loaded with file_sd ([#60](https://github.com/cloudalchemy/ansible-prometheus/issues/60)) 544 | - Merge pull request [#61](https://github.com/cloudalchemy/ansible-prometheus/issues/61) from cloudalchemy/paulfantom-patch-1 545 | 546 | 547 | ## [0.9.4] - 2018-01-13 548 | **Merged pull requests:** 549 | 550 | - Merge pull request [#43](https://github.com/cloudalchemy/ansible-prometheus/issues/43) from cloudalchemy/issue42 551 | 552 | 553 | ## [0.9.3] - 2018-01-11 554 | **Merged pull requests:** 555 | 556 | - Merge pull request [#55](https://github.com/cloudalchemy/ansible-prometheus/issues/55) from cloudalchemy/tests 557 | 558 | 559 | ## [0.9.2] - 2018-01-07 560 | **Merged pull requests:** 561 | 562 | - Merge pull request [#54](https://github.com/cloudalchemy/ansible-prometheus/issues/54) from cloudalchemy/add_arch 563 | - Merge pull request [#53](https://github.com/cloudalchemy/ansible-prometheus/issues/53) from cloudalchemy/paulfantom-patch-1 564 | 565 | 566 | ## [0.9.1] - 2018-01-03 567 | **Merged pull requests:** 568 | 569 | - Merge pull request [#50](https://github.com/cloudalchemy/ansible-prometheus/issues/50) from SuperQ/scrape_config 570 | - Merge pull request [#52](https://github.com/cloudalchemy/ansible-prometheus/issues/52) from cloudalchemy/paulfantom-patch-1 571 | 572 | 573 | ## [0.9.0] - 2018-01-02 574 | **Merged pull requests:** 575 | 576 | - Merge pull request [#51](https://github.com/cloudalchemy/ansible-prometheus/issues/51) from cloudalchemy/docs 577 | 578 | 579 | ## [0.8.0] - 2018-01-02 580 | **Merged pull requests:** 581 | 582 | - Merge pull request [#48](https://github.com/cloudalchemy/ansible-prometheus/issues/48) from cloudalchemy/raspberrypi 583 | - Merge pull request [#49](https://github.com/cloudalchemy/ansible-prometheus/issues/49) from cloudalchemy/paulfantom-patch-1 584 | 585 | 586 | ## [0.7.14] - 2017-12-31 587 | **Merged pull requests:** 588 | 589 | - Merge pull request [#47](https://github.com/cloudalchemy/ansible-prometheus/issues/47) from cloudalchemy/paulfantom-patch-1 590 | 591 | 592 | ## [0.7.13] - 2017-12-30 593 | **Merged pull requests:** 594 | 595 | - Merge pull request [#46](https://github.com/cloudalchemy/ansible-prometheus/issues/46) from cloudalchemy/remove_dns 596 | 597 | 598 | ## [0.7.12] - 2017-12-27 599 | **Merged pull requests:** 600 | 601 | - Merge pull request [#41](https://github.com/cloudalchemy/ansible-prometheus/issues/41) from anisse/patch-1 602 | 603 | 604 | ## [0.7.11] - 2017-12-27 605 | **Merged pull requests:** 606 | 607 | - Merge pull request [#40](https://github.com/cloudalchemy/ansible-prometheus/issues/40) from cloudalchemy/issue34 608 | - Merge pull request [#38](https://github.com/cloudalchemy/ansible-prometheus/issues/38) from cloudalchemy/alerts 609 | 610 | 611 | ## [0.7.10] - 2017-12-22 612 | **Merged pull requests:** 613 | 614 | - Merge pull request [#39](https://github.com/cloudalchemy/ansible-prometheus/issues/39) from cloudalchemy/paulfantom-patch-1 615 | 616 | 617 | ## [0.7.9] - 2017-12-18 618 | **Merged pull requests:** 619 | 620 | - Merge pull request [#35](https://github.com/cloudalchemy/ansible-prometheus/issues/35) from cloudalchemy/issue18 621 | - Merge pull request [#36](https://github.com/cloudalchemy/ansible-prometheus/issues/36) from cloudalchemy/paulfantom-patch-1 622 | - Merge pull request [#37](https://github.com/cloudalchemy/ansible-prometheus/issues/37) from cloudalchemy/paulfantom-patch-2 623 | 624 | 625 | ## [0.7.8] - 2017-12-17 626 | **Merged pull requests:** 627 | 628 | - Merge pull request [#32](https://github.com/cloudalchemy/ansible-prometheus/issues/32) from cloudalchemy/issue27 629 | 630 | 631 | ## [0.7.7] - 2017-12-17 632 | **Merged pull requests:** 633 | 634 | - Merge pull request [#31](https://github.com/cloudalchemy/ansible-prometheus/issues/31) from cloudalchemy/alerts 635 | - Merge pull request [#30](https://github.com/cloudalchemy/ansible-prometheus/issues/30) from cloudalchemy/readme 636 | 637 | 638 | ## [0.7.6] - 2017-12-17 639 | **Merged pull requests:** 640 | 641 | - Merge pull request [#29](https://github.com/cloudalchemy/ansible-prometheus/issues/29) from cloudalchemy/ci 642 | 643 | 644 | ## [0.7.5] - 2017-12-15 645 | **Merged pull requests:** 646 | 647 | - Merge pull request [#28](https://github.com/cloudalchemy/ansible-prometheus/issues/28) from cloudalchemy/fix_defaults_var 648 | 649 | 650 | ## [0.7.4] - 2017-12-15 651 | **Merged pull requests:** 652 | 653 | - Merge pull request [#24](https://github.com/cloudalchemy/ansible-prometheus/issues/24) from cloudalchemy/issue[#19](https://github.com/cloudalchemy/ansible-prometheus/issues/19) 654 | 655 | 656 | ## [0.7.3] - 2017-12-15 657 | **Merged pull requests:** 658 | 659 | - Merge pull request [#21](https://github.com/cloudalchemy/ansible-prometheus/issues/21) from cloudalchemy/custom_config 660 | - Merge pull request [#26](https://github.com/cloudalchemy/ansible-prometheus/issues/26) from cloudalchemy/systemd 661 | - Merge pull request [#23](https://github.com/cloudalchemy/ansible-prometheus/issues/23) from cloudalchemy/go_arch 662 | 663 | 664 | ## [0.7.2] - 2017-12-08 665 | **Merged pull requests:** 666 | 667 | - Merge pull request [#20](https://github.com/cloudalchemy/ansible-prometheus/issues/20) from Scypho/bugfix/service_unit_newline 668 | 669 | 670 | ## [0.7.1] - 2017-12-06 671 | **Merged pull requests:** 672 | 673 | - Merge pull request [#13](https://github.com/cloudalchemy/ansible-prometheus/issues/13) from cloudalchemy/paulfantom-patch-1 674 | - Merge pull request [#14](https://github.com/cloudalchemy/ansible-prometheus/issues/14) from cloudalchemy/paulfantom-patch-2 675 | - Merge pull request [#17](https://github.com/cloudalchemy/ansible-prometheus/issues/17) from cloudalchemy/paulfantom-patch-3 676 | 677 | 678 | ## [0.7.0] - 2017-12-01 679 | **Merged pull requests:** 680 | 681 | - Merge pull request [#11](https://github.com/cloudalchemy/ansible-prometheus/issues/11) from cloudalchemy/feature_rules 682 | 683 | 684 | ## [0.6.12] - 2017-12-01 685 | **Merged pull requests:** 686 | 687 | - Fix tagging ([#12](https://github.com/cloudalchemy/ansible-prometheus/issues/12)) 688 | 689 | 690 | ## [0.6.11] - 2017-11-30 691 | **Merged pull requests:** 692 | 693 | - Merge pull request [#10](https://github.com/cloudalchemy/ansible-prometheus/issues/10) from cloudalchemy/prometheus_job 694 | 695 | 696 | ## [0.6.9] - 2017-11-28 697 | **Merged pull requests:** 698 | 699 | - Merge pull request [#9](https://github.com/cloudalchemy/ansible-prometheus/issues/9) from cloudalchemy/paulfantom-patch-1 700 | - Merge pull request [#6](https://github.com/cloudalchemy/ansible-prometheus/issues/6) from cloudalchemy/external_labels 701 | 702 | 703 | ## [0.6.7] - 2017-11-28 704 | **Merged pull requests:** 705 | 706 | - Update generatetag.sh ([#8](https://github.com/cloudalchemy/ansible-prometheus/issues/8)) 707 | 708 | 709 | ## [0.6.5] - 2017-11-28 710 | **Merged pull requests:** 711 | 712 | - test different ansible versions ([#5](https://github.com/cloudalchemy/ansible-prometheus/issues/5)) 713 | - Merge pull request [#7](https://github.com/cloudalchemy/ansible-prometheus/issues/7) from cloudalchemy/paulfantom-patch-1 714 | - Merge pull request [#26](https://github.com/cloudalchemy/ansible-prometheus/issues/26) from SoInteractive/alerts_rules_when 715 | 716 | 717 | ## [0.6.4] - 2017-11-23 718 | **Merged pull requests:** 719 | 720 | - Merge pull request [#24](https://github.com/cloudalchemy/ansible-prometheus/issues/24) from paulfantom/master 721 | 722 | 723 | ## [0.6.3] - 2017-11-23 724 | **Merged pull requests:** 725 | 726 | - Merge pull request [#25](https://github.com/cloudalchemy/ansible-prometheus/issues/25) from SoInteractive/jkrol2-patch-1 727 | 728 | 729 | ## [0.6.2] - 2017-11-22 730 | **Merged pull requests:** 731 | 732 | - Merge pull request [#23](https://github.com/cloudalchemy/ansible-prometheus/issues/23) from paulfantom/master 733 | 734 | 735 | ## [0.6.1] - 2017-11-22 736 | **Merged pull requests:** 737 | 738 | - Merge pull request [#16](https://github.com/cloudalchemy/ansible-prometheus/issues/16) from SoInteractive/add_proxy 739 | 740 | 741 | ## [0.6.0] - 2017-11-22 742 | **Merged pull requests:** 743 | 744 | - Merge pull request [#22](https://github.com/cloudalchemy/ansible-prometheus/issues/22) from SoInteractive/update_2.0 745 | 746 | 747 | ## [0.5.5] - 2017-11-13 748 | **Merged pull requests:** 749 | 750 | - Merge pull request [#21](https://github.com/cloudalchemy/ansible-prometheus/issues/21) from SoInteractive/fix_alert_config 751 | 752 | 753 | ## [0.5.4] - 2017-11-13 754 | **Merged pull requests:** 755 | 756 | - Merge pull request [#20](https://github.com/cloudalchemy/ansible-prometheus/issues/20) from SoInteractive/alertmanager_config 757 | 758 | 759 | ## [0.5.3] - 2017-11-07 760 | **Merged pull requests:** 761 | 762 | - Merge pull request [#19](https://github.com/cloudalchemy/ansible-prometheus/issues/19) from SoInteractive/pkrupa2-patch-1 763 | 764 | 765 | ## [0.5.2] - 2017-10-22 766 | **Merged pull requests:** 767 | 768 | - Merge pull request [#15](https://github.com/cloudalchemy/ansible-prometheus/issues/15) from bngsudheer/master 769 | 770 | 771 | ## [0.5.1] - 2017-10-17 772 | **Merged pull requests:** 773 | 774 | - Merge pull request [#13](https://github.com/cloudalchemy/ansible-prometheus/issues/13) from bngsudheer/master 775 | 776 | 777 | ## [0.5.0] - 2017-10-16 778 | **Merged pull requests:** 779 | 780 | - Merge pull request [#12](https://github.com/cloudalchemy/ansible-prometheus/issues/12) from SoInteractive/feature_travis 781 | 782 | 783 | ## [0.4.1] - 2017-10-05 784 | **Merged pull requests:** 785 | 786 | - Merge pull request [#11](https://github.com/cloudalchemy/ansible-prometheus/issues/11) from SoInteractive/systemd 787 | 788 | 789 | ## [0.4.0] - 2017-09-27 790 | **Merged pull requests:** 791 | 792 | - Merge pull request [#10](https://github.com/cloudalchemy/ansible-prometheus/issues/10) from paulfantom/feature_cleanup 793 | 794 | 795 | ## [0.3.1] - 2017-08-21 796 | 797 | ## [0.3.2] - 2017-08-21 798 | **Merged pull requests:** 799 | 800 | - Merge pull request [#9](https://github.com/cloudalchemy/ansible-prometheus/issues/9) from markopolo123/master 801 | 802 | 803 | ## [0.2.0] - 2017-07-21 804 | 805 | ## [0.3.0] - 2017-07-21 806 | **Merged pull requests:** 807 | 808 | - Merge pull request [#8](https://github.com/cloudalchemy/ansible-prometheus/issues/8) from SoInteractive/feature_autoupdate_minor 809 | 810 | 811 | ## [0.1.6] - 2017-07-11 812 | 813 | ## [0.1.7] - 2017-07-11 814 | **Merged pull requests:** 815 | 816 | - Merge pull request [#4](https://github.com/cloudalchemy/ansible-prometheus/issues/4) from SoInteractive/alert_rules 817 | 818 | 819 | ## [0.1.5] - 2017-07-11 820 | **Merged pull requests:** 821 | 822 | - Merge pull request [#5](https://github.com/cloudalchemy/ansible-prometheus/issues/5) from SoInteractive/tgroup_template 823 | 824 | 825 | ## [0.1.4] - 2017-07-10 826 | **Merged pull requests:** 827 | 828 | - Merge pull request [#3](https://github.com/cloudalchemy/ansible-prometheus/issues/3) from SoInteractive/up_to_171 829 | 830 | 831 | ## [0.1.3] - 2017-06-20 832 | **Merged pull requests:** 833 | 834 | - Merge pull request [#2](https://github.com/cloudalchemy/ansible-prometheus/issues/2) from SoInteractive/tgroup_template 835 | 836 | 837 | ## [0.1.2] - 2017-06-14 838 | 839 | ## [0.1.1] - 2017-06-13 840 | **Merged pull requests:** 841 | 842 | - Merge pull request [#1](https://github.com/cloudalchemy/ansible-prometheus/issues/1) from SoInteractive/file_sd 843 | 844 | 845 | ## [0.1.0] - 2017-06-06 846 | 847 | ## [0.0.6] - 2017-05-23 848 | 849 | ## [0.0.5] - 2017-05-23 850 | 851 | ## [0.0.4] - 2017-05-15 852 | 853 | ## [0.0.3] - 2017-05-09 854 | 855 | ## [0.0.2] - 2017-05-09 856 | 857 | ## 0.0.1 - 2017-05-02 858 | 859 | [Unreleased]: https://github.com/cloudalchemy/ansible-prometheus/compare/4.0.0...HEAD 860 | [4.0.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/3.0.0...4.0.0 861 | [3.0.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.17.0...3.0.0 862 | [2.17.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.16.3...2.17.0 863 | [2.16.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.16.2...2.16.3 864 | [2.16.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.16.1...2.16.2 865 | [2.16.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.16.0...2.16.1 866 | [2.16.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.5...2.16.0 867 | [2.15.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.4...2.15.5 868 | [2.15.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.3...2.15.4 869 | [2.15.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.2...2.15.3 870 | [2.15.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.1...2.15.2 871 | [2.15.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.15.0...2.15.1 872 | [2.15.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.14.2...2.15.0 873 | [2.14.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.14.1...2.14.2 874 | [2.14.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.14.0...2.14.1 875 | [2.14.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.13.2...2.14.0 876 | [2.13.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.13.1...2.13.2 877 | [2.13.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.13.0...2.13.1 878 | [2.13.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.12.0...2.13.0 879 | [2.12.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.11.0...2.12.0 880 | [2.11.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.10.0...2.11.0 881 | [2.10.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.9.3...2.10.0 882 | [2.9.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.9.2...2.9.3 883 | [2.9.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.9.1...2.9.2 884 | [2.9.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.9.0...2.9.1 885 | [2.9.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.8.1...2.9.0 886 | [2.8.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.8.0...2.8.1 887 | [2.8.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.7.0...2.8.0 888 | [2.7.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.6.0...2.7.0 889 | [2.6.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.5.2...2.6.0 890 | [2.5.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.5.1...2.5.2 891 | [2.5.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.5.0...2.5.1 892 | [2.5.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.4.1...2.5.0 893 | [2.4.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.4.0...2.4.1 894 | [2.4.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.3.4...2.4.0 895 | [2.3.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.3.3...2.3.4 896 | [2.3.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.3.2...2.3.3 897 | [2.3.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.3.1...2.3.2 898 | [2.3.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.3.0...2.3.1 899 | [2.3.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.2.1...2.3.0 900 | [2.2.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.2.0...2.2.1 901 | [2.2.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.1.2...2.2.0 902 | [2.1.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.1.1...2.1.2 903 | [2.1.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.1.0...2.1.1 904 | [2.1.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/2.0.0...2.1.0 905 | [2.0.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.1.2...2.0.0 906 | [1.1.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.1.1...1.1.2 907 | [1.1.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.1.0...1.1.1 908 | [1.1.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.10...1.1.0 909 | [1.0.10]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.9...1.0.10 910 | [1.0.9]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.8...1.0.9 911 | [1.0.8]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.7...1.0.8 912 | [1.0.7]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.6...1.0.7 913 | [1.0.6]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.5...1.0.6 914 | [1.0.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.4...1.0.5 915 | [1.0.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.3...1.0.4 916 | [1.0.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.2...1.0.3 917 | [1.0.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.1...1.0.2 918 | [1.0.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/1.0.0...1.0.1 919 | [1.0.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.12.2...1.0.0 920 | [0.12.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.12.1...0.12.2 921 | [0.12.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.12.0...0.12.1 922 | [0.12.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.11.4...0.12.0 923 | [0.11.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.11.3...0.11.4 924 | [0.11.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.11.2...0.11.3 925 | [0.11.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.11.1...0.11.2 926 | [0.11.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.11.0...0.11.1 927 | [0.11.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.6...0.11.0 928 | [0.10.6]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.5...0.10.6 929 | [0.10.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.4...0.10.5 930 | [0.10.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.3...0.10.4 931 | [0.10.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.2...0.10.3 932 | [0.10.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.1...0.10.2 933 | [0.10.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.10.0...0.10.1 934 | [0.10.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.9.4...0.10.0 935 | [0.9.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.9.3...0.9.4 936 | [0.9.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.9.2...0.9.3 937 | [0.9.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.9.1...0.9.2 938 | [0.9.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.9.0...0.9.1 939 | [0.9.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.8.0...0.9.0 940 | [0.8.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.14...0.8.0 941 | [0.7.14]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.13...0.7.14 942 | [0.7.13]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.12...0.7.13 943 | [0.7.12]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.11...0.7.12 944 | [0.7.11]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.10...0.7.11 945 | [0.7.10]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.9...0.7.10 946 | [0.7.9]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.8...0.7.9 947 | [0.7.8]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.7...0.7.8 948 | [0.7.7]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.6...0.7.7 949 | [0.7.6]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.5...0.7.6 950 | [0.7.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.4...0.7.5 951 | [0.7.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.3...0.7.4 952 | [0.7.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.2...0.7.3 953 | [0.7.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.1...0.7.2 954 | [0.7.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.7.0...0.7.1 955 | [0.7.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.12...0.7.0 956 | [0.6.12]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.11...0.6.12 957 | [0.6.11]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.9...0.6.11 958 | [0.6.9]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.7...0.6.9 959 | [0.6.7]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.5...0.6.7 960 | [0.6.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.4...0.6.5 961 | [0.6.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.3...0.6.4 962 | [0.6.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.2...0.6.3 963 | [0.6.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.1...0.6.2 964 | [0.6.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.6.0...0.6.1 965 | [0.6.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.5...0.6.0 966 | [0.5.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.4...0.5.5 967 | [0.5.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.3...0.5.4 968 | [0.5.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.2...0.5.3 969 | [0.5.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.1...0.5.2 970 | [0.5.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.5.0...0.5.1 971 | [0.5.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.4.1...0.5.0 972 | [0.4.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.4.0...0.4.1 973 | [0.4.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.3.1...0.4.0 974 | [0.3.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.3.2...0.3.1 975 | [0.3.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.2.0...0.3.2 976 | [0.2.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.3.0...0.2.0 977 | [0.3.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.6...0.3.0 978 | [0.1.6]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.7...0.1.6 979 | [0.1.7]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.5...0.1.7 980 | [0.1.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.4...0.1.5 981 | [0.1.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.3...0.1.4 982 | [0.1.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.2...0.1.3 983 | [0.1.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.1...0.1.2 984 | [0.1.1]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.1.0...0.1.1 985 | [0.1.0]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.6...0.1.0 986 | [0.0.6]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.5...0.0.6 987 | [0.0.5]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.4...0.0.5 988 | [0.0.4]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.3...0.0.4 989 | [0.0.3]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.2...0.0.3 990 | [0.0.2]: https://github.com/cloudalchemy/ansible-prometheus/compare/0.0.1...0.0.2 991 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributor Guideline 2 | 3 | This document provides an overview of how you can participate in improving this project or extending it. We are 4 | grateful for all your help: bug reports and fixes, code contributions, documentation or ideas. Feel free to join, we 5 | appreciate your support!! 6 | 7 | ## Communication 8 | 9 | ### GitHub repositories 10 | 11 | Much of the issues, goals and ideas are tracked in the respective projects in GitHub. Please use this channel to report 12 | bugs, ask questions, and request new features . 13 | 14 | ## git and GitHub 15 | 16 | In order to contribute code please: 17 | 18 | 1. Fork the project on GitHub 19 | 2. Clone the project 20 | 3. Add changes (and tests) 21 | 4. Commit and push 22 | 5. Create a merge-request 23 | 24 | To have your code merged, see the expectations listed below. 25 | 26 | You can find a well-written guide [here](https://help.github.com/articles/fork-a-repo). 27 | 28 | Please follow common commit best-practices. Be explicit, have a short summary, a well-written description and 29 | references. This is especially important for the merge-request. 30 | 31 | Some great guidelines can be found [here](https://wiki.openstack.org/wiki/GitCommitMessages) and 32 | [here](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message). 33 | 34 | ## Releases 35 | 36 | We try to stick to semantic versioning and our releases are automated. Release is created by assigning a keyword (in a 37 | way similar to travis [`[ci skip]`](https://docs.travis-ci.com/user/customizing-the-build#Skipping-a-build)) to a 38 | commit with merge request. Available keywords are (square brackets are important!): 39 | 40 | * `[patch]`, `[fix]` - for PATCH version release 41 | * `[minor]`, `[feature]`, `[feat]` - for MINOR version release 42 | * `[major]`, `[breaking change]` - for MAJOR version release 43 | 44 | ## Changelog 45 | 46 | Changelog is generateg automatically on every merged Pull Request and all information is taken from github issues, PRs 47 | and labels. 48 | 49 | ## Expectations 50 | 51 | ### Keep it simple 52 | 53 | We try to provide production ready ansible roles which should be as much zero-conf as possible but this doesn't mean to 54 | overcomplicate things. Just follow [KISS](https://en.wikipedia.org/wiki/KISS_principle). 55 | 56 | ### Be explicit 57 | 58 | * Please avoid using nonsensical property and variable names. 59 | * Use self-describing attribute names for user configuration. 60 | * In case of failures, communicate what happened and why a failure occurs to the user. Make it easy to track the code 61 | or action that produced the error. Try to catch and handle errors if possible to provide improved failure messages. 62 | 63 | 64 | ### Add tests 65 | 66 | We are striving to use at least two test scenarios located in [/molecule](molecule) directory. First one 67 | ([default](molecule/default)) is testing default configuration without any additional variables, second one 68 | ([alternative](molecule/alternative)) is testing what happens when many variables from 69 | [/defaults/main.yml](defaults/main.yml) are changed. When adding new functionalities please add tests to proper 70 | scenarios. Tests are written in testinfra framework and are located in `/tests` subdirectory of scenario directory 71 | (for example default tests are in [/molecule/default/tests](molecule/default/tests)). 72 | More information about: 73 | - [testinfra](http://testinfra.readthedocs.io/en/latest/index.html) 74 | - [molecule](https://molecule.readthedocs.io/en/latest/index.html) 75 | 76 | ### Follow best practices 77 | 78 | Please follow [ansible best practices](http://docs.ansible.com/ansible/latest/playbooks_best_practices.html) and 79 | especially provide meaningful names to tasks and even comments where needed. 80 | 81 | Our test framework automatically lints code with [`yamllint`](https://yamllint.readthedocs.io) and 82 | [`ansible-lint`](https://github.com/willthames/ansible-lint) programs so be sure to follow their rules. 83 | 84 | Remember: Code is generally read much more often than written. 85 | 86 | ### Use Markdown 87 | 88 | Wherever possible, please refrain from any other formats and stick to simple markdown. 89 | 90 | ## Requirements regarding roles design 91 | 92 | We are trying to create the best and most secure installation method for non-containerized prometheus stack components. 93 | To accomplish this all roles need to support: 94 | 95 | - current and at least one previous ansible version (wherever possible we try to support 2 previous ansible versions) 96 | - systemd as the only available process manager 97 | - at least latest debian and CentOS distributions 98 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017-2018 Pawel Krupa, Roman Demachkovych 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | **This role has been deprecated in favor of a the [prometheus-community/ansible](https://github.com/prometheus-community/ansible) collection.** 4 | 5 | # Ansible Role: prometheus 6 | 7 | [![CircleCI](https://circleci.com/gh/cloudalchemy/prometheus.svg?style=svg)](https://circleci.com/gh/cloudalchemy/prometheus) 8 | [![License](https://img.shields.io/badge/license-MIT%20License-brightgreen.svg)](https://opensource.org/licenses/MIT) 9 | [![Ansible Role](https://img.shields.io/badge/ansible%20role-cloudalchemy.prometheus-blue.svg)](https://galaxy.ansible.com/cloudalchemy/prometheus/) 10 | [![GitHub tag](https://img.shields.io/github/tag/cloudalchemy/ansible-prometheus.svg)](https://github.com/cloudalchemy/ansible-prometheus/tags) 11 | 12 | ## Description 13 | 14 | Deploy [Prometheus](https://github.com/prometheus/prometheus) monitoring system using ansible. 15 | 16 | ### Upgradability notice 17 | 18 | When upgrading from <= 2.4.0 version of this role to >= 2.4.1 please turn off your prometheus instance. More in [2.4.1 release notes](https://github.com/cloudalchemy/ansible-prometheus/releases/tag/2.4.1) 19 | 20 | ## Requirements 21 | 22 | - Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it) 23 | - jmespath on deployer machine. If you are using Ansible from a Python virtualenv, install *jmespath* to the same virtualenv via pip. 24 | - gnu-tar on Mac deployer host (`brew install gnu-tar`) 25 | 26 | ## Role Variables 27 | 28 | All variables which can be overridden are stored in [defaults/main.yml](defaults/main.yml) file as well as in table below. 29 | 30 | | Name | Default Value | Description | 31 | | -------------- | ------------- | -----------------------------------| 32 | | `prometheus_version` | 2.27.0 | Prometheus package version. Also accepts `latest` as parameter. Only prometheus 2.x is supported | 33 | | `prometheus_skip_install` | false | Prometheus installation tasks gets skipped when set to true. | 34 | | `prometheus_binary_local_dir` | "" | Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where `prometheus` AND `promtool` binaries are stored on host on which ansible is ran. This overrides `prometheus_version` parameter | 35 | | `prometheus_config_dir` | /etc/prometheus | Path to directory with prometheus configuration | 36 | | `prometheus_db_dir` | /var/lib/prometheus | Path to directory with prometheus database | 37 | | `prometheus_read_only_dirs`| [] | Additional paths that Prometheus is allowed to read (useful for SSL certs outside of the config directory) | 38 | | `prometheus_web_listen_address` | "0.0.0.0:9090" | Address on which prometheus will be listening | 39 | | `prometheus_web_config` | {} | A Prometheus [web config yaml](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md) for configuring TLS and auth. | 40 | | `prometheus_web_external_url` | "" | External address on which prometheus is available. Useful when behind reverse proxy. Ex. `http://example.org/prometheus` | 41 | | `prometheus_storage_retention` | "30d" | Data retention period | 42 | | `prometheus_storage_retention_size` | "0" | Data retention period by size | 43 | | `prometheus_config_flags_extra` | {} | Additional configuration flags passed to prometheus binary at startup | 44 | | `prometheus_alertmanager_config` | [] | Configuration responsible for pointing where alertmanagers are. This should be specified as list in yaml format. It is compatible with official [](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config) | 45 | | `prometheus_alert_relabel_configs` | [] | Alert relabeling rules. This should be specified as list in yaml format. It is compatible with the official [](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs) | 46 | | `prometheus_global` | { scrape_interval: 60s, scrape_timeout: 15s, evaluation_interval: 15s } | Prometheus global config. Compatible with [official configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file) | 47 | | `prometheus_remote_write` | [] | Remote write. Compatible with [official configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#) | 48 | | `prometheus_remote_read` | [] | Remote read. Compatible with [official configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#) | 49 | | `prometheus_external_labels` | environment: "{{ ansible_fqdn \| default(ansible_host) \| default(inventory_hostname) }}" | Provide map of additional labels which will be added to any time series or alerts when communicating with external systems | 50 | | `prometheus_targets` | {} | Targets which will be scraped. Better example is provided in our [demo site](https://github.com/cloudalchemy/demo-site/blob/2a8a56fc10ce613d8b08dc8623230dace6704f9a/group_vars/all/vars#L8) | 51 | | `prometheus_scrape_configs` | [defaults/main.yml#L58](https://github.com/cloudalchemy/ansible-prometheus/blob/ff7830d06ba57be1177f2b6fca33a4dd2d97dc20/defaults/main.yml#L47) | Prometheus scrape jobs provided in same format as in [official docs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config) | 52 | | `prometheus_config_file` | "prometheus.yml.j2" | Variable used to provide custom prometheus configuration file in form of ansible template | 53 | | `prometheus_alert_rules` | [defaults/main.yml#L81](https://github.com/cloudalchemy/ansible-prometheus/blob/73d6df05a775ee5b736ac8f28d5605f2a975d50a/defaults/main.yml#L85) | Full list of alerting rules which will be copied to `{{ prometheus_config_dir }}/rules/ansible_managed.rules`. Alerting rules can be also provided by other files located in `{{ prometheus_config_dir }}/rules/` which have `*.rules` extension | 54 | | `prometheus_alert_rules_files` | [defaults/main.yml#L78](https://github.com/cloudalchemy/ansible-prometheus/blob/73d6df05a775ee5b736ac8f28d5605f2a975d50a/defaults/main.yml#L78) | List of folders where ansible will look for files containing alerting rules which will be copied to `{{ prometheus_config_dir }}/rules/`. Files must have `*.rules` extension | 55 | | `prometheus_static_targets_files` | [defaults/main.yml#L78](https://github.com/cloudalchemy/ansible-prometheus/blob/73d6df05a775ee5b736ac8f28d5605f2a975d50a/defaults/main.yml#L81) | List of folders where ansible will look for files containing custom static target configuration files which will be copied to `{{ prometheus_config_dir }}/file_sd/`. | 56 | 57 | 58 | ### Relation between `prometheus_scrape_configs` and `prometheus_targets` 59 | 60 | #### Short version 61 | 62 | `prometheus_targets` is just a map used to create multiple files located in "{{ prometheus_config_dir }}/file_sd" directory. Where file names are composed from top-level keys in that map with `.yml` suffix. Those files store [file_sd scrape targets data](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#file_sd_config) and they need to be read in `prometheus_scrape_configs`. 63 | 64 | #### Long version 65 | 66 | A part of *prometheus.yml* configuration file which describes what is scraped by prometheus is stored in `prometheus_scrape_configs`. For this variable same configuration options as described in [prometheus docs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#) are used. 67 | 68 | Meanwhile `prometheus_targets` is our way of adopting [prometheus scrape type `file_sd`](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#). It defines a map of files with their content. A top-level keys are base names of files which need to have their own scrape job in `prometheus_scrape_configs` and values are a content of those files. 69 | 70 | All this mean that you CAN use custom `prometheus_scrape_configs` with `prometheus_targets` set to `{}`. However when you set anything in `prometheus_targets` it needs to be mapped to `prometheus_scrape_configs`. If it isn't you'll get an error in preflight checks. 71 | 72 | #### Example 73 | 74 | Lets look at our default configuration, which shows all features. By default we have this `prometheus_targets`: 75 | ``` 76 | prometheus_targets: 77 | node: # This is a base file name. File is located in "{{ prometheus_config_dir }}/file_sd/<>.yml" 78 | - targets: # 79 | - localhost:9100 # All this is a targets section in file_sd format 80 | labels: # 81 | env: test # 82 | ``` 83 | Such config will result in creating one file named `node.yml` in `{{ prometheus_config_dir }}/file_sd` directory. 84 | 85 | Next this file needs to be loaded into scrape config. Here is modified version of our default `prometheus_scrape_configs`: 86 | ``` 87 | prometheus_scrape_configs: 88 | - job_name: "prometheus" # Custom scrape job, here using `static_config` 89 | metrics_path: "/metrics" 90 | static_configs: 91 | - targets: 92 | - "localhost:9090" 93 | - job_name: "example-node-file-servicediscovery" 94 | file_sd_configs: 95 | - files: 96 | - "{{ prometheus_config_dir }}/file_sd/node.yml" # This line loads file created from `prometheus_targets` 97 | ``` 98 | 99 | ## Example 100 | 101 | ### Playbook 102 | 103 | ```yaml 104 | --- 105 | - hosts: all 106 | roles: 107 | - cloudalchemy.prometheus 108 | vars: 109 | prometheus_targets: 110 | node: 111 | - targets: 112 | - localhost:9100 113 | - demo.cloudalchemy.org:9100 114 | labels: 115 | env: demosite 116 | ``` 117 | 118 | ### Demo site 119 | 120 | Prometheus organization provide a demo site for full monitoring solution based on prometheus and grafana. Repository with code and links to running instances is [available on github](https://github.com/prometheus/demo-site). 121 | 122 | ### Defining alerting rules files 123 | 124 | Alerting rules are defined in `prometheus_alert_rules` variable. Format is almost identical to one defined in[ Prometheus 2.0 documentation](https://prometheus.io/docs/prometheus/latest/configuration/template_examples/). 125 | Due to similarities in templating engines, every templates should be wrapped in `{% raw %}` and `{% endraw %}` statements. Example is provided in [defaults/main.yml](defaults/main.yml) file. 126 | 127 | ## Local Testing 128 | 129 | The preferred way of locally testing the role is to use Docker and [molecule](https://github.com/metacloud/molecule) (v2.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable to for your system. 130 | We are using tox to simplify process of testing on multiple ansible versions. To install tox execute: 131 | ```sh 132 | pip3 install tox 133 | ``` 134 | To run tests on all ansible versions (WARNING: this can take some time) 135 | ```sh 136 | tox 137 | ``` 138 | To run a custom molecule command on custom environment with only default test scenario: 139 | ```sh 140 | tox -e py35-ansible28 -- molecule test -s default 141 | ``` 142 | For more information about molecule go to their [docs](http://molecule.readthedocs.io/en/latest/). 143 | 144 | If you would like to run tests on remote docker host just specify `DOCKER_HOST` variable before running tox tests. 145 | 146 | ## CircleCI 147 | 148 | Combining molecule and CircleCI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows use to create test scenarios for different role configurations. As a result we have a quite large test matrix which will take more time than local testing, so please be patient. 149 | 150 | ## Contributing 151 | 152 | See [contributor guideline](CONTRIBUTING.md). 153 | 154 | ## Troubleshooting 155 | 156 | See [troubleshooting](TROUBLESHOOTING.md). 157 | 158 | ## License 159 | 160 | This project is licensed under MIT License. See [LICENSE](/LICENSE) for more details. 161 | -------------------------------------------------------------------------------- /TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | 4 | -------------------------------------------------------------------------------- /bump_version.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Description: Generate the next release version 4 | 5 | set -uo pipefail 6 | 7 | latest_tag="$(git semver)" 8 | if [[ -z "${latest_tag}" ]]; then 9 | echo "ERROR: Couldn't get latest tag from git semver, try 'pip install git-semver'" 2>&1 10 | exit 1 11 | fi 12 | 13 | # Use HEAD if CIRCLE_SHA1 is not set. 14 | now="${CIRCLE_SHA1:-HEAD}" 15 | 16 | new_tag='none' 17 | git_log="$(git log --format=%B "${latest_tag}..${now}")" 18 | 19 | case "${git_log}" in 20 | *"[major]"*|*"[breaking change]"* ) new_tag=$(git semver --next-major) ;; 21 | *"[minor]"*|*"[feat]"*|*"[feature]"* ) new_tag=$(git semver --next-minor) ;; 22 | *"[patch]"*|*"[fix]"*|*"[bugfix]"* ) new_tag=$(git semver --next-patch) ;; 23 | esac 24 | 25 | echo "NEW_TAG=${new_tag}" 26 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_version: 2.27.0 3 | prometheus_binary_local_dir: '' 4 | prometheus_skip_install: false 5 | 6 | prometheus_config_dir: /etc/prometheus 7 | prometheus_db_dir: /var/lib/prometheus 8 | prometheus_read_only_dirs: [] 9 | 10 | prometheus_web_listen_address: "0.0.0.0:9090" 11 | prometheus_web_external_url: '' 12 | # See https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md 13 | prometheus_web_config: 14 | tls_server_config: {} 15 | http_server_config: {} 16 | basic_auth_users: {} 17 | 18 | prometheus_storage_retention: "30d" 19 | # Available since Prometheus 2.7.0 20 | # [EXPERIMENTAL] Maximum number of bytes that can be stored for blocks. Units 21 | # supported: KB, MB, GB, TB, PB. 22 | prometheus_storage_retention_size: "0" 23 | 24 | prometheus_config_flags_extra: {} 25 | # prometheus_config_flags_extra: 26 | # storage.tsdb.retention: 15d 27 | # alertmanager.timeout: 10s 28 | 29 | prometheus_alertmanager_config: [] 30 | # prometheus_alertmanager_config: 31 | # - scheme: https 32 | # path_prefix: alertmanager/ 33 | # basic_auth: 34 | # username: user 35 | # password: pass 36 | # static_configs: 37 | # - targets: ["127.0.0.1:9093"] 38 | # proxy_url: "127.0.0.2" 39 | 40 | prometheus_alert_relabel_configs: [] 41 | # prometheus_alert_relabel_configs: 42 | # - action: labeldrop 43 | # regex: replica 44 | 45 | prometheus_global: 46 | scrape_interval: 15s 47 | scrape_timeout: 10s 48 | evaluation_interval: 15s 49 | 50 | prometheus_remote_write: [] 51 | # prometheus_remote_write: 52 | # - url: https://dev.kausal.co/prom/push 53 | # basic_auth: 54 | # password: FOO 55 | 56 | prometheus_remote_read: [] 57 | # prometheus_remote_read: 58 | # - url: https://demo.cloudalchemy.org:9201/read 59 | # basic_auth: 60 | # password: FOO 61 | 62 | prometheus_external_labels: 63 | environment: "{{ ansible_fqdn | default(ansible_host) | default(inventory_hostname) }}" 64 | 65 | prometheus_targets: {} 66 | # node: 67 | # - targets: 68 | # - localhost:9100 69 | # labels: 70 | # env: test 71 | 72 | prometheus_scrape_configs: 73 | - job_name: "prometheus" 74 | metrics_path: "{{ prometheus_metrics_path }}" 75 | static_configs: 76 | - targets: 77 | - "{{ ansible_fqdn | default(ansible_host) | default('localhost') }}:9090" 78 | - job_name: "node" 79 | file_sd_configs: 80 | - files: 81 | - "{{ prometheus_config_dir }}/file_sd/node.yml" 82 | 83 | # Alternative config file name, searched in ansible templates path. 84 | prometheus_config_file: 'prometheus.yml.j2' 85 | 86 | prometheus_alert_rules_files: 87 | - prometheus/rules/*.rules 88 | 89 | prometheus_static_targets_files: 90 | - prometheus/targets/*.yml 91 | - prometheus/targets/*.json 92 | 93 | prometheus_alert_rules: 94 | - alert: Watchdog 95 | expr: vector(1) 96 | for: 10m 97 | labels: 98 | severity: warning 99 | annotations: 100 | description: "This is an alert meant to ensure that the entire alerting pipeline is functional.\nThis alert is always firing, therefore it should always be firing in Alertmanager\nand always fire against a receiver. There are integrations with various notification\nmechanisms that send a notification when this alert is not firing. For example the\n\"DeadMansSnitch\" integration in PagerDuty." 101 | summary: 'Ensure entire alerting pipeline is functional' 102 | - alert: InstanceDown 103 | expr: 'up == 0' 104 | for: 5m 105 | labels: 106 | severity: critical 107 | annotations: 108 | description: '{% raw %}{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.{% endraw %}' 109 | summary: '{% raw %}Instance {{ $labels.instance }} down{% endraw %}' 110 | - alert: RebootRequired 111 | expr: 'node_reboot_required > 0' 112 | labels: 113 | severity: warning 114 | annotations: 115 | description: '{% raw %}{{ $labels.instance }} requires a reboot.{% endraw %}' 116 | summary: '{% raw %}Instance {{ $labels.instance }} - reboot required{% endraw %}' 117 | - alert: NodeFilesystemSpaceFillingUp 118 | annotations: 119 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up.{% endraw %}' 120 | summary: 'Filesystem is predicted to run out of space within the next 24 hours.' 121 | expr: "(\n node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"} / node_filesystem_size_bytes{job=\"node\",fstype!=\"\"} * 100 < 40\nand\n predict_linear(node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"}[6h], 24*60*60) < 0\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 122 | for: 1h 123 | labels: 124 | severity: warning 125 | - alert: NodeFilesystemSpaceFillingUp 126 | annotations: 127 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left and is filling up fast.{% endraw %}' 128 | summary: 'Filesystem is predicted to run out of space within the next 4 hours.' 129 | expr: "(\n node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"} / node_filesystem_size_bytes{job=\"node\",fstype!=\"\"} * 100 < 20\nand\n predict_linear(node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"}[6h], 4*60*60) < 0\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 130 | for: 1h 131 | labels: 132 | severity: critical 133 | - alert: NodeFilesystemAlmostOutOfSpace 134 | annotations: 135 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.{% endraw %}' 136 | summary: 'Filesystem has less than 5% space left.' 137 | expr: "(\n node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"} / node_filesystem_size_bytes{job=\"node\",fstype!=\"\"} * 100 < 5\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 138 | for: 1h 139 | labels: 140 | severity: warning 141 | - alert: NodeFilesystemAlmostOutOfSpace 142 | annotations: 143 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available space left.{% endraw %}' 144 | summary: 'Filesystem has less than 3% space left.' 145 | expr: "(\n node_filesystem_avail_bytes{job=\"node\",fstype!=\"\"} / node_filesystem_size_bytes{job=\"node\",fstype!=\"\"} * 100 < 3\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 146 | for: 1h 147 | labels: 148 | severity: critical 149 | - alert: NodeFilesystemFilesFillingUp 150 | annotations: 151 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up.{% endraw %}' 152 | summary: 'Filesystem is predicted to run out of inodes within the next 24 hours.' 153 | expr: "(\n node_filesystem_files_free{job=\"node\",fstype!=\"\"} / node_filesystem_files{job=\"node\",fstype!=\"\"} * 100 < 40\nand\n predict_linear(node_filesystem_files_free{job=\"node\",fstype!=\"\"}[6h], 24*60*60) < 0\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 154 | for: 1h 155 | labels: 156 | severity: warning 157 | - alert: NodeFilesystemFilesFillingUp 158 | annotations: 159 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left and is filling up fast.{% endraw %}' 160 | summary: 'Filesystem is predicted to run out of inodes within the next 4 hours.' 161 | expr: "(\n node_filesystem_files_free{job=\"node\",fstype!=\"\"} / node_filesystem_files{job=\"node\",fstype!=\"\"} * 100 < 20\nand\n predict_linear(node_filesystem_files_free{job=\"node\",fstype!=\"\"}[6h], 4*60*60) < 0\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 162 | for: 1h 163 | labels: 164 | severity: critical 165 | - alert: NodeFilesystemAlmostOutOfFiles 166 | annotations: 167 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.{% endraw %}' 168 | summary: 'Filesystem has less than 5% inodes left.' 169 | expr: "(\n node_filesystem_files_free{job=\"node\",fstype!=\"\"} / node_filesystem_files{job=\"node\",fstype!=\"\"} * 100 < 5\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 170 | for: 1h 171 | labels: 172 | severity: warning 173 | - alert: NodeFilesystemAlmostOutOfFiles 174 | annotations: 175 | description: '{% raw %}Filesystem on {{ $labels.device }} at {{ $labels.instance }} has only {{ printf "%.2f" $value }}% available inodes left.{% endraw %}' 176 | summary: 'Filesystem has less than 3% inodes left.' 177 | expr: "(\n node_filesystem_files_free{job=\"node\",fstype!=\"\"} / node_filesystem_files{job=\"node\",fstype!=\"\"} * 100 < 3\nand\n node_filesystem_readonly{job=\"node\",fstype!=\"\"} == 0\n)\n" 178 | for: 1h 179 | labels: 180 | severity: critical 181 | - alert: NodeNetworkReceiveErrs 182 | annotations: 183 | description: '{% raw %}{{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf "%.0f" $value }} receive errors in the last two minutes.{% endraw %}' 184 | summary: 'Network interface is reporting many receive errors.' 185 | expr: "increase(node_network_receive_errs_total[2m]) > 10\n" 186 | for: 1h 187 | labels: 188 | severity: warning 189 | - alert: NodeNetworkTransmitErrs 190 | annotations: 191 | description: '{% raw %}{{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf "%.0f" $value }} transmit errors in the last two minutes.{% endraw %}' 192 | summary: 'Network interface is reporting many transmit errors.' 193 | expr: "increase(node_network_transmit_errs_total[2m]) > 10\n" 194 | for: 1h 195 | labels: 196 | severity: warning 197 | - alert: NodeHighNumberConntrackEntriesUsed 198 | annotations: 199 | description: '{% raw %}{{ $value | humanizePercentage }} of conntrack entries are used{% endraw %}' 200 | summary: 'Number of conntrack are getting close to the limit' 201 | expr: "(node_nf_conntrack_entries / node_nf_conntrack_entries_limit) > 0.75\n" 202 | labels: 203 | severity: warning 204 | - alert: NodeClockSkewDetected 205 | annotations: 206 | message: '{% raw %}Clock on {{ $labels.instance }} is out of sync by more than 300s. Ensure NTP is configured correctly on this host.{% endraw %}' 207 | summary: 'Clock skew detected.' 208 | expr: "(\n node_timex_offset_seconds > 0.05\nand\n deriv(node_timex_offset_seconds[5m]) >= 0\n)\nor\n(\n node_timex_offset_seconds < -0.05\nand\n deriv(node_timex_offset_seconds[5m]) <= 0\n)\n" 209 | for: 10m 210 | labels: 211 | severity: warning 212 | - alert: NodeClockNotSynchronising 213 | annotations: 214 | message: '{% raw %}Clock on {{ $labels.instance }} is not synchronising. Ensure NTP is configured on this host.{% endraw %}' 215 | summary: 'Clock not synchronising.' 216 | expr: "min_over_time(node_timex_sync_status[5m]) == 0\n" 217 | for: 10m 218 | labels: 219 | severity: warning 220 | -------------------------------------------------------------------------------- /handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart prometheus 3 | become: true 4 | systemd: 5 | daemon_reload: true 6 | name: prometheus 7 | state: restarted 8 | 9 | - name: reload prometheus 10 | become: true 11 | systemd: 12 | name: prometheus 13 | state: reloaded 14 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: cloudalchemy 4 | role_name: prometheus 5 | description: Prometheus monitoring system configuration and management 6 | license: MIT 7 | company: none 8 | min_ansible_version: 2.7 9 | platforms: 10 | - name: Ubuntu 11 | versions: 12 | - bionic 13 | - xenial 14 | - name: Debian 15 | versions: 16 | - stretch 17 | - buster 18 | - name: EL 19 | versions: 20 | - 7 21 | - 8 22 | - name: Fedora 23 | versions: 24 | - 30 25 | - 31 26 | galaxy_tags: 27 | - monitoring 28 | - prometheus 29 | - metrics 30 | - alerts 31 | - alerting 32 | - molecule 33 | - cloud 34 | 35 | dependencies: [] 36 | -------------------------------------------------------------------------------- /molecule/alternative/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: bionic 8 | pre_build_image: true 9 | image: quay.io/paulfantom/molecule-systemd:ubuntu-18.04 10 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 11 | privileged: true 12 | volumes: 13 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 14 | - name: xenial 15 | pre_build_image: true 16 | image: quay.io/paulfantom/molecule-systemd:ubuntu-16.04 17 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 18 | privileged: true 19 | volumes: 20 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 21 | - name: stretch 22 | pre_build_image: true 23 | image: quay.io/paulfantom/molecule-systemd:debian-9 24 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 25 | privileged: true 26 | volumes: 27 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 28 | - name: buster 29 | pre_build_image: true 30 | image: quay.io/paulfantom/molecule-systemd:debian-10 31 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 32 | privileged: true 33 | volumes: 34 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 35 | - name: centos7 36 | pre_build_image: true 37 | image: quay.io/paulfantom/molecule-systemd:centos-7 38 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 39 | privileged: true 40 | volumes: 41 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 42 | - name: centos8 43 | pre_build_image: true 44 | image: quay.io/paulfantom/molecule-systemd:centos-8 45 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 46 | privileged: true 47 | volumes: 48 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 49 | groups: 50 | - python3 51 | - name: fedora 52 | pre_build_image: true 53 | image: quay.io/paulfantom/molecule-systemd:fedora-30 54 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 55 | privileged: true 56 | volumes: 57 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 58 | groups: 59 | - python3 60 | provisioner: 61 | name: ansible 62 | playbooks: 63 | prepare: prepare.yml 64 | converge: playbook.yml 65 | inventory: 66 | group_vars: 67 | python3: 68 | ansible_python_interpreter: /usr/bin/python3 69 | verifier: 70 | name: testinfra 71 | -------------------------------------------------------------------------------- /molecule/alternative/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Run role 3 | hosts: all 4 | any_errors_fatal: true 5 | roles: 6 | - cloudalchemy.prometheus 7 | vars: 8 | prometheus_binary_local_dir: '/tmp/prometheus-linux-amd64' 9 | prometheus_config_dir: /opt/prom/etc 10 | prometheus_db_dir: /opt/prom/lib 11 | prometheus_web_listen_address: "127.0.0.1:9090" 12 | prometheus_web_external_url: "http://127.0.0.1:9090/prometheus" 13 | prometheus_read_only_dirs: 14 | - /etc 15 | prometheus_storage_retention: "60d" 16 | prometheus_storage_retention_size: "1GB" 17 | prometheus_config_flags_extra: 18 | alertmanager.timeout: 10s 19 | web.enable-admin-api: 20 | enable-feature: 21 | - promql-at-modifier 22 | - remote-write-receiver 23 | prometheus_alertmanager_config: 24 | - scheme: https 25 | path_prefix: /alertmanager 26 | basic_auth: 27 | username: user 28 | password: pass 29 | static_configs: 30 | - targets: ["127.0.0.1:9090"] 31 | proxy_url: "127.0.0.2" 32 | prometheus_alert_relabel_configs: 33 | - action: labeldrop 34 | regex: replica 35 | prometheus_global: 36 | scrape_interval: 3s 37 | scrape_timeout: 2s 38 | evaluation_interval: 10s 39 | prometheus_remote_write: 40 | - url: http://influx.cloudalchemy.org:8086/api/v1/prom/write?db=test 41 | basic_auth: 42 | username: prometheus 43 | password: SuperSecret 44 | prometheus_remote_read: 45 | - url: http://influx.cloudalchemy.org:8086/api/v1/prom/read?db=cloudalchemy 46 | prometheus_external_labels: 47 | environment: "alternative" 48 | prometheus_targets: 49 | node: 50 | - targets: 51 | - demo.cloudalchemy.org:9100 52 | - influx.cloudalchemy.org:9100 53 | labels: 54 | env: cloudalchemy 55 | docker: 56 | - targets: 57 | - demo.cloudalchemy.org:8080 58 | - influx.cloudalchemy.org:8080 59 | labels: 60 | env: cloudalchemy 61 | prometheus_scrape_configs: 62 | - job_name: "prometheus" 63 | metrics_path: "{{ prometheus_metrics_path }}" 64 | static_configs: 65 | - targets: 66 | - "{{ ansible_fqdn | default(ansible_host) | default('localhost') }}:9090" 67 | - job_name: "node" 68 | file_sd_configs: 69 | - files: 70 | - "{{ prometheus_config_dir }}/file_sd/node.yml" 71 | - job_name: "docker" 72 | file_sd_configs: 73 | - files: 74 | - "{{ prometheus_config_dir }}/file_sd/docker.yml" 75 | - job_name: 'blackbox' 76 | metrics_path: /probe 77 | params: 78 | module: [http_2xx] 79 | static_configs: 80 | - targets: 81 | - http://demo.cloudalchemy.org:9100 82 | - http://influx.cloudalchemy.org:9100 83 | relabel_configs: 84 | - source_labels: [__address__] 85 | target_label: __param_target 86 | - source_labels: [__param_target] 87 | target_label: instance 88 | - target_label: __address__ 89 | replacement: 127.0.0.1:9115 # Blackbox exporter. 90 | -------------------------------------------------------------------------------- /molecule/alternative/prepare.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Prepare 3 | hosts: localhost 4 | gather_facts: false 5 | vars: 6 | # This is meant to test a local prepared binary. It needs to be updated to support the minium 7 | # flag features in the systemd service file. 8 | version: 2.25.2 9 | tasks: 10 | - name: download prometheus binary to local folder 11 | become: false 12 | get_url: 13 | url: "https://github.com/prometheus/prometheus/releases/download/v{{ version }}/prometheus-{{ version }}.linux-amd64.tar.gz" 14 | dest: "/tmp/prometheus-{{ version }}.linux-amd64.tar.gz" 15 | register: _download_archive 16 | until: _download_archive is succeeded 17 | retries: 5 18 | delay: 2 19 | run_once: true 20 | check_mode: false 21 | 22 | - name: unpack prometheus binaries 23 | become: false 24 | unarchive: 25 | src: "/tmp/prometheus-{{ version }}.linux-amd64.tar.gz" 26 | dest: "/tmp" 27 | creates: "/tmp/prometheus-{{ version }}.linux-amd64/prometheus" 28 | run_once: true 29 | check_mode: false 30 | 31 | - name: link to prometheus binaries directory 32 | become: false 33 | file: 34 | src: "/tmp/prometheus-{{ version }}.linux-amd64" 35 | dest: "/tmp/prometheus-linux-amd64" 36 | state: link 37 | run_once: true 38 | check_mode: false 39 | -------------------------------------------------------------------------------- /molecule/alternative/tests/test_alternative.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | import testinfra.utils.ansible_runner 4 | 5 | testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 6 | os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 7 | 8 | 9 | @pytest.mark.parametrize("dirs", [ 10 | "/opt/prom/etc", 11 | "/opt/prom/etc/rules", 12 | "/opt/prom/etc/file_sd", 13 | "/opt/prom/lib" 14 | ]) 15 | def test_directories(host, dirs): 16 | d = host.file(dirs) 17 | assert d.is_directory 18 | assert d.exists 19 | 20 | 21 | @pytest.mark.parametrize("files", [ 22 | "/opt/prom/etc/prometheus.yml", 23 | "/opt/prom/etc/rules/ansible_managed.rules", 24 | "/opt/prom/etc/file_sd/node.yml", 25 | "/opt/prom/etc/file_sd/docker.yml", 26 | "/usr/local/bin/prometheus", 27 | "/usr/local/bin/promtool" 28 | ]) 29 | def test_files(host, files): 30 | f = host.file(files) 31 | assert f.exists 32 | assert f.is_file 33 | 34 | 35 | @pytest.mark.parametrize('file, content', [ 36 | ("/etc/systemd/system/prometheus.service", 37 | "ReadOnly.*=/etc"), 38 | ("/etc/systemd/system/prometheus.service", 39 | "enable-feature=promql-at-modifier"), 40 | ("/etc/systemd/system/prometheus.service", 41 | "enable-feature=remote-write-receiver"), 42 | ]) 43 | def test_file_contents(host, file, content): 44 | f = host.file(file) 45 | assert f.exists 46 | assert f.is_file 47 | assert f.contains(content) 48 | 49 | 50 | def test_service(host): 51 | s = host.service("prometheus") 52 | # assert s.is_enabled 53 | assert s.is_running 54 | 55 | 56 | def test_socket(host): 57 | s = host.socket("tcp://127.0.0.1:9090") 58 | assert s.is_listening 59 | -------------------------------------------------------------------------------- /molecule/default/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | # lint: | 7 | # set -e 8 | # yamllint . 9 | # ansible-lint 10 | # flake8 11 | platforms: 12 | - name: bionic 13 | pre_build_image: true 14 | image: quay.io/paulfantom/molecule-systemd:ubuntu-18.04 15 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 16 | privileged: true 17 | volumes: 18 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 19 | - name: xenial 20 | pre_build_image: true 21 | image: quay.io/paulfantom/molecule-systemd:ubuntu-16.04 22 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 23 | privileged: true 24 | volumes: 25 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 26 | - name: stretch 27 | pre_build_image: true 28 | image: quay.io/paulfantom/molecule-systemd:debian-9 29 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 30 | privileged: true 31 | volumes: 32 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 33 | - name: buster 34 | pre_build_image: true 35 | image: quay.io/paulfantom/molecule-systemd:debian-10 36 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 37 | privileged: true 38 | volumes: 39 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 40 | - name: centos7 41 | pre_build_image: true 42 | image: quay.io/paulfantom/molecule-systemd:centos-7 43 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 44 | privileged: true 45 | volumes: 46 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 47 | - name: centos8 48 | pre_build_image: true 49 | image: quay.io/paulfantom/molecule-systemd:centos-8 50 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 51 | privileged: true 52 | volumes: 53 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 54 | groups: 55 | - python3 56 | - name: fedora 57 | pre_build_image: true 58 | image: quay.io/paulfantom/molecule-systemd:fedora-30 59 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 60 | privileged: true 61 | volumes: 62 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 63 | groups: 64 | - python3 65 | provisioner: 66 | name: ansible 67 | playbooks: 68 | prepare: prepare.yml 69 | converge: playbook.yml 70 | inventory: 71 | group_vars: 72 | python3: 73 | ansible_python_interpreter: /usr/bin/python3 74 | verifier: 75 | name: testinfra 76 | -------------------------------------------------------------------------------- /molecule/default/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Run role 3 | hosts: all 4 | any_errors_fatal: true 5 | roles: 6 | - cloudalchemy.prometheus 7 | -------------------------------------------------------------------------------- /molecule/default/prepare.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Prepare 3 | hosts: all 4 | gather_facts: false 5 | tasks: [] 6 | -------------------------------------------------------------------------------- /molecule/default/tests/test_default.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | import yaml 4 | import testinfra.utils.ansible_runner 5 | 6 | testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 7 | os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 8 | 9 | 10 | @pytest.fixture() 11 | def AnsibleDefaults(): 12 | with open("defaults/main.yml", 'r') as stream: 13 | return yaml.load(stream) 14 | 15 | 16 | @pytest.mark.parametrize("dirs", [ 17 | "/etc/prometheus", 18 | "/etc/prometheus/console_libraries", 19 | "/etc/prometheus/consoles", 20 | "/etc/prometheus/rules", 21 | "/etc/prometheus/file_sd", 22 | "/var/lib/prometheus" 23 | ]) 24 | def test_directories(host, dirs): 25 | d = host.file(dirs) 26 | assert d.is_directory 27 | assert d.exists 28 | 29 | 30 | @pytest.mark.parametrize("files", [ 31 | "/etc/prometheus/prometheus.yml", 32 | "/etc/prometheus/console_libraries/prom.lib", 33 | "/etc/prometheus/consoles/prometheus.html", 34 | "/etc/prometheus/web.yml", 35 | "/etc/systemd/system/prometheus.service", 36 | "/usr/local/bin/prometheus", 37 | "/usr/local/bin/promtool" 38 | ]) 39 | def test_files(host, files): 40 | f = host.file(files) 41 | assert f.exists 42 | assert f.is_file 43 | 44 | 45 | @pytest.mark.parametrize("files", [ 46 | "/etc/prometheus/rules/ansible_managed.rules" 47 | ]) 48 | def test_absent(host, files): 49 | f = host.file(files) 50 | assert f.exists 51 | 52 | 53 | def test_user(host): 54 | assert host.group("prometheus").exists 55 | assert host.user("prometheus").exists 56 | 57 | 58 | def test_service(host): 59 | s = host.service("prometheus") 60 | # assert s.is_enabled 61 | assert s.is_running 62 | 63 | 64 | def test_socket(host): 65 | s = host.socket("tcp://0.0.0.0:9090") 66 | assert s.is_listening 67 | 68 | 69 | def test_version(host, AnsibleDefaults): 70 | version = os.getenv('PROMETHEUS', AnsibleDefaults['prometheus_version']) 71 | run = host.run("/usr/local/bin/prometheus --version") 72 | out = run.stdout+run.stderr 73 | assert "prometheus, version " + version in out 74 | -------------------------------------------------------------------------------- /molecule/latest/molecule.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependency: 3 | name: galaxy 4 | driver: 5 | name: docker 6 | platforms: 7 | - name: buster 8 | pre_build_image: true 9 | image: quay.io/paulfantom/molecule-systemd:debian-10 10 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 11 | privileged: true 12 | volumes: 13 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 14 | - name: fedora 15 | pre_build_image: true 16 | image: quay.io/paulfantom/molecule-systemd:fedora-30 17 | docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}" 18 | privileged: true 19 | volumes: 20 | - /sys/fs/cgroup:/sys/fs/cgroup:ro 21 | groups: 22 | - python3 23 | provisioner: 24 | name: ansible 25 | playbooks: 26 | create: ../default/create.yml 27 | prepare: ../default/prepare.yml 28 | converge: playbook.yml 29 | destroy: ../default/destroy.yml 30 | inventory: 31 | group_vars: 32 | python3: 33 | ansible_python_interpreter: /usr/bin/python3 34 | verifier: 35 | name: testinfra 36 | -------------------------------------------------------------------------------- /molecule/latest/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Run role 3 | hosts: all 4 | any_errors_fatal: true 5 | roles: 6 | - cloudalchemy.prometheus 7 | vars: 8 | prometheus_version: latest 9 | -------------------------------------------------------------------------------- /molecule/latest/tests/test_alternative.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import os 3 | import testinfra.utils.ansible_runner 4 | 5 | testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( 6 | os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') 7 | 8 | 9 | @pytest.mark.parametrize("files", [ 10 | "/etc/systemd/system/prometheus.service", 11 | "/usr/local/bin/prometheus", 12 | "/usr/local/bin/promtool" 13 | ]) 14 | def test_files(host, files): 15 | f = host.file(files) 16 | assert f.exists 17 | assert f.is_file 18 | 19 | 20 | def test_service(host): 21 | s = host.service("prometheus") 22 | # assert s.is_enabled 23 | assert s.is_running 24 | 25 | 26 | def test_socket(host): 27 | s = host.socket("tcp://0.0.0.0:9090") 28 | assert s.is_listening 29 | -------------------------------------------------------------------------------- /tasks/configure.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: alerting rules file 3 | template: 4 | src: "alert.rules.j2" 5 | dest: "{{ prometheus_config_dir }}/rules/ansible_managed.rules" 6 | owner: root 7 | group: prometheus 8 | mode: 0640 9 | validate: "{{ _prometheus_binary_install_dir }}/promtool check rules %s" 10 | when: 11 | - prometheus_alert_rules != [] 12 | notify: 13 | - reload prometheus 14 | 15 | - name: copy custom alerting rule files 16 | copy: 17 | src: "{{ item }}" 18 | dest: "{{ prometheus_config_dir }}/rules/" 19 | owner: root 20 | group: prometheus 21 | mode: 0640 22 | validate: "{{ _prometheus_binary_install_dir }}/promtool check rules %s" 23 | with_fileglob: "{{ prometheus_alert_rules_files }}" 24 | notify: 25 | - reload prometheus 26 | 27 | - name: configure prometheus 28 | template: 29 | src: "{{ prometheus_config_file }}" 30 | dest: "{{ prometheus_config_dir }}/prometheus.yml" 31 | force: true 32 | owner: root 33 | group: prometheus 34 | mode: 0640 35 | validate: "{{ _prometheus_binary_install_dir }}/promtool check config %s" 36 | notify: 37 | - reload prometheus 38 | 39 | - name: configure Prometheus web 40 | copy: 41 | content: "{{ prometheus_web_config | to_nice_yaml(indent=2,sort_keys=False) }}" 42 | dest: "{{ prometheus_config_dir }}/web.yml" 43 | force: true 44 | owner: root 45 | group: prometheus 46 | mode: 0640 47 | 48 | - name: configure prometheus static targets 49 | copy: 50 | content: | 51 | #jinja2: lstrip_blocks: True 52 | {{ item.value | to_nice_yaml(indent=2,sort_keys=False) }} 53 | dest: "{{ prometheus_config_dir }}/file_sd/{{ item.key }}.yml" 54 | force: true 55 | owner: root 56 | group: prometheus 57 | mode: 0640 58 | with_dict: "{{ prometheus_targets }}" 59 | when: prometheus_targets != {} 60 | 61 | - name: copy prometheus custom static targets 62 | copy: 63 | src: "{{ item }}" 64 | dest: "{{ prometheus_config_dir }}/file_sd/" 65 | force: true 66 | owner: root 67 | group: prometheus 68 | mode: 0640 69 | with_fileglob: "{{ prometheus_static_targets_files }}" 70 | -------------------------------------------------------------------------------- /tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: create prometheus system group 3 | group: 4 | name: prometheus 5 | system: true 6 | state: present 7 | 8 | - name: create prometheus system user 9 | user: 10 | name: prometheus 11 | system: true 12 | shell: "/usr/sbin/nologin" 13 | group: prometheus 14 | createhome: false 15 | home: "{{ prometheus_db_dir }}" 16 | 17 | - name: create prometheus data directory 18 | file: 19 | path: "{{ prometheus_db_dir }}" 20 | state: directory 21 | owner: prometheus 22 | group: prometheus 23 | mode: 0755 24 | 25 | - name: create prometheus configuration directories 26 | file: 27 | path: "{{ item }}" 28 | state: directory 29 | owner: root 30 | group: prometheus 31 | mode: 0770 32 | with_items: 33 | - "{{ prometheus_config_dir }}" 34 | - "{{ prometheus_config_dir }}/rules" 35 | - "{{ prometheus_config_dir }}/file_sd" 36 | 37 | - block: 38 | - name: download prometheus binary to local folder 39 | become: false 40 | get_url: 41 | url: "https://github.com/prometheus/prometheus/releases/download/v{{ prometheus_version }}/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz" 42 | dest: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz" 43 | checksum: "sha256:{{ __prometheus_checksum }}" 44 | register: _download_archive 45 | until: _download_archive is succeeded 46 | retries: 5 47 | delay: 2 48 | # run_once: true # <-- this cannot be set due to multi-arch support 49 | delegate_to: localhost 50 | check_mode: false 51 | 52 | - name: unpack prometheus binaries 53 | become: false 54 | unarchive: 55 | src: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz" 56 | dest: "/tmp" 57 | creates: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}/prometheus" 58 | delegate_to: localhost 59 | check_mode: false 60 | 61 | - name: propagate official prometheus and promtool binaries 62 | copy: 63 | src: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}/{{ item }}" 64 | dest: "{{ _prometheus_binary_install_dir }}/{{ item }}" 65 | mode: 0755 66 | owner: root 67 | group: root 68 | with_items: 69 | - prometheus 70 | - promtool 71 | notify: 72 | - restart prometheus 73 | 74 | - name: propagate official console templates 75 | copy: 76 | src: "/tmp/prometheus-{{ prometheus_version }}.linux-{{ go_arch }}/{{ item }}/" 77 | dest: "{{ prometheus_config_dir }}/{{ item }}/" 78 | mode: 0644 79 | owner: root 80 | group: root 81 | with_items: 82 | - console_libraries 83 | - consoles 84 | notify: 85 | - restart prometheus 86 | when: 87 | - prometheus_binary_local_dir | length == 0 88 | - not prometheus_skip_install 89 | 90 | - name: propagate locally distributed prometheus and promtool binaries 91 | copy: 92 | src: "{{ prometheus_binary_local_dir }}/{{ item }}" 93 | dest: "{{ _prometheus_binary_install_dir }}/{{ item }}" 94 | mode: 0755 95 | owner: root 96 | group: root 97 | with_items: 98 | - prometheus 99 | - promtool 100 | when: 101 | - prometheus_binary_local_dir | length > 0 102 | - not prometheus_skip_install 103 | notify: 104 | - restart prometheus 105 | 106 | - name: create systemd service unit 107 | template: 108 | src: prometheus.service.j2 109 | dest: /etc/systemd/system/prometheus.service 110 | owner: root 111 | group: root 112 | mode: 0644 113 | notify: 114 | - restart prometheus 115 | 116 | - name: Install SELinux dependencies 117 | package: 118 | name: "{{ item }}" 119 | state: present 120 | with_items: "{{ prometheus_selinux_packages }}" 121 | register: _install_packages 122 | until: _install_packages is succeeded 123 | retries: 5 124 | delay: 2 125 | when: 126 | - ansible_version.full is version('2.4', '>=') 127 | - ansible_selinux.status == "enabled" 128 | 129 | - name: Allow prometheus to bind to port in SELinux 130 | seport: 131 | ports: "{{ prometheus_web_listen_address.split(':')[1] }}" 132 | proto: tcp 133 | setype: http_port_t 134 | state: present 135 | when: 136 | - ansible_version.full is version('2.4', '>=') 137 | - ansible_selinux.status == "enabled" 138 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Gather variables for each operating system 3 | include_vars: "{{ item }}" 4 | with_first_found: 5 | - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}.yml" 6 | - "{{ ansible_distribution | lower }}.yml" 7 | - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml" 8 | - "{{ ansible_os_family | lower }}.yml" 9 | tags: 10 | - prometheus_configure 11 | - prometheus_install 12 | - prometheus_run 13 | 14 | - include: preflight.yml 15 | tags: 16 | - prometheus_configure 17 | - prometheus_install 18 | - prometheus_run 19 | 20 | - include: install.yml 21 | become: true 22 | tags: 23 | - prometheus_install 24 | 25 | - include: configure.yml 26 | become: true 27 | tags: 28 | - prometheus_configure 29 | 30 | - name: ensure prometheus service is started and enabled 31 | become: true 32 | systemd: 33 | daemon_reload: true 34 | name: prometheus 35 | state: started 36 | enabled: true 37 | tags: 38 | - prometheus_run 39 | -------------------------------------------------------------------------------- /tasks/preflight.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Assert usage of systemd as an init system 3 | assert: 4 | that: ansible_service_mgr == 'systemd' 5 | msg: "This module only works with systemd" 6 | 7 | - name: Get systemd version 8 | command: systemctl --version 9 | changed_when: false 10 | check_mode: false 11 | register: __systemd_version 12 | tags: 13 | - skip_ansible_lint 14 | 15 | - name: Set systemd version fact 16 | set_fact: 17 | prometheus_systemd_version: "{{ __systemd_version.stdout_lines[0].split(' ')[-1] }}" 18 | 19 | - name: Assert no duplicate config flags 20 | assert: 21 | that: 22 | - prometheus_config_flags_extra['config.file'] is not defined 23 | - prometheus_config_flags_extra['storage.tsdb.path'] is not defined 24 | - prometheus_config_flags_extra['storage.local.path'] is not defined 25 | - prometheus_config_flags_extra['web.listen-address'] is not defined 26 | - prometheus_config_flags_extra['web.external-url'] is not defined 27 | msg: "Detected duplicate configuration entry. Please check your ansible variables and role README.md." 28 | 29 | - name: Assert external_labels aren't configured twice 30 | assert: 31 | that: prometheus_global.external_labels is not defined 32 | msg: "Use prometheus_external_labels to define external labels" 33 | 34 | - name: Set prometheus external metrics path 35 | set_fact: 36 | prometheus_metrics_path: "/{{ ( prometheus_web_external_url + '/metrics' ) | regex_replace('^(.*://)?(.*?)/') }}" 37 | 38 | - name: Fail when prometheus_config_flags_extra duplicates parameters set by other variables 39 | fail: 40 | msg: > 41 | Whooops. You are duplicating configuration. Please look at your prometheus_config_flags_extra 42 | and check against other variables in defaults/main.yml 43 | with_items: 44 | - 'storage.tsdb.retention' 45 | - 'storage.tsdb.path' 46 | - 'storage.local.retention' 47 | - 'storage.local.path' 48 | - 'config.file' 49 | - 'web.listen-address' 50 | - 'web.external-url' 51 | when: item in prometheus_config_flags_extra.keys() 52 | 53 | - name: Get all file_sd files from scrape_configs 54 | set_fact: 55 | file_sd_files: "{{ prometheus_scrape_configs | json_query('[*][].file_sd_configs[*][].files[]') }}" 56 | 57 | - name: Fail when file_sd targets are not defined in scrape_configs 58 | fail: 59 | msg: > 60 | Oh, snap! `{{ item.key }}` couldn't be found in your scrape configs. Please ensure you provided 61 | all targets from prometheus_targets in prometheus_scrape_configs 62 | when: not prometheus_config_dir + "/file_sd/" + item.key + ".yml" in file_sd_files 63 | # when: not item | basename | splitext | difference(['.yml']) | join('') in prometheus_targets.keys() 64 | with_dict: "{{ prometheus_targets }}" 65 | 66 | - name: Alert when prometheus_alertmanager_config is empty, but prometheus_alert_rules is specified 67 | debug: 68 | msg: > 69 | No alertmanager configuration was specified. If you want your alerts to be sent make sure to 70 | specify a prometheus_alertmanager_config in defaults/main.yml. 71 | when: 72 | - prometheus_alertmanager_config == [] 73 | - prometheus_alert_rules != [] 74 | 75 | - block: 76 | - name: Get latest release 77 | uri: 78 | url: "https://api.github.com/repos/prometheus/prometheus/releases/latest" 79 | method: GET 80 | return_content: true 81 | status_code: 200 82 | body_format: json 83 | validate_certs: false 84 | user: "{{ lookup('env', 'GH_USER') | default(omit) }}" 85 | password: "{{ lookup('env', 'GH_TOKEN') | default(omit) }}" 86 | no_log: "{{ not lookup('env', 'ANSIBLE_DEBUG') | bool }}" 87 | register: _latest_release 88 | until: _latest_release.status == 200 89 | retries: 5 90 | 91 | - name: "Set prometheus version to {{ _latest_release.json.tag_name[1:] }}" 92 | set_fact: 93 | prometheus_version: "{{ _latest_release.json.tag_name[1:] }}" 94 | when: 95 | - prometheus_version == "latest" 96 | - prometheus_binary_local_dir | length == 0 97 | - not prometheus_skip_install 98 | 99 | - block: 100 | - name: "Get checksum list" 101 | set_fact: 102 | __prometheus_checksums: "{{ lookup('url', 'https://github.com/prometheus/prometheus/releases/download/v' + prometheus_version + '/sha256sums.txt', wantlist=True) | list }}" 103 | run_once: true 104 | 105 | - name: "Get checksum for {{ go_arch }} architecture" 106 | set_fact: 107 | __prometheus_checksum: "{{ item.split(' ')[0] }}" 108 | with_items: "{{ __prometheus_checksums }}" 109 | when: 110 | - "('linux-' + go_arch + '.tar.gz') in item" 111 | delegate_to: localhost 112 | when: 113 | - prometheus_binary_local_dir | length == 0 114 | - not prometheus_skip_install 115 | -------------------------------------------------------------------------------- /templates/alert.rules.j2: -------------------------------------------------------------------------------- 1 | {{ ansible_managed | comment }} 2 | 3 | groups: 4 | - name: ansible managed alert rules 5 | rules: 6 | {{ prometheus_alert_rules | to_nice_yaml(indent=2,sort_keys=False) | indent(2,False) }} 7 | -------------------------------------------------------------------------------- /templates/prometheus.service.j2: -------------------------------------------------------------------------------- 1 | {{ ansible_managed | comment }} 2 | 3 | [Unit] 4 | Description=Prometheus 5 | After=network-online.target 6 | Requires=local-fs.target 7 | After=local-fs.target 8 | 9 | [Service] 10 | Type=simple 11 | Environment="GOMAXPROCS={{ ansible_processor_vcpus|default(ansible_processor_count) }}" 12 | User=prometheus 13 | Group=prometheus 14 | ExecReload=/bin/kill -HUP $MAINPID 15 | ExecStart={{ _prometheus_binary_install_dir }}/prometheus \ 16 | --storage.tsdb.path={{ prometheus_db_dir }} \ 17 | {% if prometheus_version is version('2.7.0', '>=') %} 18 | --storage.tsdb.retention.time={{ prometheus_storage_retention }} \ 19 | --storage.tsdb.retention.size={{ prometheus_storage_retention_size }} \ 20 | {% else %} 21 | --storage.tsdb.retention={{ prometheus_storage_retention }} \ 22 | {% endif %} 23 | {% if prometheus_version is version('2.24.0', '>=') %} 24 | --web.config.file={{ prometheus_config_dir }}/web.yml \ 25 | {% endif %} 26 | --web.console.libraries={{ prometheus_config_dir }}/console_libraries \ 27 | --web.console.templates={{ prometheus_config_dir }}/consoles \ 28 | --web.listen-address={{ prometheus_web_listen_address }} \ 29 | --web.external-url={{ prometheus_web_external_url }} \ 30 | {% for flag, flag_value in prometheus_config_flags_extra.items() %} 31 | {% if not flag_value %} 32 | --{{ flag }} \ 33 | {% elif flag_value is string %} 34 | --{{ flag }}={{ flag_value }} \ 35 | {% elif flag_value is sequence %} 36 | {% for flag_value_item in flag_value %} 37 | --{{ flag }}={{ flag_value_item }} \ 38 | {% endfor %} 39 | {% endif %} 40 | {% endfor %} 41 | --config.file={{ prometheus_config_dir }}/prometheus.yml 42 | 43 | CapabilityBoundingSet=CAP_SET_UID 44 | LimitNOFILE=65000 45 | LockPersonality=true 46 | NoNewPrivileges=true 47 | MemoryDenyWriteExecute=true 48 | PrivateDevices=true 49 | PrivateTmp=true 50 | ProtectHome=true 51 | RemoveIPC=true 52 | RestrictSUIDSGID=true 53 | #SystemCallFilter=@signal @timer 54 | 55 | {% if prometheus_systemd_version | int >= 231 %} 56 | ReadWritePaths={{ prometheus_db_dir }} 57 | {% for path in prometheus_read_only_dirs %} 58 | ReadOnlyPaths={{ path }} 59 | {% endfor %} 60 | {% else %} 61 | ReadWriteDirectories={{ prometheus_db_dir }} 62 | {% for path in prometheus_read_only_dirs %} 63 | ReadOnlyDirectories={{ path }} 64 | {% endfor %} 65 | {% endif %} 66 | 67 | {% if prometheus_systemd_version | int >= 232 %} 68 | PrivateUsers=true 69 | ProtectControlGroups=true 70 | ProtectKernelModules=true 71 | ProtectKernelTunables=true 72 | ProtectSystem=strict 73 | {% else %} 74 | ProtectSystem=full 75 | {% endif %} 76 | 77 | {% if http_proxy is defined %} 78 | Environment="HTTP_PROXY={{ http_proxy }}"{% if https_proxy is defined %} "HTTPS_PROXY={{ https_proxy }}{% endif %}" 79 | {% endif %} 80 | 81 | SyslogIdentifier=prometheus 82 | Restart=always 83 | 84 | [Install] 85 | WantedBy=multi-user.target 86 | -------------------------------------------------------------------------------- /templates/prometheus.yml.j2: -------------------------------------------------------------------------------- 1 | #jinja2: trim_blocks: True, lstrip_blocks: True 2 | {{ ansible_managed | comment }} 3 | # http://prometheus.io/docs/operating/configuration/ 4 | 5 | global: 6 | {{ prometheus_global | to_nice_yaml(indent=2,sort_keys=False) | indent(2, False) }} 7 | external_labels: 8 | {{ prometheus_external_labels | to_nice_yaml(indent=2,sort_keys=False) | indent(4, False) }} 9 | 10 | {% if prometheus_remote_write != [] %} 11 | remote_write: 12 | {{ prometheus_remote_write | to_nice_yaml(indent=2,sort_keys=False) | indent(2, False) }} 13 | {% endif %} 14 | 15 | {% if prometheus_remote_read != [] %} 16 | remote_read: 17 | {{ prometheus_remote_read | to_nice_yaml(indent=2,sort_keys=False) | indent(2, False) }} 18 | {% endif %} 19 | 20 | rule_files: 21 | - {{ prometheus_config_dir }}/rules/*.rules 22 | 23 | {% if prometheus_alertmanager_config | length > 0 %} 24 | alerting: 25 | alertmanagers: 26 | {{ prometheus_alertmanager_config | to_nice_yaml(indent=2,sort_keys=False) | indent(2,False) }} 27 | {% if prometheus_alert_relabel_configs | length > 0 %} 28 | alert_relabel_configs: 29 | {{ prometheus_alert_relabel_configs | to_nice_yaml(indent=2,sort_keys=False) | indent(2,False) }} 30 | {% endif %} 31 | {% endif %} 32 | 33 | scrape_configs: 34 | {{ prometheus_scrape_configs | to_nice_yaml(indent=2,sort_keys=False) | indent(2,False) }} 35 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | # temporarily lock versions of molecule and ansible-compat to avoid a bug: 2 | ansible-compat==0.5.0 3 | molecule==3.5.2 4 | molecule-docker 5 | docker 6 | ansible-lint>=3.4.0 7 | testinfra>=1.7.0 8 | jmespath 9 | selinux 10 | passlib 11 | -------------------------------------------------------------------------------- /vars/centos-8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - python3-libselinux 4 | - python3-policycoreutils 5 | -------------------------------------------------------------------------------- /vars/centos.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - libselinux-python 4 | - policycoreutils-python 5 | -------------------------------------------------------------------------------- /vars/debian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - python-selinux 4 | - policycoreutils 5 | -------------------------------------------------------------------------------- /vars/fedora.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - python3-libselinux 4 | - python3-policycoreutils 5 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | go_arch_map: 3 | i386: '386' 4 | x86_64: 'amd64' 5 | aarch64: 'arm64' 6 | armv7l: 'armv7' 7 | armv6l: 'armv6' 8 | 9 | go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}" 10 | _prometheus_binary_install_dir: '/usr/local/bin' 11 | -------------------------------------------------------------------------------- /vars/redhat-8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - python3-libselinux 4 | - python3-policycoreutils 5 | -------------------------------------------------------------------------------- /vars/redhat.yml: -------------------------------------------------------------------------------- 1 | --- 2 | prometheus_selinux_packages: 3 | - libselinux-python 4 | - policycoreutils-python 5 | --------------------------------------------------------------------------------