with newer ansible coming, the "warn" parameter is removed and raises an error. Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/864392 Change-Id: I934211aa437fc268288de06fc39545c98f1746c5
51 lines
1.9 KiB
YAML
51 lines
1.9 KiB
YAML
---
|
|
- name: Setup undercloud upgrade facts
|
|
set_fact:
|
|
_upgrade_cmd: >-
|
|
{{ openstack_bin }} undercloud upgrade
|
|
{{ tripleo_undercloud_upgrade_force_stack_update | ternary("--force-stack-update", '') }}
|
|
{{ tripleo_undercloud_upgrade_no_validations | ternary("--no-validations", '') }}
|
|
{{ 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: {}
|
|
|
|
- name: Preserve existing log file if exists
|
|
timestamp_file:
|
|
path: "{{ tripleo_undercloud_upgrade_log }}"
|
|
when: tripleo_undercloud_upgrade_log_output|bool
|
|
|
|
- name: Show debug information
|
|
when: tripleo_undercloud_upgrade_debug|bool
|
|
block:
|
|
- name: Show the undercloud upgrade command
|
|
debug:
|
|
var: _upgrade_cmd
|
|
|
|
- name: Show the undercloud upgrade environment
|
|
debug:
|
|
var: _upgrade_env
|
|
|
|
- name: Write reproducer script
|
|
tripleo_shell_script:
|
|
dest: "{{ tripleo_undercloud_upgrade_home_dir }}/tripleo_undercloud_upgrade.sh"
|
|
shell_command: "{{ _upgrade_cmd }}"
|
|
shell_environment: "{{ _skel_env }}"
|
|
when: tripleo_undercloud_upgrade_generate_scripts|bool
|
|
|
|
- name: undercloud upgrade
|
|
shell: "{{ _upgrade_cmd }}" # noqa 305
|
|
environment: "{{ _upgrade_env }}"
|
|
args:
|
|
chdir: "{{ tripleo_undercloud_upgrade_home_dir }}"
|
|
async: "{{ tripleo_undercloud_upgrade_timeout }}"
|
|
poll: "{{ tripleo_undercloud_upgrade_poll }}"
|
|
register: tripleo_undercloud_upgrade_result
|
|
changed_when: true
|
|
when:
|
|
- not ansible_check_mode|bool
|
|
- not tripleo_undercloud_upgrade_generate_scripts_only|bool
|