2017-05-30 16:37:57 +02:00
|
|
|
---
|
|
|
|
# Run all plays as root.
|
|
|
|
- hosts: databases
|
|
|
|
become: True
|
|
|
|
roles:
|
|
|
|
- mariadb
|
2017-08-31 15:02:47 +02:00
|
|
|
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']) }}"
|