ansible-collection-prometheus/roles/pushgateway/tasks/main.yml
gardar e5005614b2
refactor(pushgateway): delegate common tasks to _common role
Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-10-15 17:11:35 +00:00

61 lines
1.9 KiB
YAML

---
- name: Preflight
ansible.builtin.include_tasks:
file: preflight.yml
tags:
- pushgateway_install
- pushgateway_configure
- pushgateway_run
- name: Install
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: install.yml
vars:
_common_local_cache_path: "{{ pushgateway_local_cache_path }}"
_common_binaries: "{{ _pushgateway_binaries }}"
_common_binary_install_dir: "{{ pushgateway_binary_install_dir }}"
_common_binary_url: "{{ pushgateway_binary_url }}"
_common_checksums_url: "{{ pushgateway_checksums_url }}"
_common_system_group: "{{ pushgateway_system_group }}"
_common_system_user: "{{ pushgateway_system_user }}"
_common_config_dir: "{{ pushgateway_config_dir }}"
_common_binary_unarchive_opts: ['--strip-components=1']
tags:
- pushgateway_install
- name: SELinux
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: selinux.yml
vars:
_common_selinux_port: "{{ pushgateway_web_listen_address | urlsplit('port') }}"
when: ansible_selinux.status == "enabled"
tags:
- pushgateway_configure
- name: Configure
ansible.builtin.include_role:
name: prometheus.prometheus._common
tasks_from: configure.yml
vars:
_common_system_user: "{{ pushgateway_system_user }}"
_common_system_group: "{{ pushgateway_system_group }}"
_common_config_dir: "{{ pushgateway_config_dir }}"
_common_tls_server_config: "{{ pushgateway_tls_server_config }}"
_common_http_server_config: "{{ pushgateway_http_server_config }}"
_common_basic_auth_users: "{{ pushgateway_basic_auth_users }}"
tags:
- pushgateway_configure
- name: Ensure Pushgateway is enabled on boot
become: true
ansible.builtin.systemd:
daemon_reload: true
name: pushgateway
enabled: true
state: started
when:
- not ansible_check_mode
tags:
- pushgateway_run