-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yml
45 lines (35 loc) · 1.16 KB
/
playbook.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
---
#Installing Docker and deploying my web server on Ubuntu 20.04
- hosts: all
become: yes
tasks:
# - name: Install aptitude
# apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
- name: Install Docker adds
apt: name={{ item }} state=latest update_cache=yes
loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip' ]
- name: Add Docker gpg
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker rep
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable
state: present
- name: Install Docker module for Python
pip:
name: docker
- name: Install Docker
apt: update_cache=yes name=docker-ce state=latest
- name: Pull docker image
docker_image:
name: wpi86/devops:webserv
source: pull
- name: Create container
docker_container:
name: webserv
image: wpi86/devops:webserv
state: started
restart_policy: always
ports:
- "443:1443"