forked from WSULib/state-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-docker.yml
57 lines (46 loc) · 1.3 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
54
55
56
57
---
- name: install-docker
hosts: all
become: yes
gather_facts: true
tasks:
- name: install pre-reqs for Docker to be installed
package:
name: "{{ item }}"
state: latest
with_items: "{{ docker_packages }}"
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- name: Add Docker's official GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add specified repository into sources list
shell: |
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
args:
executable: /bin/bash
- name: Update package lists
shell: |
apt-get update
args:
executable: /bin/bash
- name: install latest version of docker-ce
package:
name: docker-ce
state: latest
- group:
name: admin
state: present
- user:
name: "{{ system_username }}"
comment: "Portal User"
groups: admin,docker
shell: /bin/bash
password: "{{ system_password | password_hash('sha512') }}"
update_password: on_create
- name: install pexpect
shell: |
apt-get install -y python-pexpect