Generate reproducer script for container image prepare

Change-Id: I2477deef398a6fa7c24262447dbf673b5063592f
This commit is contained in:
Cédric Jeanneret 2020-09-16 09:36:22 +02:00
parent 144ca746a2
commit 36aa8c7089
3 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@ Role Variables
* `tripleo_container_image_prepare_home_dir`: (String) Home directory for the undercloud user. Default: "{{ ansible_env.HOME }}"
* `tripleo_container_image_prepare_output_env_file`: (String) File to write heat environment file which specifies all image parameters. Default is not set.
* `tripleo_container_image_prepare_output_roles_file`: (String) Roles file path on the remote system. Default is not set.
* `tripleo_container_image_prepare_scripts`: (Boolean) Write out a shell script that can be used to reproduce the command being executed. By default uses the value of `tripleo_generate_scripts` or False if `tripleo_generate_scripts` is not defined.
* `tripleo_container_image_prepare_timeout`: (Number) Amount of time to wait for the command to conplete. Default: 1800
Output Variables

View File

@ -14,4 +14,5 @@ tripleo_container_image_prepare_log_output: false
tripleo_container_image_prepare_log_combine: true
tripleo_container_image_prepare_output_env_file:
tripleo_container_image_prepare_roles_file:
tripleo_container_image_prepare_scripts: "{{ tripleo_generate_scripts | default(False) }}"
tripleo_container_image_prepare_timeout: 1800

View File

@ -19,6 +19,12 @@
var: _prepare_cmd
when: tripleo_container_image_prepare_debug|bool
- name: Write reproducer script
tripleo_shell_script:
dest: "{{ tripleo_container_image_prepare_home_dir }}/tripleo_container_prepare.sh"
shell_command: "{{ _prepare_cmd }}"
when: tripleo_container_image_prepare_scripts|bool
- name: Container image prepare
shell: "{{ _prepare_cmd }}" # noqa 305
async: "{{ tripleo_container_image_prepare_timeout }}"