[Ussuri and older] Set python_cmd where we need it

If you use --start-at-tasks, python_cmd may not be defined when we run
the generate configuration or host container tasks.  We should ensure
this variable is set prior to using it.

This variable was no longer used with the transition of the
container-puppet.py items into ansible itself so it only applies for
Ussuri and older.

Change-Id: I956307d5c69cd4d259fb1ab2731fe0001a196c8e
Closes-Bug: #1907858
This commit is contained in:
Alex Schultz 2020-12-11 13:31:48 -07:00
parent a13da7e238
commit 1a085631c0
3 changed files with 30 additions and 15 deletions

View File

@ -268,21 +268,6 @@
tags:
- container_startup_configs
- name: gather facts needed by role
setup:
gather_subset: "!min,python"
when: ansible_python is not defined
tags:
- container_config_tasks
- name: set python_cmd
set_fact:
python_cmd: "python{{ ansible_python.version.major }}"
cacheable: true
when: python_cmd is not defined
tags:
- container_config_tasks
- name: Set host puppet debugging fact string
set_fact:
host_puppet_config_debug: "--debug --verbose"

View File

@ -1,3 +1,18 @@
- name: Gather facts needed by role if necessary
setup:
gather_subset: "!min,python"
when: ansible_python is not defined
tags:
- container_config_tasks
- name: set python_cmd if necessary
set_fact:
python_cmd: "python{{ ansible_python.version.major }}"
cacheable: true
when: python_cmd is not defined
tags:
- container_config_tasks
- name: Block for container-puppet tasks (generate config) during step 1 with paunch
when:
- enable_paunch|default(true)

View File

@ -9,6 +9,21 @@
tags:
- container_config_tasks
- name: Gather ansible facts if necessary
setup:
gather_subset: "!min,python"
when: ansible_python is not defined
tags:
- container_config_tasks
- name: Set python_cmd if necessary
set_fact:
python_cmd: "python{{ ansible_python.version.major }}"
cacheable: true
when: python_cmd is not defined
tags:
- container_config_tasks
- name: Block for container-puppet tasks (bootstrap tasks) for step {{ step }} with paunch
when:
- enable_paunch|default(true)