initial commit
This commit is contained in:
commit
800836b2d9
23 changed files with 609 additions and 0 deletions
3
roles/docker/files/daemon.json
Normal file
3
roles/docker/files/daemon.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"group": "dockerroot"
|
||||
}
|
32
roles/docker/tasks/main.yml
Normal file
32
roles/docker/tasks/main.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
|
||||
- name: install docker
|
||||
package:
|
||||
name: docker
|
||||
state: latest
|
||||
when: ansible_distribution in ["CentOS", "Fedora", "Red Hat Enterprise Linux"] and not is_atomic
|
||||
register: docker_installed
|
||||
|
||||
- name: add {{ username }} to 'dockerroot' group
|
||||
user:
|
||||
name: "{{ username }}"
|
||||
groups: dockerroot
|
||||
append: yes
|
||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux"] and not is_atomic
|
||||
|
||||
|
||||
- name: copy daemon.json
|
||||
copy:
|
||||
src: roles/docker/files/daemon.json
|
||||
dest: /etc/docker/daemon.json
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux"] and not is_atomic
|
||||
|
||||
- name: enable/start docker
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: yes
|
||||
when: ansible_distribution in ["CentOS", "Fedora", "Red Hat Enterprise Linux"] and not is_atomic
|
Loading…
Add table
Add a link
Reference in a new issue