2016-04-27 21:17:56 +08:00
|
|
|
---
|
2018-03-21 03:13:28 +08:00
|
|
|
- name: check if it is atomic host
|
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
|
|
|
register: stat_ostree
|
|
|
|
|
|
|
|
- name: set_fact is_atomic
|
|
|
|
set_fact:
|
|
|
|
is_atomic: "{{ stat_ostree.stat.exists }}"
|
|
|
|
|
2019-11-26 23:10:17 +08:00
|
|
|
- name: import_tasks container_binary.yml
|
|
|
|
import_tasks: container_binary.yml
|
2018-11-08 17:02:37 +08:00
|
|
|
|
2019-08-22 23:46:05 +08:00
|
|
|
# In case ansible_python_interpreter is set by the user,
|
2019-09-04 15:56:10 +08:00
|
|
|
# ansible will not discover python and discovered_interpreter_python
|
2019-08-22 23:46:05 +08:00
|
|
|
# will not be set
|
2019-09-04 15:56:10 +08:00
|
|
|
- name: set_fact discovered_interpreter_python
|
2019-08-22 23:46:05 +08:00
|
|
|
set_fact:
|
2019-09-04 15:56:10 +08:00
|
|
|
discovered_interpreter_python: "{{ ansible_python_interpreter }}"
|
2019-08-22 23:46:05 +08:00
|
|
|
when: ansible_python_interpreter is defined
|
|
|
|
|
2021-03-11 23:43:53 +08:00
|
|
|
# If ansible_python_interpreter is not defined, this can result in the
|
|
|
|
# discovered_interpreter_python fact from being set. This fails later in this
|
|
|
|
# playbook and is used elsewhere.
|
|
|
|
- name: set_fact discovered_interpreter_python if not previously set
|
|
|
|
set_fact:
|
|
|
|
discovered_interpreter_python: "{{ ansible_facts['discovered_interpreter_python'] }}"
|
|
|
|
when:
|
|
|
|
- discovered_interpreter_python is not defined
|
|
|
|
- ansible_facts['discovered_interpreter_python'] is defined
|
|
|
|
|
2019-01-08 17:57:51 +08:00
|
|
|
# Set ceph_release to ceph_stable by default
|
|
|
|
- name: set_fact ceph_release ceph_stable_release
|
|
|
|
set_fact:
|
|
|
|
ceph_release: "{{ ceph_stable_release }}"
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact monitor_name ansible_hostname
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
monitor_name: "{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
2020-04-09 20:48:53 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: true
|
|
|
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
|
|
|
run_once: true
|
|
|
|
when: groups.get(mon_group_name, []) | length > 0
|
2016-04-27 21:17:56 +08:00
|
|
|
|
2020-01-13 22:30:13 +08:00
|
|
|
- name: find a running monitor
|
|
|
|
when: groups.get(mon_group_name, []) | length > 0
|
|
|
|
block:
|
|
|
|
- name: set_fact container_exec_cmd
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] if not rolling_update | bool else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_facts']['hostname'] }}"
|
2020-01-13 22:30:13 +08:00
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
|
|
|
|
- name: find a running mon container
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ container_binary }} ps -q --filter name=ceph-mon-{{ hostvars[item]['ansible_facts']['hostname'] }}"
|
2020-01-13 22:30:13 +08:00
|
|
|
register: find_running_mon_container
|
|
|
|
failed_when: false
|
|
|
|
run_once: true
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
|
|
|
|
- name: check for a ceph mon socket
|
|
|
|
shell: stat --printf=%n {{ rbd_client_admin_socket_path }}/{{ cluster }}-mon*.asok
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
|
|
|
register: mon_socket_stat
|
|
|
|
run_once: true
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
with_items: "{{ groups.get(mon_group_name, []) }}"
|
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
|
|
|
|
- name: check if the ceph mon socket is in-use
|
|
|
|
command: grep -q {{ item.stdout }} /proc/net/unix
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
|
|
|
register: mon_socket
|
|
|
|
run_once: true
|
2020-09-28 01:04:14 +08:00
|
|
|
delegate_to: "{{ hostvars[item.item]['inventory_hostname'] }}"
|
2020-01-13 22:30:13 +08:00
|
|
|
with_items: "{{ mon_socket_stat.results }}"
|
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
- item.rc == 0
|
|
|
|
|
|
|
|
- name: set_fact running_mon - non_container
|
|
|
|
set_fact:
|
|
|
|
running_mon: "{{ hostvars[item.item.item]['inventory_hostname'] }}"
|
|
|
|
with_items: "{{ mon_socket.results }}"
|
|
|
|
run_once: true
|
|
|
|
when:
|
|
|
|
- not containerized_deployment | bool
|
|
|
|
- item.rc is defined
|
2020-01-23 16:58:18 +08:00
|
|
|
- item.rc == 0
|
2020-01-13 22:30:13 +08:00
|
|
|
|
|
|
|
- name: set_fact running_mon - container
|
|
|
|
set_fact:
|
|
|
|
running_mon: "{{ item.item }}"
|
|
|
|
run_once: true
|
|
|
|
with_items: "{{ find_running_mon_container.results }}"
|
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
- item.stdout_lines | default([]) | length > 0
|
|
|
|
|
|
|
|
- name: set_fact _container_exec_cmd
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
_container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0] if running_mon is undefined else running_mon]['ansible_facts']['hostname'] }}"
|
2020-01-13 22:30:13 +08:00
|
|
|
when:
|
|
|
|
- containerized_deployment | bool
|
|
|
|
|
|
|
|
# this task shouldn't run in a rolling_update situation
|
|
|
|
# because it blindly picks a mon, which may be down because
|
|
|
|
# of the rolling update
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: get current fsid if cluster is already running
|
|
|
|
command: "{{ timeout_command }} {{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fsid"
|
2020-01-13 22:30:13 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2020-08-17 16:31:11 +08:00
|
|
|
register: current_fsid
|
2020-01-13 22:30:13 +08:00
|
|
|
run_once: true
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] if running_mon is undefined else running_mon }}"
|
|
|
|
when:
|
|
|
|
- not rolling_update | bool
|
2017-02-18 04:29:45 +08:00
|
|
|
|
|
|
|
# set this as a default when performing a rolling_update
|
|
|
|
# so the rest of the tasks here will succeed
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: set_fact current_fsid rc 1
|
2017-09-15 06:48:53 +08:00
|
|
|
set_fact:
|
2020-08-17 16:31:11 +08:00
|
|
|
current_fsid:
|
2017-02-18 04:29:45 +08:00
|
|
|
rc: 1
|
2020-09-26 00:15:02 +08:00
|
|
|
when: rolling_update | bool or groups.get(mon_group_name, []) | length == 0
|
2016-12-06 22:59:49 +08:00
|
|
|
|
2019-03-21 01:34:47 +08:00
|
|
|
- name: get current fsid
|
2021-03-03 22:43:50 +08:00
|
|
|
command: "{{ timeout_command }} {{ container_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_facts']['hostname'] }}.asok config get fsid"
|
2019-03-21 01:34:47 +08:00
|
|
|
register: rolling_update_fsid
|
|
|
|
delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
|
2019-06-20 20:45:07 +08:00
|
|
|
until: rolling_update_fsid is succeeded
|
2020-09-10 22:12:13 +08:00
|
|
|
when:
|
|
|
|
- rolling_update | bool
|
|
|
|
- groups.get(mon_group_name, []) | length > 0
|
2019-03-21 01:34:47 +08:00
|
|
|
|
|
|
|
- name: set_fact fsid
|
|
|
|
set_fact:
|
|
|
|
fsid: "{{ (rolling_update_fsid.stdout | from_json).fsid }}"
|
2020-09-10 22:12:13 +08:00
|
|
|
when:
|
|
|
|
- rolling_update | bool
|
|
|
|
- groups.get(mon_group_name, []) | length > 0
|
2019-03-21 01:34:47 +08:00
|
|
|
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: set_fact fsid from current_fsid
|
2018-08-22 02:50:31 +08:00
|
|
|
set_fact:
|
2020-08-17 16:31:11 +08:00
|
|
|
fsid: "{{ current_fsid.stdout }}"
|
|
|
|
run_once: true
|
|
|
|
when: current_fsid.rc == 0
|
2016-12-06 22:59:49 +08:00
|
|
|
|
2019-08-22 23:39:47 +08:00
|
|
|
- name: fsid related tasks
|
2019-03-28 16:13:30 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- generate_fsid | bool
|
2020-08-17 16:31:11 +08:00
|
|
|
- current_fsid.rc != 0
|
2019-05-22 16:02:42 +08:00
|
|
|
- not rolling_update | bool
|
2019-03-28 16:13:30 +08:00
|
|
|
block:
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: generate cluster fsid
|
|
|
|
command: "{{ hostvars[groups[mon_group_name][0]]['discovered_interpreter_python'] }} -c 'import uuid; print(str(uuid.uuid4()))'"
|
|
|
|
register: cluster_uuid
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
run_once: true
|
2016-12-08 23:58:22 +08:00
|
|
|
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: set_fact fsid
|
|
|
|
set_fact:
|
|
|
|
fsid: "{{ cluster_uuid.stdout }}"
|
2016-12-08 23:58:22 +08:00
|
|
|
|
2017-09-28 06:17:12 +08:00
|
|
|
- name: resolve device link(s)
|
|
|
|
command: readlink -f {{ item }}
|
|
|
|
changed_when: false
|
2019-05-06 16:14:36 +08:00
|
|
|
check_mode: no
|
2017-09-28 06:17:12 +08:00
|
|
|
with_items: "{{ devices }}"
|
|
|
|
register: devices_prepare_canonicalize
|
|
|
|
when:
|
2018-05-02 00:22:31 +08:00
|
|
|
- devices is defined
|
2017-09-28 06:17:12 +08:00
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2019-05-22 16:02:42 +08:00
|
|
|
- not osd_auto_discovery | default(False) | bool
|
2017-09-28 06:17:12 +08:00
|
|
|
|
|
|
|
- name: set_fact build devices from resolved symlinks
|
|
|
|
set_fact:
|
|
|
|
devices: "{{ devices | default([]) + [ item.stdout ] }}"
|
|
|
|
with_items: "{{ devices_prepare_canonicalize.results }}"
|
|
|
|
when:
|
2018-05-02 00:22:31 +08:00
|
|
|
- devices is defined
|
2017-09-28 06:17:12 +08:00
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2019-05-22 16:02:42 +08:00
|
|
|
- not osd_auto_discovery | default(False) | bool
|
2017-09-28 06:17:12 +08:00
|
|
|
|
|
|
|
- name: set_fact build final devices list
|
|
|
|
set_fact:
|
|
|
|
devices: "{{ devices | reject('search','/dev/disk') | list | unique }}"
|
|
|
|
when:
|
2018-05-02 00:22:31 +08:00
|
|
|
- devices is defined
|
2017-09-28 06:17:12 +08:00
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2019-05-22 16:02:42 +08:00
|
|
|
- not osd_auto_discovery | default(False) | bool
|
2017-11-23 05:38:30 +08:00
|
|
|
|
2020-07-23 21:36:01 +08:00
|
|
|
- name: resolve dedicated_device link(s)
|
|
|
|
command: readlink -f {{ item }}
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
|
|
|
with_items: "{{ dedicated_devices }}"
|
|
|
|
register: dedicated_devices_prepare_canonicalize
|
|
|
|
when:
|
|
|
|
- dedicated_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
|
|
|
- name: set_fact build dedicated_devices from resolved symlinks
|
|
|
|
set_fact:
|
|
|
|
dedicated_devices: "{{ dedicated_devices | default([]) + [ item.stdout ] }}"
|
|
|
|
with_items: "{{ dedicated_devices_prepare_canonicalize.results }}"
|
|
|
|
when:
|
|
|
|
- dedicated_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
|
|
|
- name: set_fact build final dedicated_devices list
|
|
|
|
set_fact:
|
|
|
|
dedicated_devices: "{{ dedicated_devices | reject('search','/dev/disk') | list | unique }}"
|
|
|
|
when:
|
|
|
|
- dedicated_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
|
|
|
- name: resolve bluestore_wal_device link(s)
|
|
|
|
command: readlink -f {{ item }}
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
|
|
|
with_items: "{{ bluestore_wal_devices }}"
|
|
|
|
register: bluestore_wal_devices_prepare_canonicalize
|
|
|
|
when:
|
|
|
|
- bluestore_wal_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
|
|
|
- name: set_fact build bluestore_wal_devices from resolved symlinks
|
|
|
|
set_fact:
|
|
|
|
bluestore_wal_devices: "{{ bluestore_wal_devices | default([]) + [ item.stdout ] }}"
|
|
|
|
with_items: "{{ bluestore_wal_devices_prepare_canonicalize.results }}"
|
|
|
|
when:
|
|
|
|
- bluestore_wal_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
|
|
|
- name: set_fact build final bluestore_wal_devices list
|
|
|
|
set_fact:
|
|
|
|
bluestore_wal_devices: "{{ bluestore_wal_devices | reject('search','/dev/disk') | list | unique }}"
|
|
|
|
when:
|
|
|
|
- bluestore_wal_devices is defined
|
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- not osd_auto_discovery | default(False) | bool
|
|
|
|
|
2019-01-11 01:26:19 +08:00
|
|
|
- name: set_fact devices generate device list when osd_auto_discovery
|
|
|
|
set_fact:
|
2019-11-20 18:02:49 +08:00
|
|
|
devices: "{{ (devices | default([]) + [ item.key | regex_replace('^', '/dev/') ]) | unique }}"
|
2021-03-03 22:43:50 +08:00
|
|
|
with_dict: "{{ ansible_facts['devices'] }}"
|
2019-01-11 01:26:19 +08:00
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- osd_auto_discovery | default(False) | bool
|
2020-01-17 03:03:09 +08:00
|
|
|
- inventory_hostname in groups.get(osd_group_name, [])
|
2021-03-03 22:43:50 +08:00
|
|
|
- ansible_facts['devices'] is defined
|
2019-01-11 01:26:19 +08:00
|
|
|
- item.value.removable == "0"
|
|
|
|
- item.value.sectors != "0"
|
|
|
|
- item.value.partitions|count == 0
|
|
|
|
- item.value.holders|count == 0
|
2019-02-26 07:07:01 +08:00
|
|
|
- item.key is not match osd_auto_discovery_exclude
|
2019-01-11 01:26:19 +08:00
|
|
|
|
2020-08-17 16:31:11 +08:00
|
|
|
- name: backward compatibility tasks related
|
2018-08-22 02:50:31 +08:00
|
|
|
when:
|
2021-03-16 21:13:13 +08:00
|
|
|
- (inventory_hostname in groups.get(rgw_group_name, []) or inventory_hostname in groups.get(nfs_group_name, []))
|
|
|
|
- groups.get(mon_group_name, []) | length > 0
|
2020-08-17 16:31:11 +08:00
|
|
|
block:
|
|
|
|
- name: get ceph current status
|
2020-10-27 05:49:47 +08:00
|
|
|
command: "{{ timeout_command }} {{ _container_exec_cmd | default('') }} ceph --cluster {{ cluster }} service dump -f json"
|
2020-08-17 16:31:11 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
|
|
|
register: ceph_current_status
|
|
|
|
run_once: true
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] if running_mon is undefined else running_mon }}"
|
|
|
|
|
|
|
|
- name: set_fact ceph_current_status
|
|
|
|
set_fact:
|
|
|
|
ceph_current_status: "{{ ceph_current_status.stdout | from_json }}"
|
|
|
|
run_once: true
|
|
|
|
when: ceph_current_status.rc == 0
|
|
|
|
|
|
|
|
- name: set_fact rgw_hostname
|
|
|
|
set_fact:
|
2021-03-03 22:43:50 +08:00
|
|
|
rgw_hostname: "{% set _value = ansible_facts['hostname'] -%}
|
2020-10-27 05:49:47 +08:00
|
|
|
{% for key in (ceph_current_status['services']['rgw']['daemons'] | list) -%}
|
2021-03-03 22:43:50 +08:00
|
|
|
{% if key == ansible_facts['fqdn'] -%}
|
2020-08-17 16:31:11 +08:00
|
|
|
{% set _value = key -%}
|
|
|
|
{% endif -%}
|
|
|
|
{% endfor -%}
|
|
|
|
{{ _value }}"
|
|
|
|
when:
|
2020-10-27 05:49:47 +08:00
|
|
|
- ceph_current_status['services'] is defined
|
|
|
|
- ceph_current_status['services']['rgw'] is defined
|
2018-10-03 22:09:33 +08:00
|
|
|
|
2019-03-08 06:14:12 +08:00
|
|
|
- name: check if the ceph conf exists
|
|
|
|
stat:
|
|
|
|
path: '/etc/ceph/{{ cluster }}.conf'
|
|
|
|
register: ceph_conf
|
|
|
|
|
2020-10-07 15:44:29 +08:00
|
|
|
- name: set default osd_pool_default_crush_rule fact
|
|
|
|
set_fact:
|
|
|
|
osd_pool_default_crush_rule: "{{ ceph_osd_pool_default_crush_rule }}"
|
|
|
|
|
2019-03-08 06:14:12 +08:00
|
|
|
- name: get default crush rule value from ceph configuration
|
2020-10-07 15:44:29 +08:00
|
|
|
block:
|
|
|
|
- &read-osd-pool-default-crush-rule
|
|
|
|
name: read osd pool default crush rule
|
|
|
|
command: grep 'osd pool default crush rule' /etc/ceph/{{ cluster }}.conf
|
|
|
|
register: crush_rule_variable
|
|
|
|
changed_when: false
|
|
|
|
check_mode: no
|
|
|
|
failed_when: crush_rule_variable.rc not in (0, 1)
|
|
|
|
- &set-osd-pool-default-crush-rule-fact
|
|
|
|
name: set osd_pool_default_crush_rule fact
|
|
|
|
set_fact:
|
|
|
|
osd_pool_default_crush_rule: "{{ crush_rule_variable.stdout.split(' = ')[1] }}"
|
|
|
|
when: crush_rule_variable.rc == 0
|
2020-09-28 01:11:07 +08:00
|
|
|
when: ceph_conf.stat.exists | bool
|
|
|
|
|
|
|
|
- name: get default crush rule value from running monitor ceph configuration
|
2020-10-07 15:44:29 +08:00
|
|
|
block:
|
|
|
|
- <<: *read-osd-pool-default-crush-rule
|
|
|
|
delegate_to: "{{ running_mon }}"
|
|
|
|
- *set-osd-pool-default-crush-rule-fact
|
2020-09-28 01:11:07 +08:00
|
|
|
when:
|
|
|
|
- running_mon is defined
|
|
|
|
- not ceph_conf.stat.exists | bool
|
2019-03-08 06:14:12 +08:00
|
|
|
|
2018-10-03 22:09:33 +08:00
|
|
|
- name: import_tasks set_monitor_address.yml
|
|
|
|
import_tasks: set_monitor_address.yml
|
2019-05-07 22:42:49 +08:00
|
|
|
when: groups.get(mon_group_name, []) | length > 0
|
2018-10-03 22:09:33 +08:00
|
|
|
|
|
|
|
- name: import_tasks set_radosgw_address.yml
|
|
|
|
import_tasks: set_radosgw_address.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
2018-11-09 08:56:57 +08:00
|
|
|
|
2019-07-02 21:30:12 +08:00
|
|
|
- name: set_fact use_new_ceph_iscsi package or old ceph-iscsi-config/cli
|
|
|
|
set_fact:
|
2019-08-22 23:39:47 +08:00
|
|
|
use_new_ceph_iscsi: "{{ (gateway_ip_list == '0.0.0.0' and gateway_iqn | length == 0 and client_connections | length == 0 and rbd_devices | length == 0) | bool | ternary(true, false) }}"
|
2019-12-11 05:35:34 +08:00
|
|
|
when: iscsi_gw_group_name in group_names
|
2020-03-27 23:21:09 +08:00
|
|
|
|
2020-04-10 07:02:06 +08:00
|
|
|
- name: set_fact ceph_run_cmd
|
|
|
|
set_fact:
|
2020-09-26 00:15:02 +08:00
|
|
|
ceph_run_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }}"
|
2020-05-14 17:06:41 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
|
|
|
run_once: True
|
|
|
|
with_items:
|
|
|
|
- "{{ groups[mon_group_name] if groups[mon_group_name] | default([]) | length > 0 else [] }}"
|
2020-07-13 15:42:25 +08:00
|
|
|
- "{{ groups[mds_group_name] if groups[mds_group_name] | default([]) | length > 0 else [] }}"
|
|
|
|
- "{{ groups[client_group_name] if groups[client_group_name] | default([]) | length > 0 else [] }}"
|
2020-04-10 07:02:06 +08:00
|
|
|
|
2020-03-27 23:21:09 +08:00
|
|
|
- name: set_fact ceph_admin_command
|
|
|
|
set_fact:
|
2020-07-13 15:42:25 +08:00
|
|
|
ceph_admin_command: "{{ hostvars[item]['ceph_run_cmd'] }} -n client.admin -k /etc/ceph/{{ cluster }}.client.admin.keyring"
|
2020-05-14 17:06:41 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
|
|
|
run_once: True
|
|
|
|
with_items:
|
|
|
|
- "{{ groups[mon_group_name] if groups[mon_group_name] | default([]) | length > 0 else [] }}"
|
2020-07-13 15:42:25 +08:00
|
|
|
- "{{ groups[mds_group_name] if groups[mds_group_name] | default([]) | length > 0 else [] }}"
|
2020-10-07 15:44:29 +08:00
|
|
|
- "{{ groups[client_group_name] if groups[client_group_name] | default([]) | length > 0 else [] }}"
|