Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
[TRAIN-Only] Update ansible python fact
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mwhahaha committed Mar 23, 2021
1 parent c3396e2 commit f1d91a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/generate-config-tasks.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions common/host-container-puppet-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f1d91a9

Please sign in to comment.