2017-05-30 16:37:57 +02:00
|
|
|
---
|
|
|
|
# Run all plays as root.
|
|
|
|
- hosts: databases
|
|
|
|
become: True
|
|
|
|
roles:
|
|
|
|
- mariadb
|
2017-10-17 17:12:52 +02:00
|
|
|
vars:
|
2017-10-18 09:23:04 +02:00
|
|
|
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']) }}"
|