65 lines
2.4 KiB
YAML
65 lines
2.4 KiB
YAML
---
|
|
- name: Setup ceph spec facts
|
|
set_fact:
|
|
_deploy_cmd: >-
|
|
{{ openstack_bin }} overcloud ceph spec
|
|
{{ tripleo_ceph_spec_deployed_baremetal }}
|
|
{{ tripleo_ceph_spec_standalone | ternary('--standalone', '') }}
|
|
{{ tripleo_ceph_spec_mon_ip | ternary('--mon-ip $CEPH_MON_IP', '') }}
|
|
{{ tripleo_ceph_spec_overwrite | ternary('--yes', '') }}
|
|
{{ tripleo_ceph_spec_file | ternary('--output $CEPH_SPEC', '') }}
|
|
{{ tripleo_ceph_spec_stack | ternary('--stack $DEPLOY_STACK', '') }}
|
|
{{ tripleo_ceph_spec_working_dir | ternary('--working-dir $DEPLOY_WORKING_DIR', '') }}
|
|
{{ tripleo_ceph_spec_roles_file | ternary('--roles $DEPLOY_ROLES_FILE', '') }}
|
|
{{ tripleo_ceph_spec_osd_spec | ternary('--osd-spec $CEPH_OSD_SPEC', '') }}
|
|
{{ tripleo_ceph_spec_crush_hierarchy | ternary('--crush-hierarchy $CEPH_CRUSH_HIERARCHY', '') }}
|
|
_deploy_env:
|
|
DEPLOY_STACK: "{{ tripleo_ceph_spec_stack }}"
|
|
DEPLOY_WORKING_DIR: "{{ tripleo_ceph_spec_working_dir }}"
|
|
DEPLOY_ROLES_FILE: "{{ tripleo_ceph_spec_roles_file }}"
|
|
CEPH_SPEC: "{{ tripleo_ceph_spec_file }}"
|
|
CEPH_MON_IP: "{{ tripleo_ceph_spec_mon_ip }}"
|
|
CEPH_OSD_SPEC: "{{ tripleo_ceph_spec_osd_spec }}"
|
|
CEPH_CRUSH_HIERARCHY: "{{ tripleo_ceph_spec_crush_hierarchy }}"
|
|
|
|
- name: Show debug information
|
|
when:
|
|
tripleo_ceph_spec_debug|bool
|
|
block:
|
|
- name: Show openstack overcloud ceph spec command
|
|
debug:
|
|
var: _deploy_cmd
|
|
|
|
- name: Show the openstack overcloud ceph spec environment
|
|
debug:
|
|
var: _deploy_env
|
|
|
|
- name: Write reproducer script
|
|
tripleo_shell_script:
|
|
dest: "{{ ansible_env.HOME }}/openstack_overcloud_ceph_spec.sh"
|
|
shell_command: "{{ _deploy_cmd }}"
|
|
shell_environment: "{{ _deploy_env }}"
|
|
when: tripleo_ceph_spec_generate_scripts|bool
|
|
|
|
- name: Generate Ceph Spec
|
|
shell: "{{ _deploy_cmd }}" # noqa 305
|
|
environment: "{{ _deploy_env }}"
|
|
args:
|
|
executable: /bin/bash
|
|
chdir: "{{ ansible_env.HOME }}"
|
|
warn: false
|
|
become: "{{ tripleo_ceph_spec_become }}"
|
|
register: tripleo_ceph_spec_result
|
|
async: "{{ tripleo_ceph_spec_timeout }}"
|
|
poll: "{{ tripleo_ceph_spec_poll }}"
|
|
changed_when: false
|
|
when:
|
|
- not ansible_check_mode|bool
|
|
- not tripleo_ceph_spec_generate_scripts_only|bool
|
|
|
|
- name: Set output fact
|
|
when:
|
|
- tripleo_ceph_spec_result.stdout is defined
|
|
set_fact:
|
|
tripleo_ceph_spec_output: "{{ tripleo_ceph_spec_result.stdout }}"
|