From d322fc96090dd0af61afbbcaf6de0944e381856a Mon Sep 17 00:00:00 2001 From: Masayoshi Mizuma Date: Mon, 20 Jun 2022 18:16:18 +0900 Subject: [PATCH] Fix to get HOME environment in dhcp-provisioning validation The validation of dhcp-provisioning fails because it doesn't see the correct path of undercloud.conf. The playbook has "become: true", so the ansible_env.HOME is the home directory of root. lookup(env, HOME) can get the home directory for the user. Change-Id: I7c7de26f09f36d88b777be76027ad4ac66deda6b (cherry picked from commit 8e4958cd7575c8c42da02976b4fad1e4f30924c7) --- roles/dhcp_validations/tasks/dhcp-provisioning.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dhcp_validations/tasks/dhcp-provisioning.yaml b/roles/dhcp_validations/tasks/dhcp-provisioning.yaml index 6de0b5263..7650c6efc 100644 --- a/roles/dhcp_validations/tasks/dhcp-provisioning.yaml +++ b/roles/dhcp_validations/tasks/dhcp-provisioning.yaml @@ -9,7 +9,7 @@ - name: Gather undercloud.conf values validations_read_ini: - path: "{{ ansible_env.HOME }}/undercloud.conf" + path: "{{ lookup('env', 'HOME') }}/undercloud.conf" section: DEFAULT key: local_interface ignore_missing_file: true