You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.1 KiB
82 lines
2.1 KiB
7 years ago
|
---
|
||
|
|
||
|
- name: Ensure Docker repository is enabled (CentOS)
|
||
|
template:
|
||
|
src: "{{ role_path }}/files/yum.repos.d/{{ item }}"
|
||
|
dest: "/etc/yum.repos.d/{{ item }}"
|
||
|
owner: "root"
|
||
|
group: "root"
|
||
|
mode: 0644
|
||
|
with_items:
|
||
|
- docker-ce.repo
|
||
|
when: ansible_distribution == 'CentOS'
|
||
|
|
||
|
- name: Ensure Docker's RPM key is trusted
|
||
|
rpm_key:
|
||
|
state: present
|
||
|
key: https://download.docker.com/linux/centos/gpg
|
||
|
when: ansible_distribution == 'CentOS'
|
||
|
|
||
7 years ago
|
- name: Ensure yum packages are installed (CentOS)
|
||
6 years ago
|
yum:
|
||
|
name:
|
||
|
- bash-completion
|
||
|
- docker-ce
|
||
|
- docker-python
|
||
|
- firewalld
|
||
|
- ntp
|
||
|
- fuse
|
||
|
state: latest
|
||
|
update_cache: yes
|
||
7 years ago
|
when: ansible_distribution == 'CentOS'
|
||
|
|
||
7 years ago
|
- name: Ensure APT usage dependencies are installed (Debian)
|
||
|
apt:
|
||
6 years ago
|
name:
|
||
|
- apt-transport-https
|
||
|
- ca-certificates
|
||
7 years ago
|
state: present
|
||
|
update_cache: yes
|
||
|
when: ansible_os_family == 'Debian'
|
||
|
|
||
|
- name: Ensure Docker's APT key is trusted (Debian)
|
||
|
apt_key:
|
||
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||
|
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||
|
state: present
|
||
|
register: add_repository_key
|
||
|
ignore_errors: true
|
||
|
when: ansible_os_family == 'Debian'
|
||
|
|
||
|
- name: Ensure Docker repository is enabled (Debian)
|
||
|
apt_repository:
|
||
|
repo: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable"
|
||
|
state: present
|
||
|
update_cache: yes
|
||
|
when: ansible_os_family == 'Debian'
|
||
|
|
||
|
- name: Ensure APT packages are installed (Debian)
|
||
6 years ago
|
apt:
|
||
|
name:
|
||
|
- bash-completion
|
||
|
- docker-ce
|
||
|
- python-docker
|
||
|
- ntp
|
||
|
- fuse
|
||
|
state: latest
|
||
|
update_cache: yes
|
||
7 years ago
|
when: ansible_os_family == 'Debian'
|
||
|
|
||
7 years ago
|
- name: Ensure firewalld is started and autoruns
|
||
|
service: name=firewalld state=started enabled=yes
|
||
7 years ago
|
when: ansible_os_family == 'RedHat'
|
||
7 years ago
|
|
||
7 years ago
|
- name: Ensure Docker is started and autoruns
|
||
|
service: name=docker state=started enabled=yes
|
||
|
|
||
7 years ago
|
- name: Ensure ntpd is started and autoruns
|
||
7 years ago
|
service:
|
||
|
name: "{{ 'ntpd' if ansible_os_family == 'RedHat' else 'ntp' }}"
|
||
|
state: started
|
||
|
enabled: yes
|