2017-02-22 00:58:24 +08:00
|
|
|
---
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: include remove_ceph_udev_rules.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: remove_ceph_udev_rules.yml
|
2017-08-25 20:36:07 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: debian based systems tasks
|
|
|
|
block:
|
|
|
|
- name: include debian_prerequisites.yml
|
|
|
|
include_tasks: debian_prerequisites.yml
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
- name: install python-six
|
|
|
|
package:
|
|
|
|
name: python-six
|
|
|
|
state: present
|
|
|
|
update_cache: yes
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2018-09-07 20:45:43 +08:00
|
|
|
tags:
|
|
|
|
with_pkg
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- ansible_distribution == 'Debian'
|
2017-02-22 00:58:24 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: ubuntu based systems tasks
|
|
|
|
block:
|
|
|
|
- name: install docker on ubuntu
|
|
|
|
package:
|
2018-11-08 17:26:58 +08:00
|
|
|
name: ['docker.io', 'python-docker']
|
2018-09-07 20:45:43 +08:00
|
|
|
state: present
|
|
|
|
update_cache: yes
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2019-03-28 02:11:20 +08:00
|
|
|
|
|
|
|
- name: install python3-docker on bionic
|
|
|
|
package:
|
|
|
|
name: python3-docker
|
|
|
|
state: present
|
|
|
|
update_cache: yes
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
when: ansible_lsb.codename == 'bionic'
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- ansible_distribution == 'Ubuntu'
|
2019-03-28 02:11:20 +08:00
|
|
|
tags:
|
|
|
|
with_pkg
|
2017-02-22 00:58:24 +08:00
|
|
|
|
|
|
|
# ensure extras enabled for docker
|
|
|
|
- name: enable extras on centos
|
|
|
|
yum_repository:
|
|
|
|
name: extras
|
|
|
|
state: present
|
|
|
|
enabled: yes
|
|
|
|
when:
|
|
|
|
- ansible_distribution == 'CentOS'
|
2017-03-16 17:57:13 +08:00
|
|
|
- ceph_docker_enable_centos_extra_repo
|
2017-02-22 00:58:24 +08:00
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
2019-01-16 17:27:23 +08:00
|
|
|
- name: red hat 7 based systems tasks
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: install python-docker-py on red hat / centos
|
|
|
|
package:
|
2018-11-08 17:26:58 +08:00
|
|
|
name: ['docker', 'python-docker-py']
|
2018-09-07 20:45:43 +08:00
|
|
|
state: present
|
2018-12-19 21:55:01 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2018-09-07 20:45:43 +08:00
|
|
|
tags:
|
|
|
|
with_pkg
|
2019-01-16 17:27:23 +08:00
|
|
|
|
|
|
|
- name: pause after docker install before starting (on openstack vms)
|
|
|
|
pause: seconds=5
|
|
|
|
when:
|
|
|
|
- ceph_docker_on_openstack
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
|
|
|
- name: start docker service
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == 'RedHat'
|
2019-01-16 17:27:23 +08:00
|
|
|
- ansible_distribution_major_version == '7'
|
2017-02-22 00:58:24 +08:00
|
|
|
|
2019-01-16 17:27:23 +08:00
|
|
|
- name: red hat 8 based systems tasks
|
|
|
|
block:
|
|
|
|
- name: install podman
|
|
|
|
package:
|
|
|
|
name: 'podman'
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
|
|
|
tags:
|
|
|
|
with_pkg
|
2017-09-15 06:48:53 +08:00
|
|
|
when:
|
2019-01-16 17:27:23 +08:00
|
|
|
- ansible_os_family == 'RedHat'
|
2019-02-10 15:21:43 +08:00
|
|
|
- ansible_distribution_major_version == '8'
|
|
|
|
|
2019-04-02 00:12:52 +08:00
|
|
|
- name: start docker service
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
when: not (ansible_os_family == 'RedHat' and
|
|
|
|
ansible_distribution_major_version == '8')
|
|
|
|
|
2019-02-10 15:21:43 +08:00
|
|
|
- name: ensure tmpfiles.d is present
|
|
|
|
lineinfile:
|
2019-02-14 22:25:41 +08:00
|
|
|
path: /etc/tmpfiles.d/ceph-common.conf
|
|
|
|
line: "d /run/ceph 0770 root root -"
|
2019-02-10 15:21:43 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
state: present
|
2019-02-13 17:07:15 +08:00
|
|
|
create: yes
|