mirror of https://github.com/ceph/ceph-ansible.git
fix calls to `container_exec_cmd` in ceph-osd role
We must call `container_exec_cmd` from the right monitor node otherwise
the value of the fact might mistmatch between the delegated node and the
node being played.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1794900
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 2f919f8971
)
pull/4997/head
parent
0a2927ce5e
commit
0d2af6ebf3
|
@ -12,7 +12,7 @@
|
||||||
- /var/lib/ceph/osd/
|
- /var/lib/ceph/osd/
|
||||||
|
|
||||||
- name: get keys from monitors
|
- 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: _osd_keys
|
register: _osd_keys
|
||||||
with_items:
|
with_items:
|
||||||
- { name: "client.bootstrap-osd", path: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
|
- { name: "client.bootstrap-osd", path: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
include_tasks: common.yml
|
include_tasks: common.yml
|
||||||
|
|
||||||
- name: set noup flag
|
- 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] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
@ -65,7 +65,7 @@
|
||||||
include_tasks: start_osds.yml
|
include_tasks: start_osds.yml
|
||||||
|
|
||||||
- name: unset noup flag
|
- 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] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
changed_when: False
|
changed_when: False
|
||||||
when:
|
when:
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
- inventory_hostname == ansible_play_hosts_all | last
|
- inventory_hostname == ansible_play_hosts_all | last
|
||||||
|
|
||||||
- name: wait for all osd to be up
|
- 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
|
register: wait_for_all_osds_up
|
||||||
retries: "{{ nb_retry_wait_osd_up }}"
|
retries: "{{ nb_retry_wait_osd_up }}"
|
||||||
delay: "{{ delay_wait_osd_up }}"
|
delay: "{{ delay_wait_osd_up }}"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
block:
|
block:
|
||||||
- name: list existing pool(s)
|
- name: list existing pool(s)
|
||||||
command: >
|
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
|
osd pool get {{ item.name }} size
|
||||||
with_items: "{{ openstack_pools | unique }}"
|
with_items: "{{ openstack_pools | unique }}"
|
||||||
register: created_pools
|
register: created_pools
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
- name: create openstack pool(s)
|
- name: create openstack pool(s)
|
||||||
command: >
|
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 }}
|
osd pool create {{ item.0.name }}
|
||||||
{{ item.0.pg_num | default(osd_pool_default_pg_num) }}
|
{{ 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) }}
|
{{ item.0.pgp_num | default(item.0.pg_num) | default(osd_pool_default_pg_num) }}
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
- name: customize pool size
|
- name: customize pool size
|
||||||
command: >
|
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) }}
|
osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }}
|
||||||
with_items: "{{ openstack_pools | unique }}"
|
with_items: "{{ openstack_pools | unique }}"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
- name: customize pool min_size
|
- name: customize pool min_size
|
||||||
command: >
|
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) }}
|
osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}
|
||||||
with_items: "{{ openstack_pools | unique }}"
|
with_items: "{{ openstack_pools | unique }}"
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
|
when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
|
||||||
|
|
||||||
- name: assign application to pool(s)
|
- 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 }}"
|
with_items: "{{ openstack_pools | unique }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||||
|
|
||||||
- name: get keys from monitors
|
- 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
|
register: _osp_keys
|
||||||
with_items: "{{ openstack_keys }}"
|
with_items: "{{ openstack_keys }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
Loading…
Reference in New Issue