2016-05-06 02:20:03 +08:00
|
|
|
---
|
|
|
|
- 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'
|
|
|
|
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'
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
2016-10-18 04:44:30 +08:00
|
|
|
- name: enable extras repo for centos
|
2016-10-26 16:04:59 +08:00
|
|
|
yum_repository:
|
|
|
|
name: extras
|
|
|
|
state: present
|
|
|
|
enabled: yes
|
2016-10-18 04:44:30 +08:00
|
|
|
when: ansible_distribution == 'CentOS'
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
2016-05-06 02:20:03 +08:00
|
|
|
- name: install pip and docker on redhat
|
|
|
|
yum:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- python-pip
|
|
|
|
- docker-engine
|
|
|
|
when:
|
|
|
|
ansible_os_family == 'RedHat' and
|
|
|
|
ansible_pkg_mgr == "yum"
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
|
|
|
- name: install pip and docker on redhat
|
|
|
|
dnf:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- python-pip
|
|
|
|
- docker-engine
|
|
|
|
when:
|
|
|
|
ansible_os_family == 'RedHat' and
|
|
|
|
ansible_pkg_mgr == "dnf"
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
|
|
|
- name: install epel-release on redhat
|
|
|
|
yum:
|
|
|
|
name: epel-release
|
|
|
|
state: present
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
tags:
|
|
|
|
with_pkg
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2016-07-12 18:54:27 +08:00
|
|
|
# NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
|
|
|
|
- name: install docker-py
|
|
|
|
pip:
|
|
|
|
name: docker-py
|
|
|
|
version: 1.1.0
|
|
|
|
tags:
|
|
|
|
with_pkg
|
2016-07-12 20:50:56 +08:00
|
|
|
when: ansible_version['full'] | version_compare('2.1.0.0', '<')
|
2016-07-12 18:54:27 +08:00
|
|
|
|
|
|
|
- name: install docker-py
|
|
|
|
pip:
|
|
|
|
name: docker-py
|
|
|
|
state: latest
|
|
|
|
tags:
|
|
|
|
with_pkg
|
2016-07-12 20:50:56 +08:00
|
|
|
when: ansible_version['full'] | version_compare('2.1.0.0', '>=')
|
2016-07-12 18:54:27 +08:00
|
|
|
|
2016-05-06 02:20:03 +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
|
2016-07-28 22:42:19 +08:00
|
|
|
|
|
|
|
- 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
|