Add --reproduce-command in UC commands.

Include the --reproduce-command option support into the
tripleo_undercloud_install and tripleo_undercloud_upgrade operator roles.
This option will allow getting a reproducer to run the Ansible playbooks
for a deployment or upgrade.

Depends-On: https://review.opendev.org/c/openstack/python-tripleoclient/+/827494
Change-Id: I6cb69a4158213ee8694dc07ac1cec0dac3818346
This commit is contained in:
Jose Luis Franco Arza
2022-02-14 07:37:53 +01:00
committed by Jose Luis Franco
parent 1d330c9996
commit 63f0ba773d
8 changed files with 28 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ Role Variables
* `tripleo_undercloud_install_log_output`: (Boolean) Flag to log the output to a file rather than show it in the ansible output. Default: true
* `tripleo_undercloud_install_no_validations`: (Boolean) Flag to add --no-validations to the install. Default: false
* `tripleo_undercloud_install_poll`: (Integer) Number of seconds to wait between checks to see if the install command has completed. This should be set to a value greater or equal to 1. Default: 10
* `tripleo_undercloud_install_reproducer_command`: (Boolean) Flag to create a reproducer script including the Ansible command to re-run deployment playbooks.
* `tripleo_undercloud_install_timeout`: (Integer) Timeout for the install command. Default: 7200
* `tripleo_undercloud_install_yes`: (Boolean) Flag to add --yes to the install. Default: false
* `tripleo_undercloud_install_log`: (String) Install log file path. Default: "{{ tripleo_undercloud_install_home_dir }}/undercloud_install.log"

View File

@@ -12,6 +12,7 @@ tripleo_undercloud_install_log_combine: true
tripleo_undercloud_install_log_output: true
tripleo_undercloud_install_no_validations: false
tripleo_undercloud_install_poll: 10
tripleo_undercloud_install_reproducer_command: false
tripleo_undercloud_install_timeout: 7200
tripleo_undercloud_install_yes: false
tripleo_undercloud_install_log: "{{ tripleo_undercloud_install_home_dir }}/undercloud_install.log"

View File

@@ -75,3 +75,14 @@
assert:
that:
- tripleo_undercloud_install_result.stdout == "undercloud install --yes"
- name: Check parameter "tripleo_undercloud_install_reproducer_command"
include_role:
name: "tripleo_undercloud_install"
vars:
tripleo_undercloud_install_reproducer_command: true
- name: Assert "tripleo_undercloud_install_reproducer_command"
assert:
that:
- tripleo_undercloud_install_result.stdout == "undercloud install --reproduce-command"

View File

@@ -8,6 +8,7 @@
{{ tripleo_undercloud_install_inflight_validations | ternary("--inflight-validations", '') }}
{{ tripleo_undercloud_install_dry_run | ternary("--dry-run", '') }}
{{ tripleo_undercloud_install_yes | ternary("--yes", '') }}
{{ tripleo_undercloud_install_reproducer_command | ternary("--reproduce-command", '') }}
{{ tripleo_undercloud_install_log_output | ternary((">" ~ tripleo_undercloud_install_log), '') }}
{{ tripleo_undercloud_install_log_combine | ternary("2>&1", '') }}
_install_env: {}

View File

@@ -22,6 +22,7 @@ Role Variables
* `tripleo_undercloud_upgrade_log_output`: (Boolean) Flag to log the output to a file rather than show it in the ansible output. Default: true
* `tripleo_undercloud_upgrade_no_validations`: (Boolean) Flag to add --no-validations to the upgrade. Default: false
* `tripleo_undercloud_upgrade_poll`: (Integer) Number of seconds to wait between checks to see if the upgrade command has completed. This should be set to a value greater or equal to 1. Default: 10
* `tripleo_undercloud_upgrade_reproducer_command`: (Boolean) Flag to create a reproducer script including the Ansible command to re-run deployment playbooks.
* `tripleo_undercloud_upgrade_timeout`: (Integer) Timeout for the upgrade command. Default: 7200
* `tripleo_undercloud_upgrade_yes`: (Boolean) Flag to add --yes to the upgrade. Default: false
* `tripleo_undercloud_upgrade_log`: (String) Upgrade log file path. Default: "{{ tripleo_undercloud_upgrade_home_dir }}/undercloud_upgrade.log"

View File

@@ -13,5 +13,6 @@ tripleo_undercloud_upgrade_log_combine: true
tripleo_undercloud_upgrade_log_output: true
tripleo_undercloud_upgrade_no_validations: false
tripleo_undercloud_upgrade_poll: 10
tripleo_undercloud_upgrade_reproducer_command: false
tripleo_undercloud_upgrade_timeout: 7200
tripleo_undercloud_upgrade_yes: false

View File

@@ -75,3 +75,14 @@
assert:
that:
- tripleo_undercloud_upgrade_result.stdout == "undercloud upgrade --yes"
- name: Check parameter "tripleo_undercloud_upgrade_reproducer_command"
include_role:
name: "tripleo_undercloud_upgrade"
vars:
tripleo_undercloud_upgrade_reproducer_command: true
- name: Assert "tripleo_undercloud_upgrade_reproducer_command"
assert:
that:
- tripleo_undercloud_upgrade_result.stdout == "undercloud upgrade --reproduce-command"

View File

@@ -8,6 +8,7 @@
{{ tripleo_undercloud_upgrade_inflight_validations | ternary("--inflight-validations", '') }}
{{ tripleo_undercloud_upgrade_dry_run | ternary("--dry-run", '') }}
{{ tripleo_undercloud_upgrade_yes | ternary("--yes", '') }}
{{ tripleo_undercloud_upgrade_reproducer_command | ternary("--reproduce-command", '') }}
{{ tripleo_undercloud_upgrade_log_output | ternary((">" ~ tripleo_undercloud_upgrade_log), '') }}
{{ tripleo_undercloud_upgrade_log_combine | ternary("2>&1", '') }}
_upgrade_env: {}