-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.yml
38 lines (31 loc) · 928 Bytes
/
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
- hosts: all
tasks:
- yum_repository:
name: "docker-ce"
description: "docker"
baseurl: "https://download.docker.com/linux/centos/7/x86_64/stable/"
gpgcheck: no
- package:
name: "docker-ce-18.09.1-3.e17.x86_64"
state: present
- service:
name: "docker"
state: started
enabled: yes
- command: pip3 install docker
- docker_image:
name: httpd
source: pull
- file:
path : /html
state: directory
- copy:
src : "home.html"
dest: "/var/www/html"
- docker_container:
name: webserver
image: httpd
state: started
exposed_ports: "80"
ports: "8888:80"
volumes: "/var/www/html:/usr/local/apache2/htdocs"