From c17d811fa1794d337cb747b66ca6275917287ae9 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 9 Dec 2020 17:33:00 +0200 Subject: [PATCH] Apply /etc/environment for runtime after adjustment Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-openstack_hosts/+/766030 Change-Id: I94008de1fe97400ab37de39d03599fa9f53ab3f0 --- scripts/gate-check-commit.sh | 5 +++++ tests/roles/bootstrap-host/tasks/prepare_aio_config.yml | 6 ++++++ .../bootstrap-host/templates/user_variables.aio.yml.j2 | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/scripts/gate-check-commit.sh b/scripts/gate-check-commit.sh index 388401f2e7..06db06194d 100755 --- a/scripts/gate-check-commit.sh +++ b/scripts/gate-check-commit.sh @@ -178,6 +178,11 @@ else # Log some data about the instance and the rest of the system log_instance_info + # Reload environment file and apply variables for the session + set -a + . /etc/environment + set +a + # Once setup-hosts is complete, we should gather facts for everything # (now including containers) so that the fact cache is complete for the # remainder of the run. diff --git a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml index 9c495ad85f..bc05642d87 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml @@ -112,6 +112,12 @@ when: - ansible_selinux.status == "enabled" +- name: Get systemd version + command: "rpm -q systemd" + changed_when: false + register: systemd_version + when: ansible_os_family | lower == 'redhat' + - name: Set the user_variables config_template: src: "{{ bootstrap_user_variables_template }}" diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index 61d85f90de..2af2ed7376 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +{% if ansible_os_family | lower == 'redhat' %} +deployment_environment_variables: + LIBSYSTEMD_VERSION: {{ systemd_version.stdout_lines[0].split('-')[1] }} +{% endif %} + ## General options debug: True