Browse Source

[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
changes/50/782550/1
Alex Schultz 1 month ago
parent
commit
f1d91a9e09
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      common/generate-config-tasks.yaml
  2. +2
    -2
      common/host-container-puppet-tasks.yaml

+ 2
- 2
common/generate-config-tasks.yaml View File

@ -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:


+ 2
- 2
common/host-container-puppet-tasks.yaml View File

@ -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:


Loading…
Cancel
Save