victoriametrics/tasks/vmagent.yaml
2021-12-22 15:03:21 +03:00

36 lines
1.1 KiB
YAML

- name: Install vmagent {{ victoriametrics_vmagent_version }}
dnf:
name: "vmagent-{{ victoriametrics_vmagent_version }}"
state: present
register: vmagent_setup
notify: Restart vmagent
- name: Template vmagent config
template:
src: etc/victoriametrics/vmagent/vmagent.conf.j2
dest: /etc/victoriametrics/vmagent/vmagent.conf
notify: Restart vmagent
- name: Merge prometheus config values
set_fact:
victoriametrics_vmagent_prometheus_config_combined: "{{ victoriametrics_vmagent_prometheus_config_default | combine(victoriametrics_vmagent_prometheus_config, recursive=true) | to_nice_yaml(indent=2) }}"
#- name: Template vmagent prometheus config
# copy:
# content: "{{ victoriametrics_vmagent_prometheus_config }}"
# dest: /etc/victoriametrics/vmagent/prometheus.yml
# notify: Restart vmagent
- name: Template vmagent prometheus config
template:
src: etc/victoriametrics/vmagent/prometheus.yml.j2
dest: /etc/victoriametrics/vmagent/prometheus.yml
notify: Restart vmagent
- name: Enable and start vmagent service
systemd:
name: vmagent
state: started
enabled: yes
daemon_reload: yes