diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-03-20 15:47:51 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-03-20 15:47:51 +0100 |
commit | e2c7b1305ca8495065dcf40fd2092d7c698dd6ea (patch) | |
tree | abcaa7006a9c4b7a9add9bd0bf8c24f7f8ce048f /roles/ands_network/tasks/add_names.yml | |
parent | 47f350bc3aa85a8bd406d95faf084df2abf74ae9 (diff) | |
download | ands-e2c7b1305ca8495065dcf40fd2092d7c698dd6ea.tar.gz ands-e2c7b1305ca8495065dcf40fd2092d7c698dd6ea.tar.bz2 ands-e2c7b1305ca8495065dcf40fd2092d7c698dd6ea.tar.xz ands-e2c7b1305ca8495065dcf40fd2092d7c698dd6ea.zip |
Local volumes and StatefulSet to provision Master/Slave MySQL and Galera cluster
Diffstat (limited to 'roles/ands_network/tasks/add_names.yml')
-rw-r--r-- | roles/ands_network/tasks/add_names.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/ands_network/tasks/add_names.yml b/roles/ands_network/tasks/add_names.yml new file mode 100644 index 0000000..3edde38 --- /dev/null +++ b/roles/ands_network/tasks/add_names.yml @@ -0,0 +1,28 @@ +# Currently EXCLUDED +# Kind of post-install. We can include this in maitain later. + +# We should not do it before Gluster peers are probed, otherwise everything will fail. +# Some peers will have names and others IPs. +- name: Configure all storage hostnames in /etc/hosts + lineinfile: dest="/etc/hosts" line="{{ ip }} {{ fqdn }} {{ hostname }}" regexp="{{ fqdn }}" state="present" + when: + - hostvars[item]['ands_facts_configured'] is defined + vars: + ip: "{{ hostvars[item]['ands_storage_ip'] }}" + hostname: "{{ hostvars[item]['ands_hostname_storage'] }}" + fqdn: "{{ hostvars[item]['ands_hostname_storage'] ~ ands_inner_dot_domain }}" + with_inventory_hostnames: + - nodes + - new_nodes + +- name: Configure all public hostnames in /etc/hosts + lineinfile: dest="/etc/hosts" line="{{ ip }} {{ fqdn }} {{ hostname }}" regexp="{{ fqdn }}" state="present" + when: + - hostvars[item]['ands_facts_configured'] is defined + vars: + ip: "{{ hostvars[item]['ands_openshift_public_ip'] }}" + hostname: "{{ hostvars[item]['ands_hostname_public'] }}" + fqdn: "{{ hostvars[item]['ands_hostname_public'] ~ ands_inner_dot_domain }}" + with_inventory_hostnames: + - nodes + - new_nodes |