Sergio Slobodrian | ee4b2bc | 2017-06-05 10:08:59 -0400 | [diff] [blame] | 1 | - name: Debian add Docker repository and update apt cache
|
| 2 | apt_repository:
|
| 3 | repo: deb https://apt.dockerproject.org/repo ubuntu-{{ debian_version }} main
|
| 4 | update_cache: yes
|
| 5 | state: present
|
| 6 | when: target == "installer"
|
| 7 | tags: [docker]
|
| 8 |
|
| 9 | - name: Debian Docker is present
|
| 10 | apt:
|
| 11 | name: docker-engine
|
| 12 | state: latest
|
| 13 | force: yes
|
| 14 | when: target == "installer"
|
| 15 | tags: [docker]
|
| 16 |
|
| 17 | #- name: Docker deb install file is present
|
| 18 | # get_url:
|
| 19 | # url: https://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_17.05.0~ce-0~ubuntu-xenial_amd64.deb
|
| 20 | # dest: /home/vinstall
|
| 21 | # owner: vinstall
|
| 22 | # group: vinstall
|
| 23 | # when: target == "installer"
|
| 24 | # tags: [docker]
|
| 25 |
|
| 26 | #- name: Docker dependencies satisfied
|
| 27 | # apt:
|
| 28 | # name: libltdl7
|
| 29 | # state: latest
|
| 30 | # force: yes
|
| 31 | # when: target == "cluster"
|
| 32 | # tags: [docker]
|
| 33 |
|
| 34 | #- name: Docker install deb file is copied
|
| 35 | # copy:
|
| 36 | # src: /home/vinstall/docker-engine_17.05.0~ce-0~ubuntu-xenial_amd64.deb
|
| 37 | # dest: /home/voltha
|
| 38 | # when: target == "cluster"
|
| 39 | # tags: [docker]
|
| 40 |
|
| 41 | #- name: Docker engine is installed
|
| 42 | # apt:
|
| 43 | # deb: /home/vinstall/docker-engine_17.05.0~ce-0~ubuntu-xenial_amd64.deb
|
| 44 | # when: target == "cluster"
|
| 45 | # tags: [docker]
|
| 46 |
|
| 47 | - name: Debian python-pip is present
|
| 48 | apt: name=python-pip state=present
|
| 49 | tags: [docker]
|
| 50 |
|
| 51 | - name: Debian docker-py is present
|
| 52 | pip:
|
| 53 | name: docker-py
|
| 54 | version: 1.6.0
|
| 55 | state: present
|
| 56 | when: target == "installer"
|
| 57 | tags: [docker]
|
| 58 |
|
| 59 | - name: netifaces pip package is present
|
| 60 | pip:
|
| 61 | name: netifaces
|
| 62 | version: 0.10.4
|
| 63 | state: present
|
| 64 | when: target == "installer"
|
| 65 | tags: [docker]
|
| 66 |
|
| 67 | - name: Debian files are present
|
| 68 | template:
|
| 69 | src: "{{ docker_cfg }}"
|
| 70 | dest: "{{ docker_cfg_dest }}"
|
| 71 | register: copy_result
|
| 72 | tags: [docker]
|
| 73 |
|
| 74 | - name: Debian Daemon is reloaded
|
| 75 | command: systemctl daemon-reload
|
| 76 | when: copy_result|changed and is_systemd is defined
|
| 77 | tags: [docker]
|
| 78 |
|
| 79 | - name: vagrant user is added to the docker group
|
| 80 | user:
|
| 81 | name: "{{ ansible_env['SUDO_USER'] }}"
|
| 82 | group: docker
|
| 83 | register: user_result
|
| 84 | tags: [docker]
|
| 85 |
|
| 86 | - name: Debian Docker service is restarted
|
| 87 | service:
|
| 88 | name: docker
|
| 89 | state: restarted
|
| 90 | when: copy_result|changed or user_result|changed
|
| 91 | tags: [docker]
|