-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.yml
70 lines (61 loc) · 2.76 KB
/
configure.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
61
62
63
64
65
66
67
68
69
70
---
- name: Playbook to configure Edge Environments
hosts: all
become: true
gather_facts: true
collections:
- gartner.demo
vars:
prod_web_image: quay-vkx45.apps.cluster-vkx45.sandbox1935.opentlc.com/quayadmin/coolstore-webapp-nodejs:latest
prod_vertx_image: quay-vkx45.apps.cluster-vkx45.sandbox1935.opentlc.com/quayadmin/coolstore-gateway-vertx:latest
prod_springboot_image: quay-vkx45.apps.cluster-vkx45.sandbox1935.opentlc.com/quayadmin/coolstore-catalog-spring:latest
tasks:
- name: Remove all containers
shell: |
podman rm -f $(podman ps -a -q);
ignore_errors: true
- name: fact for aws instance
set_fact:
container_address: "{{ hostvars[inventory_hostname].public_ip_address }}"
when: group_names[0] == 'aws_ec2'
- name: fact for gcp
set_fact:
container_address: "{{ hostvars[inventory_hostname].ansible_host }}"
when: group_names[0] == 'gcp' or group_names[0] == 'ungrouped'
- name: Set common quay io URL
ansible.builtin.set_fact:
docker_url: "{{ ansible_eda.event.payload.docker_url | default('quay-vkx45.apps.cluster-vkx45.sandbox1935.opentlc.com') | regex_replace('/[^/]+$', '') }}"
# docker_url: "{{ ansible_eda.event.payload.docker_url | default('quay-vkx45.apps.cluster-vkx45.sandbox1935.opentlc.com/quayadmin') }}"
- name: Set container images
ansible.builtin.set_fact:
web_image: "{{ prod_web_image }}"
vertx_image: "{{ prod_vertx_image }}"
inventory_image: "{{ docker_url }}/{{ ansible_eda.event.payload.name | default('coolstore-inventory-quarkus') }}:{{ ansible_eda.event.payload.updated_tags[0] | default('latest') }}"
springboot_image: "{{ prod_springboot_image }}"
- name: Import configure role
import_role:
name: gartner.demo.configure
- block:
- name: Fail Task
fail:
msg: 'Failed'
when: true
rescue:
- name: set stats
set_stats:
data:
dublin_store_kiosk1: "http://kiosk1-dub.demoredhat.com"
dublin_store_kiosk2: "http://kiosk2-dub.demoredhat.com"
dublin_store_kiosk3: "http://kiosk3-dub.demoredhat.com"
dublin_store_kiosk4: "http://kiosk4-dub.demoredhat.com"
dublin_store_kiosk5: "http://kiosk5-dub.demoredhat.com"
#when: group_names[0] == 'aws_ec2'
when: location == 'Dublin'
- name: set stats
set_stats:
data:
jhb_store_kiosk1: "http://kiosk1-jhb.demoredhat.com"
jhb_store_kiosk2: "http://kiosk2-jhb.demoredhat.com"
jhb_store_kiosk3: "http://kiosk3-jhb.demoredhat.com"
#when: group_names[0] == 'gcp' or group_names[0] == 'ungrouped'
when: location == 'JHB'