-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmoke_test.yml
47 lines (41 loc) · 1.05 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
42
43
44
45
46
47
---
- name: End to end smoke tests
hosts: app_servers:database_servers
gather_facts: true
become: true
tags:
- smoketest
tasks:
- debug:
msg:
- "IP is {{ hostvars['appdb1']['ansible_default_ipv4']['address'] }}"
- "First App server {{ groups.app_servers[0] }}"
verbosity: 2
- name: Smoketest Postgres database
postgresql_ping:
db: flask_db
login_host: "{{ hostvars['appdb1']['ansible_default_ipv4']['address'] }}"
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://frontend1/ping"
return_content: yes
until: '"alive" in result.content'
retries: 10
delay: 1
register: result
delegate_to: localhost
...