2019-02-26 03:49:51 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: install docker
|
|
|
|
package:
|
|
|
|
name: docker
|
|
|
|
state: latest
|
2020-01-07 06:37:06 +00:00
|
|
|
when: ansible_distribution in ["CentOS", "Fedora", "Red Hat Enterprise Linux", "RedHat"] and not is_atomic
|
2019-02-26 03:49:51 +00:00
|
|
|
register: docker_installed
|
|
|
|
|
|
|
|
- name: add {{ username }} to 'dockerroot' group
|
|
|
|
user:
|
|
|
|
name: "{{ username }}"
|
|
|
|
groups: dockerroot
|
|
|
|
append: yes
|
2020-01-07 06:37:06 +00:00
|
|
|
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "RedHat"] and not is_atomic
|
2019-02-26 03:49:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
- name: copy daemon.json
|
|
|
|
copy:
|
|
|
|
src: roles/docker/files/daemon.json
|
|
|
|
dest: /etc/docker/daemon.json
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2020-01-07 06:37:06 +00:00
|
|
|
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "RedHat"] and not is_atomic
|
2019-02-26 03:49:51 +00:00
|
|
|
|
|
|
|
- name: enable/start docker
|
|
|
|
service:
|
|
|
|
name: docker
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
2020-01-07 06:37:06 +00:00
|
|
|
when: ansible_distribution in ["CentOS", "Fedora", "Red Hat Enterprise Linux", "RedHat"] and not is_atomic
|