David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 1 | - name: Debian add Docker repository and update apt cache |
| 2 | apt_repository: |
David K. Bainbridge | ca68f06 | 2016-10-27 11:04:33 -0700 | [diff] [blame] | 3 | repo: "{{ docker_apt_repo | default('deb https://apt.dockerproject.org/repo ubuntu-{{ debian_version }} main') }}" |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 4 | update_cache: yes |
| 5 | state: present |
| 6 | tags: [docker] |
| 7 | |
| 8 | - name: Debian Docker is present |
| 9 | apt: |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 10 | name: docker-engine=1.12* |
| 11 | state: present |
David K. Bainbridge | b541504 | 2016-05-13 17:06:10 -0700 | [diff] [blame] | 12 | force: yes |
| 13 | tags: [docker] |
| 14 | |
| 15 | - name: Debian python-pip is present |
| 16 | apt: name=python-pip state=present |
| 17 | tags: [docker] |
| 18 | |
| 19 | - name: Debian docker-py is present |
| 20 | pip: |
| 21 | name: docker-py |
| 22 | version: 1.6.0 |
| 23 | state: present |
| 24 | tags: [docker] |
| 25 | |
| 26 | - name: Debian files are present |
| 27 | template: |
| 28 | src: "{{ docker_cfg }}" |
| 29 | dest: "{{ docker_cfg_dest }}" |
| 30 | register: copy_result |
| 31 | tags: [docker] |
| 32 | |
| 33 | - name: Debian Daemon is reloaded |
| 34 | command: systemctl daemon-reload |
| 35 | when: copy_result|changed and is_systemd is defined |
| 36 | tags: [docker] |
| 37 | |
| 38 | - name: vagrant user is added to the docker group |
| 39 | user: |
| 40 | name: vagrant |
| 41 | group: docker |
| 42 | register: user_result |
| 43 | tags: [docker] |
| 44 | |
| 45 | - name: Debian Docker service is restarted |
| 46 | service: |
| 47 | name: docker |
| 48 | state: restarted |
| 49 | when: copy_result|changed or user_result|changed |
| 50 | tags: [docker] |
| 51 | |
| 52 | - name: DockerUI is running |
| 53 | docker: |
| 54 | image: abh1nav/dockerui |
| 55 | name: dockerui |
| 56 | ports: 9000:9000 |
| 57 | privileged: yes |
| 58 | volumes: |
| 59 | - /var/run/docker.sock:/var/run/docker.sock |
| 60 | when: not skip_ui is defined |
David K. Bainbridge | 17248c0 | 2016-08-29 17:04:34 -0700 | [diff] [blame] | 61 | tags: [docker] |