include_tasks: common.yml
- name: set noup flag
- command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup"
+ command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd set noup"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: True
changed_when: False
include_tasks: start_osds.yml
- name: unset noup flag
- command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+ command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd unset noup"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: False
when:
- inventory_hostname == ansible_play_hosts_all | last
- name: wait for all osd to be up
- command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s -f json"
+ command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} -s -f json"
register: wait_for_all_osds_up
retries: "{{ nb_retry_wait_osd_up }}"
delay: "{{ delay_wait_osd_up }}"
block:
- name: list existing pool(s)
command: >
- {{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }}
+ {{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }}
osd pool get {{ item.name }} size
with_items: "{{ openstack_pools | unique }}"
register: created_pools
- name: create openstack pool(s)
command: >
- {{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }}
+ {{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }}
osd pool create {{ item.0.name }}
{{ item.0.pg_num | default(osd_pool_default_pg_num) }}
{{ item.0.pgp_num | default(item.0.pg_num) | default(osd_pool_default_pg_num) }}
- name: customize pool size
command: >
- {{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }}
+ {{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }}
osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }}
with_items: "{{ openstack_pools | unique }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
- name: customize pool min_size
command: >
- {{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }}
+ {{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }}
osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}
with_items: "{{ openstack_pools | unique }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
- name: assign application to pool(s)
- command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"
+ command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"
with_items: "{{ openstack_pools | unique }}"
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
- name: get keys from monitors
- command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
+ command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
register: _osp_keys
with_items: "{{ openstack_keys }}"
run_once: true