From fff8cf73c6a4d0e311b8b02036e7df928b998339 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Tue, 7 Apr 2020 00:12:03 +0200 Subject: [PATCH] Properly place undercloud hosts record upgrade task Undercloud record for hosts has to be in all the nodes that fetch images from it. Proper location for this code is where we set up podman. If it's only in ContainerImagesPrepare it runs on the Controller role only. Closes-Bug: #1871243 Change-Id: Id081f049bca6c961ad2ff649ac357cea8d552739 --- .../container-image-prepare-baremetal-ansible.j2.yaml | 9 --------- deployment/podman/podman-baremetal-ansible.yaml | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/deployment/container-image-prepare/container-image-prepare-baremetal-ansible.j2.yaml b/deployment/container-image-prepare/container-image-prepare-baremetal-ansible.j2.yaml index d00710c158..1dd36c3229 100644 --- a/deployment/container-image-prepare/container-image-prepare-baremetal-ansible.j2.yaml +++ b/deployment/container-image-prepare/container-image-prepare-baremetal-ansible.j2.yaml @@ -132,12 +132,3 @@ outputs: {% endfor %} when: - (step | int) == 1 - upgrade_tasks: - - name: Make sure the Undercloud hostname is included in /etc/hosts - when: - - step|int == 1 - - undercloud_hosts_entries is defined - lineinfile: - dest: /etc/hosts - line: "{{ '{{ ' }} undercloud_hosts_entries | join('') {{ ' }}' }}" - state: present diff --git a/deployment/podman/podman-baremetal-ansible.yaml b/deployment/podman/podman-baremetal-ansible.yaml index 174a4a37c3..8bb7c6f7e9 100644 --- a/deployment/podman/podman-baremetal-ansible.yaml +++ b/deployment/podman/podman-baremetal-ansible.yaml @@ -160,6 +160,13 @@ outputs: when: - step|int == 1 block: + - name: Make sure the Undercloud hostname is included in /etc/hosts + when: + - undercloud_hosts_entries is defined + lineinfile: + dest: /etc/hosts + line: "{{ undercloud_hosts_entries | join('') }}" + state: present - name: Set container_registry_insecure_registries fact. set_fact: container_registry_insecure_registries: