hpc-cloud/mariadb.yml

14 lines
792 B
YAML

---
# Run all plays as root.
- hosts: databases
become: True
roles:
- mariadb
vars:
hostname_node0: "{{ hostvars[groups['databases'][0]]['ansible_hostname'] }}"
hostname_node1: "{{ hostvars[groups['databases'][1]]['ansible_hostname'] }}"
hostname_node2: "{{ hostvars[groups['databases'][2]]['ansible_hostname'] }}"
ip_node0: "{{ hostvars[groups['databases'][0]]['listen_ip'] | default(hostvars[groups['databases'][0]]['ansible_default_ipv4']['address']) }}"
ip_node1: "{{ hostvars[groups['databases'][1]]['listen_ip'] | default(hostvars[groups['databases'][1]]['ansible_default_ipv4']['address']) }}"
ip_node2: "{{ hostvars[groups['databases'][2]]['listen_ip'] | default(hostvars[groups['databases'][2]]['ansible_default_ipv4']['address']) }}"