-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_docker.yml
53 lines (53 loc) · 1.58 KB
/
install_docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- hosts: all
tasks:
- name: remove the docker-compose package
become: true
package:
name: docker-compose
state: absent
- name: remove the docker-engine package
become: true
package:
name: docker-engine
state: absent
- name: remove the docker.io package
become: true
package:
name: docker.io
state: absent
- name: Install packages to allow apt to use a repository over HTTPS
become: true
package: name={{ item }} state=latest
with_items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
- name: Add Docker’s official GPG key
become: true
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add apt repo
become: true
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
state: present
- name: install docker-ce
become: true
package: name={{ item }} state=latest
with_items:
- docker-ce
- name: adding existing user '{{ ansible_user }}' to group docker
become: true
user:
name: "{{ ansible_user }}"
groups: docker
append: yes
- name: Install Compose on Linux systems
become: true
get_url:
url: "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-{{ ansible_system }}-{{ ansible_architecture }}"
dest: /usr/local/bin/docker-compose
mode: 0755