2017-02-22 00:58:24 +08:00
|
|
|
---
|
2019-04-16 21:33:02 +08:00
|
|
|
- name: include specific variables
|
|
|
|
include_vars: "{{ item }}"
|
|
|
|
with_first_found:
|
|
|
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
|
|
|
- "{{ ansible_os_family }}.yml"
|
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: debian based systems tasks
|
2019-04-16 21:33:02 +08:00
|
|
|
include_tasks: debian_prerequisites.yml
|
2019-03-28 16:13:30 +08:00
|
|
|
when:
|
2019-04-16 21:33:02 +08:00
|
|
|
- ansible_os_family == 'Debian'
|
2019-04-01 23:46:15 +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'
|
2019-05-22 16:02:42 +08:00
|
|
|
- ceph_docker_enable_centos_extra_repo | bool
|
2017-02-22 00:58:24 +08:00
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
2020-01-03 04:50:24 +08:00
|
|
|
- name: install container and lvm2 packages
|
2019-04-16 21:33:02 +08:00
|
|
|
package:
|
2020-01-03 04:50:24 +08:00
|
|
|
name: ['{{ container_package_name }}', '{{ container_binding_name }}', 'lvm2']
|
2019-04-16 21:33:02 +08:00
|
|
|
update_cache: true
|
2020-01-03 04:50:24 +08:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2019-04-01 23:46:15 +08:00
|
|
|
tags: with_pkg
|
2019-02-10 15:21:43 +08:00
|
|
|
|
2019-04-16 21:33:02 +08:00
|
|
|
- name: start container service
|
2019-04-02 00:12:52 +08:00
|
|
|
service:
|
2019-04-16 21:33:02 +08:00
|
|
|
name: '{{ container_service_name }}'
|
2019-04-02 00:12:52 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
tags:
|
|
|
|
with_pkg
|
2019-08-23 02:29:40 +08:00
|
|
|
when: container_service_name == 'docker'
|