tripleo-operator-ansible/roles/tripleo_undercloud_install/tasks/main.yml

51 lines
1.9 KiB
YAML

---
- name: Setup undercloud install facts
set_fact:
_install_cmd: >-
{{ openstack_bin }} undercloud install
{{ tripleo_undercloud_install_force_stack_update | ternary("--force-stack-update", '') }}
{{ tripleo_undercloud_install_no_validations | ternary("--no-validations", '') }}
{{ 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_log_output | ternary((">" ~ tripleo_undercloud_install_log), '') }}
{{ tripleo_undercloud_install_log_combine | ternary("2>&1", '') }}
_install_env: {}
- name: Preserve existing log file if exists
timestamp_file:
path: "{{ tripleo_undercloud_install_log }}"
when: tripleo_undercloud_install_log_output|bool
- name: Show debug information
when: tripleo_undercloud_install_debug|bool
block:
- name: Show the undercloud install command
debug:
var: _install_cmd
- name: Show the undercloud install environment
debug:
var: _install_env
- name: Write reproducer script
tripleo_shell_script:
dest: "{{ tripleo_undercloud_install_home_dir }}/tripleo_undercloud_install.sh"
shell_command: "{{ _install_cmd }}"
shell_environment: "{{ _install_env }}"
when: tripleo_undercloud_install_generate_scripts|bool
- name: undercloud install
shell: "{{ _install_cmd }}" # noqa 305
environment: "{{ _install_env }}"
args:
chdir: "{{ tripleo_undercloud_install_home_dir }}"
warn: false
async: "{{ tripleo_undercloud_install_timeout }}"
poll: "{{ tripleo_undercloud_install_poll }}"
register: tripleo_undercloud_install_result
changed_when: true
when:
- not ansible_check_mode|bool
- not tripleo_undercloud_install_generate_scripts_only|bool