{"id":16761829,"url":"https://github.com/angristan/ansible-prometheus","last_synced_at":"2025-07-13T10:31:57.724Z","repository":{"id":153244678,"uuid":"177357205","full_name":"angristan/ansible-prometheus","owner":"angristan","description":"Ansible role for Prometheus","archived":false,"fork":false,"pushed_at":"2024-11-18T20:22:42.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-03T02:53:21.647Z","etag":null,"topics":["ansible","ansible-role","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angristan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-24T01:18:05.000Z","updated_at":"2024-12-10T16:21:00.000Z","dependencies_parsed_at":"2024-01-28T13:43:30.505Z","dependency_job_id":null,"html_url":"https://github.com/angristan/ansible-prometheus","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/angristan/ansible-prometheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fansible-prometheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fansible-prometheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fansible-prometheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fansible-prometheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angristan","download_url":"https://codeload.github.com/angristan/ansible-prometheus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Fansible-prometheus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265128311,"owners_count":23715621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-role","prometheus"],"created_at":"2024-10-13T04:43:33.644Z","updated_at":"2025-07-13T10:31:57.506Z","avatar_url":"https://github.com/angristan.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible role for Prometehus\n\nThis role will setup [Prometheus](https://github.com/prometheus/prometheus/) on any Linux machine running systemd.\n\n## Requirements\n\n- systemd on the target host\n- gnu-tar on Mac deployer host (`brew install gnu-tar`)\n\n## Role Variables\n\n- `prometheus_version`: the versions that will be installed and downloaded.\n\nThe role will download the Prometheus release on the deployer and upload the needed files to the target host.\n\nIf the `/usr/local/bin/prometheus` binary already exists, the role will skip the install steps. You can force them (to update, for instance), by setting `prometheus_force_install` to true.\n\n- `prometheus_config_dir`: the configuration directory (`/etc/prometheus`)\n- `prometheus_data_dir`: the data directory (`/var/lib/prometheus`)\n- `prometheus_web_listen_address`: the listening address of the web interface (`0.0.0.0:9090`)\n- `prometheus_web_external_url` the external URL you will access the web interface with (`''`)\n- `prometheus_storage_retention`: the retention period (`30d`)\n- `prometheus_storage_retention_size`: the max retention size (`0`, unlimited)\n- `prometheus_config_flags_extra`: extra flags passed to prometheus in the systemd unit (`{}`)\n- `prometheus_alertmanager_config`: original YAML for the `alertmanager_config` in `prometheus.yml`. (`{}`)\n- `prometheus_global`: defaults global intervals and timeouts (see `defaults/main.yml`)\n- prometheus_scrape_configs: original YAML for the `scrape_configs` in `promtheus.yml`. Defaults to the native metrics (`localhost:9090`).\n- `prometheus_alert_rules_files`: relative path of the custom alert rules files. (`prometheus/rules/*.rules`)\n- `prometheus_alert_rules`: oiginal YAML of the rules written `rules/ansible_alert.rules`. Some rules are preconfigured, see `defaults/main.yml`.\n\nYou can write all your rules in `prometheus_alert_rules`, or keep the default rules and add the other as files with `prometheus_alert_rules_files`. You can remove the default rules by setting `prometheus_alert_rules` to `[]`.\n\n## Example playbook\n\n```yaml\n---\n- hosts: myhost\n  roles: prometheus\n  vars:\n    prometheus_web_listen_address: \"127.0.0.1:9090\"\n    prometheus_web_external_url: \"https://prometheus.domain.tld\"\n    prometheus_scrape_configs:\n      - job_name: \"prometheus\"\n        static_configs:\n          - targets:\n              - \"localhost:9090\"\n      - job_name: \"node_exporter\"\n        static_configs:\n          - targets:\n              - \"localhost:9100\"\n    prometheus_alertmanager_config:\n      - static_configs:\n          - targets:\n              - localhost:9093\n```\n\n## License\n\nMIT. See LICENSE for more details.\n\n## Credit\n\nThis role is largely inspired by [cloudalchemy/ansible-prometheus](https://github.com/cloudalchemy/ansible-prometheus).\n\n## Author Information\n\nSee my other Ansible roles at [angristan/ansible-roles](https://github.com/angristan/ansible-roles).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Fansible-prometheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangristan%2Fansible-prometheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Fansible-prometheus/lists"}