victoriametrics/victoriametrics.yaml
2024-05-08 19:27:42 +03:00

43 lines
1.3 KiB
YAML

- hosts: localhost
gather_facts: false
tasks:
- name: Print Ansible version
debug:
msg: "{{ ansible_version }}"
- hosts: victoriametrics
gather_facts: false
tasks:
- name: Wait 300 seconds
ansible.builtin.wait_for_connection:
timeout: 300
- hosts: victoriametrics
tasks:
- name: Include Patroni vars
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yaml"
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yaml"
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_major_version'] }}.yaml"
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_version'] }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- victoriametrics.yaml
paths:
- "vars"
- hosts: victoriametrics
gather_facts: true
become: true
tasks:
- name: Set hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
- import_role:
name: hosts
- import_role:
name: victoriametrics