ceph-ansible/roles/ceph-mon/tasks/docker/pre_requisite.yml

172 lines
3.2 KiB
YAML
Raw Normal View History

---
- name: install pip and docker on ubuntu
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker
- docker.io
when: ansible_distribution == 'Ubuntu'
2016-01-14 03:15:35 +08:00
tags:
with_pkg
- name: install pip and docker on debian
apt:
name: "{{ item }}"
state: present
update_cache: yes
with_items:
- python-pip
- docker-engine
when: ansible_distribution == 'Debian'
2016-01-14 03:15:35 +08:00
tags:
with_pkg
# install epel for pip
- name: install epel-release on redhat
yum:
name: epel-release
state: present
when: ansible_os_family == 'RedHat'
tags:
with_pkg
2016-10-17 06:23:43 +08:00
# ensure extras enabled for docker
- name: enable extras repo for centos
ini_file:
dest: /etc/yum.repos.d/CentOS-Base.repo
section: extras
option: enabled
value: 1
when: ansible_distribution == 'CentOS'
2016-10-17 06:23:43 +08:00
tags:
with_pkg
- name: install pip on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- python-pip
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == "yum"
2016-01-14 03:15:35 +08:00
tags:
with_pkg
- name: install docker-engine on redhat
yum:
name: "{{ item }}"
state: present
with_items:
- docker-engine
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == "yum"
2016-01-14 03:15:35 +08:00
tags:
with_pkg
failed_when: false
2016-01-14 03:15:35 +08:00
# for CentOS
- name: install docker on redhat
2016-01-14 03:15:35 +08:00
yum:
name: "{{ item }}"
2016-01-14 03:15:35 +08:00
state: present
with_items:
- docker
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == "yum"
tags:
with_pkg
failed_when: false
- name: install pip and docker on redhat (dnf)
dnf:
name: "{{ item }}"
state: present
with_items:
- python-pip
- docker-engine
- docker
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == "dnf"
2016-01-14 03:15:35 +08:00
tags:
with_pkg
2016-01-14 03:15:35 +08:00
# NOTE (jimcurtis): need at least version 1.9.0 of six or we get:
# re:NameError: global name 'DEFAULT_DOCKER_API_VERSION' is not defined
- name: install six
pip:
name: six
version: 1.9.0
tags:
with_pkg
- 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
# NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
- name: install docker-py
2015-10-17 07:55:31 +08:00
pip:
name: docker-py
version: 1.1.0
2016-01-14 03:15:35 +08:00
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '<')
- name: install docker-py
pip:
name: docker-py
state: latest
tags:
with_pkg
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
- name: install ntp on redhat using yum
yum:
name: ntp
state: present
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == 'yum'
- ntp_service_enabled
tags:
with_pkg
- name: install ntp on redhat using dnf
dnf:
name: ntp
state: present
when:
- ansible_os_family == 'RedHat'
- ansible_pkg_mgr == 'dnf'
- ntp_service_enabled
tags:
with_pkg
- name: install ntp on debian
apt:
name: ntp
state: present
when:
- ansible_os_family == 'Debian'
- ntp_service_enabled
tags:
with_pkg