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

49 lines
2.2 KiB
YAML

---
# tasks file for tripleo_overcloud_profiles_list
- name: Setup overcloud profiles list command
set_fact:
_list_cmd: >-
{{ tripleo_overcloud_profiles_list_os_cloud | ternary('', "source " ~ tripleo_overcloud_profiles_list_rc_file ~ "; ") }}
{{ openstack_bin }} overcloud profiles list
{{ tripleo_overcloud_profiles_list_all | ternary('--all', '') }}
{{ tripleo_overcloud_profiles_list_control_flavor | ternary('--control-flavor ' ~ tripleo_overcloud_profiles_list_control_flavor, '') }}
{{ tripleo_overcloud_profiles_list_compute_flavor | ternary('--compute-flavor ' ~ tripleo_overcloud_profiles_list_compute_flavor, '') }}
{{ tripleo_overcloud_profiles_list_ceph_storage_flavor | ternary('--ceph-storage-flavor ' ~ tripleo_overcloud_profiles_list_ceph_storage_flavor, '') }}
{{ tripleo_overcloud_profiles_list_block_storage_flavor | ternary('--block-storage-flavor ' ~ tripleo_overcloud_profiles_list_block_storage_flavor, '') }}
{{ tripleo_overcloud_profiles_list_swift_storage_flavor | ternary('--swift-storage-flavor ' ~ tripleo_overcloud_profiles_list_swift_storage_flavor, '') }}
_list_env:
OS_CLOUD: "{{ tripleo_overcloud_profiles_list_os_cloud }}"
- name: Show debug information
when: tripleo_overcloud_profiles_list_debug|bool
block:
- name: Show the profiles list command
debug:
var: _list_cmd
- name: Show the profiles list environment
debug:
var: _list_env
- name: Write reproducer script
tripleo_shell_script:
dest: "{{ tripleo_overcloud_profiles_list_home_dir }}/tripleo_overcloud_profiles_list.sh"
shell_command: "{{ _list_cmd }}"
shell_environment: "{{ _list_env }}"
when: tripleo_overcloud_profiles_list_generate_scripts|bool
- name: List profiles
shell: "{{ _list_cmd }}" # noqa 305
environment: "{{ _list_env }}"
register: tripleo_overcloud_profiles_list_result
changed_when: true
when:
- not ansible_check_mode|bool
- not tripleo_overcloud_profiles_list_generate_scripts_only|bool
- name: Set output fact
when:
- tripleo_overcloud_profiles_list_result.stdout is defined
set_fact:
tripleo_overcloud_profiles_list_output: "{{ tripleo_overcloud_profiles_list_result.stdout }}"