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
|
|
|
|
2017-10-19 00:03:30 +08:00
|
|
|
- name: include check_mandatory_vars.yml
|
|
|
|
include: check_mandatory_vars.yml
|
|
|
|
|
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
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-12-12 18:06:15 +08:00
|
|
|
register: ceph_docker_version
|
2017-09-06 16:53:30 +08:00
|
|
|
|
2017-12-12 18:06:15 +08:00
|
|
|
- name: set_fact ceph_docker_version ceph_docker_version.stdout.split
|
2017-09-15 06:48:53 +08:00
|
|
|
set_fact:
|
2017-12-12 18:06:15 +08:00
|
|
|
ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
|
2017-09-06 16:53:30 +08:00
|
|
|
|
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
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-09-19 01:04:05 +08:00
|
|
|
|
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-10-12 22:36:14 +08:00
|
|
|
- name: include misc/ntp_rpm.yml
|
|
|
|
include: misc/ntp_rpm.yml
|
2017-04-13 01:57:33 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
2017-10-12 22:36:14 +08:00
|
|
|
- ansible_os_family in ['RedHat', 'Suse']
|
2017-04-13 01:57:33 +08:00
|
|
|
- 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-09-28 06:11:53 +08:00
|
|
|
tags:
|
|
|
|
- fetch_container_image
|
2017-08-29 05:23:36 +08:00
|
|
|
|
|
|
|
- name: get ceph version
|
2017-11-02 23:17:38 +08:00
|
|
|
command: docker run --rm --entrypoint /usr/bin/ceph {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --version
|
2017-08-29 05:23:36 +08:00
|
|
|
changed_when: false
|
2017-10-25 22:53:34 +08:00
|
|
|
check_mode: no
|
2017-08-29 05:23:36 +08:00
|
|
|
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
|