forked from tonykay/solution-three-tier-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smoketest.yml
50 lines (43 loc) · 1.18 KB
/
smoketest.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
---
- name: End to end smoke tests
hosts: apps:appdbs
gather_facts: true
become: true
tags:
- smoketest
tasks:
- debug:
msg:
# - "IP is {{ hostvars['appdb1']['ansible_default_ipv4']['address'] }}"
- "IP is {{ hostvars['appdb1']['inventory_hostname'] }}"
- "First App server {{ groups.apps[0] }}"
verbosity: 2
- name: Smoketest Postgres database
postgresql_ping:
db: flask_db
# login_host: "{{ hostvars['appdb1']['ansible_default_ipv4']['address'] }}"
login_host: "{{ groups.appdbs[0].ansible_host }}"
login_user: flask
login_password: redhat
ssl_mode: disable
delegate_to: "{{ groups.apps[0] }}"
run_once: true
tags:
- smoketest
- name: End to end smoke tests
hosts: apps
become: false
gather_facts: false
tags:
- smoketest
tasks:
- name: Check webserver for correct response
uri:
url: "http://frontend1.{{ GUID }}.example.opentlc.com"
return_content: yes
until: '"Welcome to Tomcat" in result.content'
retries: 10
delay: 1
register: result
delegate_to: localhost
...