forked from redhat-gpte-devopsautomation/aa2_final_lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoke-test.yml
41 lines (37 loc) · 1.04 KB
/
smoke-test.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
- name: End to end smoke tests
hosts: app_servers:database_servers
gather_facts: true
become: true
tags:
- smoketest
tasks:
- name: Smoketest Postgres database
postgresql_ping:
db: flask_db
login_host: "{{ groups.database_servers[0] }}"
login_user: flask
login_password: redhat
ssl_mode: disable
delegate_to: "{{ groups.app_servers[0] }}"
run_once: true
tags:
- smoketest
- name: End to end smoke tests
hosts: app_servers
become: false
gather_facts: false
tags:
- smoketest
tasks:
- name: Check webserver for correct response
uri:
url: "http://{{ hostvars[item].ansible_host }}"
#url: "http://{{ hostvars[item].ansible_host }}/ping"
#url: "http://frontend1/ping"
return_content: yes
until: '"Ansible Automation Platform" in result.content'
retries: 10
delay: 1
register: result
loop: "{{ lookup('items', groups['load_balancers'][0], wantlist=True) }}"
delegate_to: localhost