Docker host and docker registry

This commit is contained in:
2016-12-28 13:13:35 -05:00
parent a519e04791
commit 96087c2295
23 changed files with 361 additions and 27 deletions

View File

@@ -0,0 +1,59 @@
---
# main tasks to install docker
- name: install packages
apt:
state: installed
package: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
with_items:
- "wget"
- "apt-transport-https"
- "ca-certificates"
#- name: run docker install script
# command: "wget -qO- https://get.docker.com/ | sh"
# args:
# creates: /usr/bin/docker
#- stat:
# path: /usr/bin/docker
# register: docker
#
#- debug: var=docker
#- name: download install script
# get_url:
# url: https://get.docker.com/
# dest: /tmp/docker_install.sh
# mode: 500
# when: docker.stat.exists == false
#
#- name: run install script
# script: /tmp/docker_install.sh
# args:
# creates: /usr/bin/docker
# when: docker.stat.exists == false
- name: create docker group
group: state=present name=docker gid=999 system=yes
- name: add users to docker group
user: name={{ item }} groups=docker append=yes
with_items: "{{ dockerhost.users }}"
- name: install via apt
apt:
update_cache: true
package: "{{ item }}"
with_items:
- docker-engine
- docker-compose
- name: copy docker config file
copy:
src: daemon.json
dest: /etc/docker/daemon.json