From f1d91a9e09d6b457a3adc1b6a0b29c4ac9a72b8c Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 23 Mar 2021 10:21:19 -0600 Subject: [PATCH] [TRAIN-Only] Update ansible python fact We need to use ansible_facts for the python version to generate python_cmd if we turn off the inject facts as vars. This was removed in later versions. Change-Id: I9d25295045bcc80077bfbee36694dea7772d7761 Related-Bug: #1915761 --- common/generate-config-tasks.yaml | 4 ++-- common/host-container-puppet-tasks.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/generate-config-tasks.yaml b/common/generate-config-tasks.yaml index 3c7a88f5da..4b8524c112 100644 --- a/common/generate-config-tasks.yaml +++ b/common/generate-config-tasks.yaml @@ -1,13 +1,13 @@ - name: Gather facts needed by role if necessary setup: gather_subset: "!min,python" - when: ansible_python is not defined + when: ansible_facts['python'] is not defined tags: - container_config_tasks - name: set python_cmd if necessary set_fact: - python_cmd: "python{{ ansible_python.version.major }}" + python_cmd: "python{{ ansible_facts.python.version.major }}" cacheable: true when: python_cmd is not defined tags: diff --git a/common/host-container-puppet-tasks.yaml b/common/host-container-puppet-tasks.yaml index f6b13c1344..059b0fbbd5 100644 --- a/common/host-container-puppet-tasks.yaml +++ b/common/host-container-puppet-tasks.yaml @@ -12,13 +12,13 @@ - name: Gather ansible facts if necessary setup: gather_subset: "!min,python" - when: ansible_python is not defined + when: ansible_facts['python'] is not defined tags: - container_config_tasks - name: Set python_cmd if necessary set_fact: - python_cmd: "python{{ ansible_python.version.major }}" + python_cmd: "python{{ ansible_facts.python.version.major }}" cacheable: true when: python_cmd is not defined tags: