-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_docker_centos.yaml
64 lines (52 loc) · 1.29 KB
/
install_docker_centos.yaml
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
58
59
60
61
62
63
64
---
- hosts: webserver
become: true
vars_files:
- group_vars/default.yml
tasks:
- name: Install yum utils
yum:
name: yum-utils
state: latest
- name: Install device-mapper-persistent-data
yum:
name: device-mapper-persistent-data
state: latest
- name: Install lvm2
yum:
name: lvm2
state: latest
- name: Add Docker repo
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docer-ce.repo
- name: Enable Docker Edge repo
ini_file:
dest: /etc/yum.repos.d/docer-ce.repo
section: 'docker-ce-edge'
option: enabled
value: 0
- name: Enable Docker Test repo
ini_file:
dest: /etc/yum.repos.d/docer-ce.repo
section: 'docker-ce-test'
option: enabled
value: 0
- name: Install Docker
package:
name: docker-ce
state: latest
- name: Start Docker service
service:
name: docker
state: started
enabled: yes
- name: Install python3
yum:
name: python3
state: latest
- name: Install python3-pip
shell: ln -s /bin/pip3 /bin/pip
- name: Install Docker Module for Python
pip:
name: docker