mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-26 05:40:18 +00:00
1e4e4c3415
Signed-off-by: gardar <gardar@users.noreply.github.com>
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
---
|
|
- name: Preflight
|
|
ansible.builtin.include_tasks:
|
|
file: preflight.yml
|
|
tags:
|
|
- prometheus_configure
|
|
- prometheus_install
|
|
- prometheus_run
|
|
|
|
- name: Install
|
|
ansible.builtin.include_role:
|
|
name: prometheus.prometheus._common
|
|
tasks_from: install.yml
|
|
vars:
|
|
_common_local_cache_path: "{{ prometheus_local_cache_path }}"
|
|
_common_binaries: "{{ _prometheus_binaries }}"
|
|
_common_binary_install_dir: "{{ prometheus_binary_install_dir }}"
|
|
_common_binary_url: "{{ prometheus_binary_url }}"
|
|
_common_checksums_url: "{{ prometheus_checksums_url }}"
|
|
_common_system_group: "{{ prometheus_system_group }}"
|
|
_common_system_user: "{{ prometheus_system_user }}"
|
|
_common_config_dir: "{{ prometheus_config_dir }}"
|
|
_common_binary_unarchive_opts: ['--strip-components=1']
|
|
tags:
|
|
- prometheus_install
|
|
|
|
- name: SELinux
|
|
ansible.builtin.include_role:
|
|
name: prometheus.prometheus._common
|
|
tasks_from: selinux.yml
|
|
vars:
|
|
_common_selinux_port: "{{ prometheus_web_listen_address | urlsplit('port') }}"
|
|
when: ansible_selinux.status == "enabled"
|
|
tags:
|
|
- prometheus_configure
|
|
|
|
- name: Configure
|
|
ansible.builtin.include_tasks:
|
|
file: configure.yml
|
|
tags:
|
|
- prometheus_configure
|
|
|
|
- name: Ensure prometheus service is started and enabled
|
|
become: true
|
|
ansible.builtin.systemd:
|
|
daemon_reload: true
|
|
name: prometheus
|
|
state: started
|
|
enabled: true
|
|
tags:
|
|
- prometheus_run
|
|
|
|
- name: Make sure prometheus service is running
|
|
ansible.builtin.service_facts: {}
|
|
register: __service_status
|
|
until: "__service_status.ansible_facts.services['prometheus.service'].state == 'running'"
|
|
retries: 10
|
|
delay: 5
|