undercloud-setup: Introduce tripleo_set_unique_hostname variable
In hostname playbook, add a task to modify /etc/hosts. tripleo_set_unique_hostname is a new boolean which if set to true, will add a line to /etc/hosts with an unique hostname ( {{ ansible_hostname }}-unique ) which will resolve the first IPv4 address found in the inventory. It is useful to reproduce a deployment where the operator is using hostnames to create SSL certificates and deploy the undecloud with the public host being an hostname/fqdn and not an IP address. Related-Bug: #1763776 Change-Id: I6425499e5d248e6cb2285f14dd9c6e716122b90b
This commit is contained in:
parent
cdbf6f9319
commit
9cc7489cca
|
@ -41,3 +41,4 @@ undercloud_ara_version: 0.15.0
|
|||
undercloud_ara: false
|
||||
install_atop: true
|
||||
atop_command: atop -R -w /var/log/atop.bin
|
||||
tripleo_set_unique_hostname: false
|
||||
|
|
|
@ -16,6 +16,16 @@
|
|||
{{ working_dir }}/hostname.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/hostname.sh.log
|
||||
become: true
|
||||
|
||||
# https://launchpad.net/bugs/1763776
|
||||
- name: Add a unique hostname to /etc/hosts resolved to the first IPv4 available
|
||||
become: true
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
state: present
|
||||
insertafter: EOF
|
||||
line: "{{ ansible_all_ipv4_addresses | first }} {{ ansible_hostname }}-unique"
|
||||
when: tripleo_set_unique_hostname|default(false)|bool
|
||||
|
||||
# for undercloud containers only, starting from Rocky.
|
||||
- name: Override containerized undercloud CI hostname for tripleo client
|
||||
when:
|
||||
|
|
Loading…
Reference in New Issue