Browse Source

Merge "Add ansible_nodename (system hostname) to /etc/hosts"

tags/9.0.0.0rc1
Zuul 8 months ago
parent
commit
796980aa3f
2 changed files with 9 additions and 1 deletions
  1. +2
    -1
      ansible/roles/baremetal/tasks/pre-install.yml
  2. +7
    -0
      releasenotes/notes/add-nodename-to-etc-hosts-6360acc642ee3d49.yaml

+ 2
- 1
ansible/roles/baremetal/tasks/pre-install.yml View File

@@ -24,7 +24,8 @@
{% for host in groups['baremetal'] %}
{% set api_interface = hostvars[host]['api_interface'] %}
{% if host not in groups['bifrost'] or 'ansible_' + api_interface in hostvars[host] %}
{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% set hostnames = [hostvars[host]['ansible_nodename'], hostvars[host]['ansible_hostname']] %}
{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }} {{ hostnames | unique | join(' ') }}
{% endif %}
{% endfor %}
become: True

+ 7
- 0
releasenotes/notes/add-nodename-to-etc-hosts-6360acc642ee3d49.yaml View File

@@ -0,0 +1,7 @@
---
fixes:
- |
Adds system hostnames to ``/etc/hosts``, if different from short hostnames.
This can fix live migration of Nova instances in some contexts. See `bug
1830023 <https://bugs.launchpad.net/kolla-ansible/+bug/1830023>`__ for
details.

Loading…
Cancel
Save