-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdeploy.yml
More file actions
40 lines (36 loc) · 863 Bytes
/
Copy pathdeploy.yml
File metadata and controls
40 lines (36 loc) · 863 Bytes
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: Pull docker image and deploy
hosts: docker
become: true
tasks:
- name: Install Docker
package:
name: docker-ce
state: present
- name: Start Docker service
systemd:
name: docker
state: started
enabled: yes
- name: Install pip
become: true
yum:
name: python3-pip
state: present
- name: Install Docker Python module
pip:
name: docker
state: present
- name: Pull image from Docker
docker_image:
name: learndevops083/sampleapp:latest
source: pull
state: present
- name: Start Sampleimageapp container
docker_container:
name: mysampleapp
image: learndevops083/sampleapp:latest
ports:
- "8000:8080"
state: started
restart_policy: unless-stopped