[Train-only] Move config-data context switching to Upgrade
This task is time-consuming and shouldn't kick in for every action. This context change is needed when we move from docker (pre-train) to podman (train and later) only. This patch takes precedence on I973a49aec1a263e2a1ec3e5199803c86d6f77b35, making its backport useless. Co-Authored-By: Jose Luis Franco Arza <jfrancoa@redhat.com> Change-Id: Id20af84c086b8a927f42fd2031cc310fb19bf357 Related-Bug: #1887721
This commit is contained in:
parent
aeaf98134c
commit
906256a1b3
|
@ -32,29 +32,6 @@
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- hosts: "{{ deploy_target_host }}"
|
|
||||||
name: Ensure /var/lib/config-data context
|
|
||||||
become: true
|
|
||||||
gather_facts: false
|
|
||||||
any_errors_fatal: false
|
|
||||||
ignore_unreachable: "{{ scale_ignore_unreachable | default(false) }}"
|
|
||||||
tasks:
|
|
||||||
- name: Ensure /var/lib/config-data context
|
|
||||||
shell: |-
|
|
||||||
set -o pipefail
|
|
||||||
if [[ -e /var/lib/config-data ]]; then
|
|
||||||
chcon -R -t svirt_sandbox_file_t /var/lib/config-data
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
args:
|
|
||||||
executable: /bin/bash
|
|
||||||
warn: no
|
|
||||||
register: _selinux_config_data
|
|
||||||
changed_when: _selinux_config_data.rc == 2
|
|
||||||
failed_when: _selinux_config_data.rc not in [0,2]
|
|
||||||
tags:
|
|
||||||
- always
|
|
||||||
|
|
||||||
- hosts: "{{ deploy_target_host }}"
|
- hosts: "{{ deploy_target_host }}"
|
||||||
name: Render all_nodes data as group_vars for overcloud
|
name: Render all_nodes data as group_vars for overcloud
|
||||||
gather_facts: "{{ gather_facts | default(false) }}"
|
gather_facts: "{{ gather_facts | default(false) }}"
|
||||||
|
|
|
@ -162,6 +162,22 @@ outputs:
|
||||||
when:
|
when:
|
||||||
- step|int == 1
|
- step|int == 1
|
||||||
block:
|
block:
|
||||||
|
# This is needed when moving from Docker to Podman. The SELinux context
|
||||||
|
# is wrong for podman, especially if the directory was created by
|
||||||
|
# docker itself.
|
||||||
|
- name: Ensure /var/lib/config-data context
|
||||||
|
shell: |-
|
||||||
|
set -o pipefail
|
||||||
|
if [[ -e /var/lib/config-data ]]; then
|
||||||
|
chcon -R -t container_file_t /var/lib/config-data
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
warn: no
|
||||||
|
register: _selinux_config_data
|
||||||
|
changed_when: _selinux_config_data.rc == 2
|
||||||
|
failed_when: _selinux_config_data.rc not in [0,2]
|
||||||
- name: Make sure the Undercloud hostname is included in /etc/hosts
|
- name: Make sure the Undercloud hostname is included in /etc/hosts
|
||||||
when:
|
when:
|
||||||
- undercloud_hosts_entries is defined
|
- undercloud_hosts_entries is defined
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
other:
|
||||||
|
- |
|
||||||
|
Moving this chcon call to the specific podman container upgrade part allows
|
||||||
|
to prevent consuming time for nothing. This chcon call is needed only if
|
||||||
|
we move from docker to podman, meaning upgrading to train.
|
Loading…
Reference in New Issue