-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker.yaml
49 lines (38 loc) · 1.01 KB
/
docker.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
- hosts: all
tasks:
- name: Yum repolist for Docker
yum_repository:
name: docker
description: yum repository for docker
baseurl: https://download.docker.com/linux/centos/7/x86_64/stable/
gpgcheck: no
- name: Package Installer For Docker
package:
name: docker-ce-3:18.09.1-3.el7
state: present
- name: Package Installer For Python3
package:
name: python3
state: present
- name: Installing python library for the Docker Remote API
pip:
name: docker-py
- name: Start service docker
service:
name: docker
state: started
- name: Copy Html Code to web server
copy:
src: ./webPage/
dest: /home/Web/
- name: Create a web container
docker_container:
name: web
image: httpd
ports:
- "80:80"
volumes:
- /home/Web:/usr/local/apache2/htdocs/
register: status
- debug:
var: status