2019-07-24 16:39:47 +08:00
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- osds
|
|
|
|
- mdss
|
|
|
|
- rgws
|
|
|
|
- nfss
|
|
|
|
- rbdmirrors
|
|
|
|
- clients
|
|
|
|
- iscsigws
|
|
|
|
- mgrs
|
|
|
|
- grafana-server
|
|
|
|
|
|
|
|
gather_facts: false
|
|
|
|
become: True
|
|
|
|
any_errors_fatal: true
|
|
|
|
|
|
|
|
vars:
|
|
|
|
delegate_facts_host: True
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
- import_tasks: "{{ playbook_dir }}/../raw_install_python.yml"
|
|
|
|
|
|
|
|
tasks:
|
2019-11-28 21:01:13 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
2019-07-24 16:39:47 +08:00
|
|
|
# pre-tasks for following import -
|
|
|
|
- name: gather facts
|
|
|
|
setup:
|
2019-10-02 21:36:30 +08:00
|
|
|
when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
|
2019-07-24 16:39:47 +08:00
|
|
|
|
|
|
|
- name: gather and delegate facts
|
|
|
|
setup:
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
2019-11-28 22:12:59 +08:00
|
|
|
with_items: "{{ groups['all'] | difference(groups.get(client_group_name | default('clients'), [])) }}"
|
2019-07-24 16:39:47 +08:00
|
|
|
run_once: true
|
|
|
|
when: delegate_facts_host | bool
|
|
|
|
|
|
|
|
- hosts:
|
|
|
|
- "{{ mon_group_name | default('mons') }}"
|
|
|
|
- "{{ osd_group_name | default('osds') }}"
|
|
|
|
- "{{ mds_group_name | default('mdss') }}"
|
|
|
|
- "{{ rgw_group_name | default('rgws') }}"
|
|
|
|
- "{{ nfs_group_name | default('nfss') }}"
|
|
|
|
- "{{ mgr_group_name | default('mgrs') }}"
|
|
|
|
- "{{ iscsi_gw_group_name | default('iscsigws') }}"
|
|
|
|
- "{{ rbdmirror_group_name | default('rbdmirrors') }}"
|
|
|
|
become: true
|
|
|
|
pre_tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2019-12-02 16:47:21 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
2019-07-24 16:39:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
tasks:
|
2020-01-10 21:30:35 +08:00
|
|
|
- name: set_fact container_binary, container_binding_name, container_service_name, container_package_name
|
|
|
|
set_fact:
|
|
|
|
docker2podman: True
|
|
|
|
container_binary: podman
|
|
|
|
container_binding_name: podman
|
|
|
|
container_service_name: podman
|
|
|
|
container_package_name: podman
|
|
|
|
|
2020-01-10 18:17:27 +08:00
|
|
|
- name: install podman
|
|
|
|
package:
|
|
|
|
name: podman
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
tags:
|
|
|
|
- with_pkg
|
|
|
|
when: not is_atomic | bool
|
|
|
|
|
2019-07-24 16:39:47 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-mon
|
|
|
|
tasks_from: systemd.yml
|
|
|
|
when: inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-iscsi-gw
|
2019-09-30 15:21:41 +08:00
|
|
|
tasks_from: systemd.yml
|
2019-07-24 16:39:47 +08:00
|
|
|
when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-mds
|
|
|
|
tasks_from: systemd.yml
|
|
|
|
when: inventory_hostname in groups.get(mds_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-mgr
|
|
|
|
tasks_from: systemd.yml
|
|
|
|
when: inventory_hostname in groups.get(mgr_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-nfs
|
|
|
|
tasks_from: systemd.yml
|
|
|
|
when: inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
|
2020-04-01 20:20:05 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-osd
|
|
|
|
tasks_from: container_options_facts.yml
|
|
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
|
2019-07-24 16:39:47 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-osd
|
|
|
|
tasks_from: systemd.yml
|
|
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-rbd-mirror
|
2019-09-30 15:36:00 +08:00
|
|
|
tasks_from: systemd.yml
|
2019-07-24 16:39:47 +08:00
|
|
|
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-rgw
|
2019-09-30 15:40:56 +08:00
|
|
|
tasks_from: systemd.yml
|
2019-09-30 15:36:00 +08:00
|
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
2020-01-10 21:29:50 +08:00
|
|
|
|
|
|
|
- name: reload ceph monitor systemd unit
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|