forked from ansible/product-demos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatching.yml
59 lines (51 loc) · 1.71 KB
/
patching.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: Linux server patching
hosts: "{{ _hosts | default(omit) }}"
become: true
vars:
report_server: reports
tasks:
# Install yum-utils if it's not there
- name: Install yum-utils
ansible.builtin.yum:
name: yum-utils
state: installed
- name: Include patching role
ansible.builtin.include_role:
name: demo.patching.patch_linux
- name: Tell user when Insights Client is not configured
ansible.builtin.debug:
msg: "Insights client does not appear to be configured. Scan will be skipped"
when:
- ansible_local.insights.system_id is not defined
- name: Run the Insights Client Scan # noqa: no-changed-when
ansible.builtin.command: insights-client
when:
- not ansible_check_mode
- ansible_local.insights.system_id is defined
- name: Deploy report server
when: not ansible_check_mode
delegate_to: "{{ report_server }}"
run_once: true # noqa: run-once[task]
block:
- name: Install firewall dependencies
ansible.builtin.dnf:
name:
- firewalld
- python3-firewall
state: present
- name: Start firewalld
ansible.builtin.service:
name: firewalld
state: started
- name: Build report server
ansible.builtin.include_role:
name: "{{ item }}"
loop:
- demo.patching.report_server
- demo.patching.report_linux
- demo.patching.report_linux_patching
- name: Publish landing page
ansible.builtin.include_role:
name: demo.patching.report_server
tasks_from: linux_landing_page