-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWeb Install and Verification collections.yml
59 lines (52 loc) · 2.03 KB
/
Web Install and Verification collections.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
---
- name: Install web server, insert an index page, verify service is started and that the index page appears
hosts: "{{ vm_name | default('all') }}"
gather_facts: false
tasks:
- name: RHEL Apache config
ansible.builtin.include_role:
name: webservers_collection
when: os is match("rhel.*") or os == "Red Hat BYOL Linux"
tags:
- always
- name: Windows IIS config
ansible.builtin.include_role:
name: webservers_collection
when: os is match("windows.*") or os is match("2016.*") or os == "Windows"
tags:
- always
post_tasks:
- name: Check that you can connect to the index page and that the hostname is in the contents
ansible.builtin.uri:
url: https://{{ ansible_host }}
validate_certs: false
return_content: true
register: this
failed_when: inventory_hostname not in this.content
when: os is match("rhel.*") or os == "Red Hat BYOL Linux"
tags:
- updaterhel
- name: Check that you can connect to the index page and that the hostname is in the contents
ansible.windows.win_uri:
url: https://{{ ansible_host }}
validate_certs: false
return_content: true
register: this
failed_when: inventory_hostname not in this.content
when: os is match("windows.*") or os is match("2016.*") or os == "Windows"
tags:
- updatewin
- name: Print web address
ansible.builtin.debug:
msg: Web address is https://{{ ansible_host }}
- name: Set stats for the e-mail body and ServiceNow
ansible.builtin.set_stats:
data:
email_body: "{{ fqdn }}: https://{{ ansible_host }} "
work_notes: "[code]<a href='https://{{ ansible_host }}'>{{ fqdn }}</a>[/code] "
expose_to_cloud_redhat_com_results: "{{ fqdn }}: https://{{ ansible_host }}"
- name: Set stats for the e-mail subject # noqa run-once[task]
ansible.builtin.set_stats:
data:
email_subject: Ansible VM Web Link
run_once: true