2014-03-04 02:08:51 +08:00
|
|
|
---
|
|
|
|
# Defines deployment design and assigns role to server groups
|
|
|
|
|
2016-10-12 12:03:52 +08:00
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- agents
|
|
|
|
- osds
|
|
|
|
- mdss
|
|
|
|
- rgws
|
|
|
|
- nfss
|
|
|
|
- restapis
|
|
|
|
- rbdmirrors
|
|
|
|
- clients
|
2017-03-16 17:17:08 +08:00
|
|
|
- mgrs
|
2017-10-05 22:40:07 +08:00
|
|
|
- iscsi-gws
|
2017-08-24 15:28:22 +08:00
|
|
|
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2017-08-24 15:28:22 +08:00
|
|
|
|
2016-12-14 23:13:55 +08:00
|
|
|
tags:
|
|
|
|
- always
|
2017-08-24 15:28:22 +08:00
|
|
|
|
2017-10-31 21:39:29 +08:00
|
|
|
vars:
|
|
|
|
delegate_facts_host: True
|
|
|
|
|
2016-10-12 12:03:52 +08:00
|
|
|
tasks:
|
|
|
|
# If we can't get python2 installed before any module is used we will fail
|
|
|
|
# so just try what we can to get it installed
|
|
|
|
- name: check for python2
|
|
|
|
stat:
|
|
|
|
path: /usr/bin/python
|
|
|
|
ignore_errors: yes
|
|
|
|
register: systempython2
|
2017-08-24 15:28:22 +08:00
|
|
|
|
|
|
|
- name: install python2 for debian based systems
|
2016-10-12 12:03:52 +08:00
|
|
|
raw: sudo apt-get -y install python-simplejson
|
|
|
|
ignore_errors: yes
|
2017-08-24 15:28:22 +08:00
|
|
|
when:
|
|
|
|
- systempython2.stat.exists is undefined or systempython2.stat.exists == false
|
|
|
|
|
|
|
|
- name: install python2 for fedora
|
2016-10-12 12:03:52 +08:00
|
|
|
raw: sudo dnf -y install python creates=/usr/bin/python
|
|
|
|
ignore_errors: yes
|
2017-08-24 15:28:22 +08:00
|
|
|
when:
|
|
|
|
- systempython2.stat.exists is undefined or systempython2.stat.exists == false
|
|
|
|
|
2017-10-12 21:55:20 +08:00
|
|
|
- name: install python2 for opensuse
|
|
|
|
raw: sudo zypper -n install python-base creates=/usr/bin/python2.7
|
|
|
|
ignore_errors: yes
|
|
|
|
when:
|
|
|
|
- systempython2.stat.exists is undefined or systempython2.stat.exists == false
|
|
|
|
|
2017-10-31 21:39:29 +08:00
|
|
|
- name: gather facts
|
|
|
|
setup:
|
|
|
|
when:
|
|
|
|
- not delegate_facts_host | bool
|
|
|
|
|
2017-08-24 15:28:22 +08:00
|
|
|
- name: gather and delegate facts
|
2016-10-12 12:03:52 +08:00
|
|
|
setup:
|
2017-08-24 15:28:22 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
|
|
|
with_items: "{{ groups['all'] }}"
|
2018-05-04 00:41:16 +08:00
|
|
|
run_once: true
|
2017-10-31 21:39:29 +08:00
|
|
|
when:
|
|
|
|
- delegate_facts_host | bool
|
2017-08-24 15:28:22 +08:00
|
|
|
|
|
|
|
- name: install required packages for fedora > 23
|
2016-10-12 12:03:52 +08:00
|
|
|
raw: sudo dnf -y install python2-dnf libselinux-python ntp
|
2017-08-24 15:28:22 +08:00
|
|
|
when:
|
|
|
|
- ansible_distribution == 'Fedora'
|
|
|
|
- ansible_distribution_major_version|int >= 23
|
2016-10-12 12:03:52 +08:00
|
|
|
|
2018-04-13 23:55:38 +08:00
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- agents
|
|
|
|
- osds
|
|
|
|
- mdss
|
|
|
|
- rgws
|
|
|
|
- nfss
|
|
|
|
- restapis
|
|
|
|
- rbdmirrors
|
|
|
|
- clients
|
|
|
|
- mgrs
|
|
|
|
- iscsi-gws
|
|
|
|
|
|
|
|
gather_facts: false
|
2018-05-01 04:47:35 +08:00
|
|
|
any_errors_fatal: true
|
2018-04-13 23:55:38 +08:00
|
|
|
|
|
|
|
roles:
|
|
|
|
- ceph-defaults
|
2018-05-01 00:39:25 +08:00
|
|
|
- ceph-validate
|
2018-04-13 23:55:38 +08:00
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
- hosts: mons
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph monitor install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mon:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-04 02:08:51 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-mon
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph monitor install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mon:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-04 02:08:51 +08:00
|
|
|
|
2017-09-22 23:26:28 +08:00
|
|
|
- hosts: mgrs
|
|
|
|
gather_facts: false
|
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph manager install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mgr:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2017-09-22 23:26:28 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
|
|
|
- role: ceph-mgr
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph manager install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mgr:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2017-09-22 23:26:28 +08:00
|
|
|
|
2016-02-16 20:09:54 +08:00
|
|
|
- hosts: agents
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-16 20:09:54 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph agent install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_agent:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-02-16 20:09:54 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-agent
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph agent install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_agent:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-02-16 20:09:54 +08:00
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
- hosts: osds
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph osd install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_osd:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-04 02:08:51 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-osd
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph osd install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_osd:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-06 15:49:46 +08:00
|
|
|
|
|
|
|
- hosts: mdss
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph mds install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mds:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-06 15:49:46 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-mds
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph mds install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_mds:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-06 20:54:37 +08:00
|
|
|
|
|
|
|
- hosts: rgws
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph rgw install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_rgw:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2014-03-06 20:54:37 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-rgw
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph rgw install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_rgw:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2015-11-27 02:57:16 +08:00
|
|
|
|
2016-05-06 02:20:03 +08:00
|
|
|
- hosts: nfss
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-05-06 02:20:03 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph nfs install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_nfs:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-05-06 02:20:03 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
|
|
|
- role: ceph-nfs
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph nfs install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_nfs:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-05-06 02:20:03 +08:00
|
|
|
|
2015-11-27 02:57:16 +08:00
|
|
|
- hosts: restapis
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-02-04 19:36:46 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph rest api install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_restapi:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2015-11-27 02:57:16 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-restapi
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph rest api install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_restapi:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-04-04 06:35:09 +08:00
|
|
|
|
|
|
|
- hosts: rbdmirrors
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-04-04 06:35:09 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph rbd mirror install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_rbdmirror:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-04-04 06:35:09 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-rbd-mirror
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph rbd mirror install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_rbdmirror:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-05-11 00:29:27 +08:00
|
|
|
|
|
|
|
- hosts: clients
|
2016-10-12 12:03:52 +08:00
|
|
|
gather_facts: false
|
2016-05-11 00:29:27 +08:00
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph client install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_client:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-05-11 00:29:27 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-client
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph client install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_client:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2016-08-26 21:22:47 +08:00
|
|
|
|
2017-10-05 22:40:07 +08:00
|
|
|
- hosts: iscsi-gws
|
2017-08-05 02:18:11 +08:00
|
|
|
gather_facts: false
|
|
|
|
become: True
|
2018-03-01 00:08:07 +08:00
|
|
|
pre_tasks:
|
|
|
|
- name: set ceph iscsi gateway install 'In Progress'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_iscsi_gw:
|
|
|
|
status: "In Progress"
|
|
|
|
start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
2017-08-05 02:18:11 +08:00
|
|
|
roles:
|
2018-04-10 21:30:16 +08:00
|
|
|
- role: ceph-defaults
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
- role: ceph-common
|
|
|
|
- role: ceph-config
|
|
|
|
tags: ['ceph_update_config']
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
|
|
|
- role: ceph-iscsi-gw
|
|
|
|
when:
|
|
|
|
- ceph_release_num[ceph_release] >= ceph_release_num.luminous
|
2018-03-01 00:08:07 +08:00
|
|
|
post_tasks:
|
|
|
|
- name: set ceph iscsi gw install 'Complete'
|
|
|
|
run_once: true
|
|
|
|
set_stats:
|
|
|
|
data:
|
|
|
|
installer_phase_ceph_iscsi_gw:
|
|
|
|
status: "Complete"
|
|
|
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|