2017-02-02 00:18:17 +08:00
|
|
|
---
|
|
|
|
- include: system_checks.yml
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
- name: check if it is atomic host
|
|
|
|
stat: path=/run/ostree-booted
|
|
|
|
register: stat_ostree
|
|
|
|
always_run: true
|
|
|
|
|
|
|
|
- name: set fact for using atomic host
|
|
|
|
set_fact:
|
|
|
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
|
|
|
|
|
|
|
- include: ./pre_requisites/prerequisites.yml
|
|
|
|
when: not is_atomic
|
2017-02-24 17:22:16 +08:00
|
|
|
|
|
|
|
# NOTE(guits): would be nice to refact this block with L39-45 in roles/ceph-common/tasks/facts.yml
|
|
|
|
- set_fact:
|
|
|
|
monitor_name: "{{ ansible_hostname }}"
|
|
|
|
when: not mon_use_fqdn
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
monitor_name: "{{ ansible_fqdn }}"
|
|
|
|
when: mon_use_fqdn
|
2017-04-13 01:57:33 +08:00
|
|
|
|
|
|
|
- name: check if a cluster is already running
|
|
|
|
command: "docker ps -q -a --filter='ancestor={{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'"
|
|
|
|
register: ceph_health
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
always_run: true
|
|
|
|
|
|
|
|
# Only include 'checks.yml' when :
|
|
|
|
# we are deploying containers without kv AND host is either a mon OR a nfs OR an osd,
|
|
|
|
# AND
|
|
|
|
# a cluster is not already running,
|
|
|
|
# AND
|
|
|
|
# we are not playing rolling-update.yml playbook.
|
|
|
|
- include: checks.yml
|
|
|
|
when:
|
|
|
|
- (not containerized_deployment_with_kv and
|
|
|
|
((inventory_hostname in groups.get(mon_group_name, [])) or
|
|
|
|
(inventory_hostname in groups.get(nfs_group_name, [])) or
|
|
|
|
(inventory_hostname in groups.get(osd_group_name, []))))
|
|
|
|
- ceph_health.rc != 0
|
|
|
|
- not "{{ rolling_update | default(false) }}"
|
|
|
|
|
|
|
|
- include: "./misc/ntp_atomic.yml"
|
|
|
|
when:
|
|
|
|
- is_atomic
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
|
|
|
- include: "./misc/ntp_redhat.yml"
|
|
|
|
when:
|
|
|
|
- not is_atomic
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
|
|
|
- include: "./misc/ntp_debian.yml"
|
|
|
|
when:
|
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
|
|
|
- include: "./fetch_image.yml"
|
|
|
|
|
|
|
|
# NOTE (jimcurtis): dirs_permissions.yml must precede fetch_configs.yml
|
|
|
|
# # because it creates the directories needed by the latter.
|
|
|
|
- include: ./dirs_permissions.yml
|
|
|
|
|
|
|
|
- include: create_configs.yml
|
|
|
|
|
|
|
|
# Only include 'fetch_configs.yml' when:
|
|
|
|
# - we are deploying containers without kv AND host is either a mon OR a nfs OR an osd
|
|
|
|
# OR
|
|
|
|
# - host is either a mdss OR mgrs OR rgws
|
|
|
|
- include: fetch_configs.yml
|
|
|
|
when:
|
|
|
|
- (not containerized_deployment_with_kv and
|
|
|
|
((inventory_hostname in groups.get(mon_group_name, [])) or
|
|
|
|
(inventory_hostname in groups.get(nfs_group_name, [])) or
|
|
|
|
(inventory_hostname in groups.get(osd_group_name, [])))) or
|
|
|
|
(inventory_hostname in groups.get('mdss', [])) or
|
|
|
|
(inventory_hostname in groups.get('mgrs', [])) or
|
|
|
|
(inventory_hostname in groups.get('rgws', []))
|
|
|
|
|
|
|
|
- include: selinux.yml
|
2017-06-26 21:28:30 +08:00
|
|
|
when: ansible_os_family == 'RedHat'
|