-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_jws_and_webapp.yml
39 lines (34 loc) · 1.15 KB
/
install_jws_and_webapp.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
---
- hosts: all
gather_facts: true
become: yes
become_user: root
vars_files:
- vars.yml
collections:
- middleware_automation.jws
roles:
- jws
tasks:
- ansible.builtin.include_tasks: tasks/deploy_app.yml
post_tasks:
- name: "Wait for port {{ jws_listen_http_port }} to be available (ensure that JWS has finished restarting)"
ansible.builtin.wait_for:
port: "{{ jws_listen_http_port }}"
- name: "Set path to result file: {{ path_to_result_file }}"
ansible.builtin.set_fact:
result_file: "{{ path_to_result_file }}"
- name: "Define URL to deployed webapp: {{ app_path }}."
ansible.builtin.set_fact:
url_to_webapp: "http://{{ jws_listen_http_bind_address }}:{{ jws_listen_http_port }}/{{ app_id }}/"
- name: "Check that deployed webapp is accessible: {{ url_to_webapp }}"
ansible.builtin.get_url:
url: "{{ url_to_webapp }}"
dest: "{{ result_file }}"
register: res
- name: "Check that request was successfully processed"
ansible.builtin.assert:
that:
- res is defined
- res.status_code in [200, 304]
quiet: true