2017-02-02 00:18:17 +08:00
|
|
|
---
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include system_checks.yml
|
|
|
|
include: system_checks.yml
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
- name: check if it is atomic host
|
2017-09-15 06:48:53 +08:00
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
2017-02-22 00:58:24 +08:00
|
|
|
register: stat_ostree
|
|
|
|
always_run: true
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact is_atomic
|
2017-02-22 00:58:24 +08:00
|
|
|
set_fact:
|
|
|
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include pre_requisites/prerequisites.yml
|
|
|
|
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
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact monitor_name ansible_hostname
|
|
|
|
set_fact:
|
2017-02-24 17:22:16 +08:00
|
|
|
monitor_name: "{{ ansible_hostname }}"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- not mon_use_fqdn
|
2017-02-24 17:22:16 +08:00
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact monitor_name ansible_fqdn
|
|
|
|
set_fact:
|
2017-02-24 17:22:16 +08:00
|
|
|
monitor_name: "{{ ansible_fqdn }}"
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- mon_use_fqdn
|
2017-04-13 01:57:33 +08:00
|
|
|
|
2017-09-06 16:53:30 +08:00
|
|
|
- name: get docker version
|
|
|
|
command: docker --version
|
|
|
|
changed_when: false
|
|
|
|
always_run: yes
|
|
|
|
register: docker_version
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact docker_version docker_version.stdout.split
|
|
|
|
set_fact:
|
2017-09-06 16:53:30 +08:00
|
|
|
docker_version: "{{ docker_version.stdout.split(' ')[2] }}"
|
|
|
|
|
2017-04-13 01:57:33 +08:00
|
|
|
# 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.
|
2017-09-19 01:04:05 +08:00
|
|
|
- name: check if a cluster is already running
|
2017-09-28 05:34:30 +08:00
|
|
|
command: "docker ps -q --filter='name=ceph-mon-{{ ansible_hostname }}'"
|
2017-09-19 01:04:05 +08:00
|
|
|
register: ceph_health
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
always_run: true
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include checks.yml
|
|
|
|
include: checks.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
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, []))))
|
2017-09-19 01:04:05 +08:00
|
|
|
- ceph_health.stdout_lines | length == 0
|
|
|
|
- not rolling_update | default(false)
|
2017-04-13 01:57:33 +08:00
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include misc/ntp_atomic.yml
|
|
|
|
include: misc/ntp_atomic.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
when:
|
|
|
|
- is_atomic
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include misc/ntp_redhat.yml
|
|
|
|
include: misc/ntp_redhat.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include misc/ntp_debian.yml
|
|
|
|
include: misc/ntp_debian.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == 'Debian'
|
|
|
|
- ntp_service_enabled
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include fetch_image.yml
|
|
|
|
include: fetch_image.yml
|
2017-08-29 05:23:36 +08:00
|
|
|
|
|
|
|
- name: get ceph version
|
|
|
|
command: docker run --entrypoint /usr/bin/ceph {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --version
|
|
|
|
changed_when: false
|
|
|
|
always_run: yes
|
|
|
|
register: ceph_version
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact ceph_version ceph_version.stdout.split
|
|
|
|
set_fact:
|
2017-08-29 05:23:36 +08:00
|
|
|
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include release.yml
|
|
|
|
include: release.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
|
|
|
|
# NOTE (jimcurtis): dirs_permissions.yml must precede fetch_configs.yml
|
|
|
|
# # because it creates the directories needed by the latter.
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include dirs_permissions.yml
|
|
|
|
include: dirs_permissions.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include selinux.yml
|
|
|
|
include: selinux.yml
|
|
|
|
when:
|
|
|
|
- ansible_os_family == 'RedHat'
|