
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
65 lines
2.8 KiB
YAML
65 lines
2.8 KiB
YAML
---
|
|
# tasks file for tripleo_overcloud_update_run
|
|
- name: Setup overcloud update run facts
|
|
set_fact:
|
|
_update_run_cmd: >-
|
|
{{ tripleo_overcloud_update_run_os_cloud | ternary('', "source " ~ tripleo_overcloud_update_run_rc_file ~ "; ") }}
|
|
{{ openstack_bin }} overcloud update run
|
|
{{ tripleo_overcloud_update_run_limit | ternary('--limit $UPDATE_LIMIT', '') }}
|
|
{{ tripleo_overcloud_update_run_playbook | tripleo.operator.shell_arg_list('--playbook') }}
|
|
{{ tripleo_overcloud_update_run_ssh_user | ternary('--ssh-user $UPDATE_SSH_USER', '') }}
|
|
{{ tripleo_overcloud_update_run_static_inventory | ternary('--static-inventory $UPDATE_STATIC_INVENTORY', '') }}
|
|
{{ tripleo_overcloud_update_run_stack | ternary('--stack $UPDATE_STACK', '') }}
|
|
{{ tripleo_overcloud_update_run_yes | ternary('--yes', '') }}
|
|
{{ tripleo_overcloud_update_run_log_output | ternary((">" ~ tripleo_overcloud_update_run_log), '') }}
|
|
{{ tripleo_overcloud_update_run_log_combine | ternary("2>&1", '') }}
|
|
_update_run_env:
|
|
UPDATE_LIMIT: "{{ tripleo_overcloud_update_run_limit | quote }}"
|
|
UPDATE_PLAYBOOK: "{{ tripleo_overcloud_update_run_playbook| list | join(' ') }}"
|
|
UPDATE_SSH_USER: "{{ tripleo_overcloud_update_run_ssh_user }}"
|
|
UPDATE_STATIC_INVENTORY: "{{ tripleo_overcloud_update_run_static_inventory }}"
|
|
UPDATE_STACK: "{{ tripleo_overcloud_update_run_stack }}"
|
|
OS_CLOUD: "{{ tripleo_overcloud_update_run_os_cloud }}"
|
|
|
|
- name: Preserve existing log file if exists
|
|
timestamp_file:
|
|
path: "{{ tripleo_overcloud_update_run_log }}"
|
|
when: tripleo_overcloud_update_run_log_output|bool
|
|
|
|
- name: Show debug information
|
|
when: tripleo_overcloud_update_run_debug|bool
|
|
block:
|
|
- name: Show the overcloud update run command
|
|
debug:
|
|
var: _update_run_cmd
|
|
|
|
- name: Show the overcloud update run environment
|
|
debug:
|
|
var: _update_run_env
|
|
|
|
- name: Write reproducer script
|
|
tripleo_shell_script:
|
|
dest: "{{ tripleo_overcloud_update_run_home_dir }}/tripleo_overcloud_update_run.sh"
|
|
shell_command: "{{ _update_run_cmd }}"
|
|
shell_environment: "{{ _update_run_env }}"
|
|
when: tripleo_overcloud_update_run_generate_scripts|bool
|
|
|
|
- name: Overcloud update run
|
|
shell: "{{ _update_run_cmd }}" # noqa 305
|
|
environment: "{{ _update_run_env }}"
|
|
args:
|
|
chdir: "{{ tripleo_overcloud_update_run_home_dir }}"
|
|
register: tripleo_overcloud_update_run_result
|
|
async: "{{ tripleo_overcloud_update_run_timeout }}"
|
|
poll: "{{ tripleo_overcloud_update_run_poll }}"
|
|
changed_when: false
|
|
when:
|
|
- not ansible_check_mode|bool
|
|
- not tripleo_overcloud_update_run_generate_scripts_only|bool
|
|
|
|
- name: Set output fact
|
|
when:
|
|
- tripleo_overcloud_update_run_result.stdout is defined
|
|
set_fact:
|
|
tripleo_overcloud_update_run_output: "{{ tripleo_overcloud_update_run_result.stdout }}"
|