forked from siamaksade/openshift-jenkins-demo
-
Notifications
You must be signed in to change notification settings - Fork 3
/
app_hackazon_ec2_deploy.yml
62 lines (53 loc) · 1.36 KB
/
app_hackazon_ec2_deploy.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Deploy Hackazon Application to EC2 Instances
hosts: all
gather_facts: false
tasks:
- name: Pull Hackazon AIO Image
podman_image:
name: mutzel/all-in-one-hackazon
tag: postinstall
state: present
tags:
- app_hackazon_image_pull
- app
- devsecops
- name: Get current running Containers
command: >
podman ps --filter name="{{ container_name }}"
register: podman_status
tags:
- app_hackazon_pod_status
- app_hackazon
- devsecops
- name: Debug podman status
debug:
var: podman_status
verbosity: 2
tags:
- debug_app_hackazon_pod_status
- app_hackazon
- devsecops
- name: Stop current Hackazon Container if it running
command: >
podman stop {{ container_name }}
when: podman_status.stdout is search('Up ')
tags:
- app_hackazon_pod_stop
- app_hackazon
- devsecops
- name: Remove current Hackazon Container if it Exists
command: >
podman rm {{ container_name }}
when: podman_status.stdout is search('Exited ')
tags:
- app_hackazon_pod_remove
- app_hackazon
- devsecops
- name: Start hackazon AIO Image
command: >
podman run --rm --name {{ container_name }} -p 3000:80 -d all-in-one-hackazon:postinstall
tags:
- app_hackazon_pod_start
- app_hackazon
- devsecops