mirror of https://github.com/ceph/ceph-ansible.git
196 lines
6.1 KiB
YAML
196 lines
6.1 KiB
YAML
- 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:
|
|
- import_role:
|
|
name: ceph-defaults
|
|
|
|
# pre-tasks for following import -
|
|
- name: gather facts
|
|
setup:
|
|
when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
|
|
|
|
- name: gather and delegate facts
|
|
setup:
|
|
delegate_to: "{{ item }}"
|
|
delegate_facts: True
|
|
with_items: "{{ groups['all'] | difference(groups.get(client_group_name | default('clients'), [])) }}"
|
|
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') }}"
|
|
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
|
gather_facts: false
|
|
become: true
|
|
tasks:
|
|
- import_role:
|
|
name: ceph-defaults
|
|
- import_role:
|
|
name: ceph-facts
|
|
- import_role:
|
|
name: ceph-handler
|
|
|
|
- name: with docker configuration
|
|
when: container_binary == 'docker'
|
|
block:
|
|
- name: get docker version
|
|
command: docker --version
|
|
changed_when: false
|
|
check_mode: no
|
|
register: ceph_docker_version
|
|
|
|
- name: set_fact ceph_docker_version ceph_docker_version.stdout.split
|
|
set_fact:
|
|
ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
|
|
|
|
- name: set_fact docker2podman and container_binary
|
|
set_fact:
|
|
docker2podman: True
|
|
container_binary: podman
|
|
|
|
- name: install podman
|
|
package:
|
|
name: podman
|
|
state: present
|
|
register: result
|
|
until: result is succeeded
|
|
tags: with_pkg
|
|
when: not is_atomic | bool
|
|
|
|
- name: "pulling {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image from docker daemon"
|
|
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
|
changed_when: false
|
|
register: pull_image
|
|
until: pull_image.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
when: inventory_hostname in groups.get(mon_group_name, []) or
|
|
inventory_hostname in groups.get(osd_group_name, []) or
|
|
inventory_hostname in groups.get(mds_group_name, []) or
|
|
inventory_hostname in groups.get(rgw_group_name, []) or
|
|
inventory_hostname in groups.get(mgr_group_name, []) or
|
|
inventory_hostname in groups.get(rbdmirror_group_name, []) or
|
|
inventory_hostname in groups.get(iscsi_gw_group_name, []) or
|
|
inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
- name: "pulling alertmanager/grafana/prometheus images from docker daemon"
|
|
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ item }}"
|
|
changed_when: false
|
|
register: pull_image
|
|
until: pull_image.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
loop:
|
|
- "{{ alertmanager_container_image }}"
|
|
- "{{ grafana_container_image }}"
|
|
- "{{ prometheus_container_image }}"
|
|
when:
|
|
- dashboard_enabled | bool
|
|
- inventory_hostname in groups.get(grafana_server_group_name, [])
|
|
|
|
- name: "pulling {{ node_exporter_container_image }} image from docker daemon"
|
|
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ node_exporter_container_image }}"
|
|
changed_when: false
|
|
register: pull_image
|
|
until: pull_image.rc == 0
|
|
retries: "{{ docker_pull_retry }}"
|
|
delay: 10
|
|
when: dashboard_enabled | bool
|
|
|
|
- import_role:
|
|
name: ceph-mon
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(mon_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-iscsi-gw
|
|
tasks_from: systemd.yml
|
|
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, [])
|
|
|
|
- import_role:
|
|
name: ceph-osd
|
|
tasks_from: container_options_facts.yml
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-osd
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(osd_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-rbd-mirror
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(rbdmirror_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-rgw
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
- name: dashboard configuration
|
|
when: dashboard_enabled | bool
|
|
block:
|
|
- import_role:
|
|
name: ceph-node-exporter
|
|
tasks_from: systemd.yml
|
|
|
|
- import_role:
|
|
name: ceph-facts
|
|
tasks_from: grafana.yml
|
|
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-grafana
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
|
|
|
- import_role:
|
|
name: ceph-prometheus
|
|
tasks_from: systemd.yml
|
|
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
|
|
|
- name: reload systemd daemon
|
|
systemd:
|
|
daemon_reload: yes |