-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-docker.yml
40 lines (31 loc) · 1.03 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
---
- name: Install docker on Debian jessie
hosts: bp
become: true
tasks:
- name: get the ubuntu release
shell: lsb_release -cs
register: ubuntu_release
- name: update the package cache
apt: update_cache=yes
- name: Install packages to allow apt to use a repository over HTTPS
apt: name={{ item }} state=present
with_items:
- apt-transport-https
- ca-certificates
- curl
- gnupg2
- software-properties-common
- name: Get Docker’s official GPG key
apt_key:
url: "https://download.docker.com/linux/debian/gpg"
state: present
- name: add stable repository
# Very very ugly doing this way
command: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian jessie stable"
- name: update the package cache
apt: update_cache=yes
- name: Install latest version of docker
apt: name=docker-ce state=latest
- name: make sure docker is started
service: name=docker state=restarted