mirror of
https://gitea.0xace.cc/ansible-galaxy/victoriametrics.git
synced 2024-11-24 23:56:39 +00:00
36 lines
1.1 KiB
YAML
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
|