forked from beniaris-zz/system_administration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch-process.yml
58 lines (48 loc) · 1.23 KB
/
patch-process.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
---
# Example patching a process
#
# Outline:
# 1.
#
- name: Patch process for RHEL
hosts: all
remote_user: ansibleop
become: yes
tasks:
- name: Update the Change Order
debug:
msg: Updating the Change Order to flag host update
- name: Perform Backup or Snapshot
debug:
msg: Initiating backup/snapshot
- name: Disable Monitoring of system
debug:
msg: Disable alerts for system during the patch process
- name: Install the latest patches allowed by the Content View
yum:
name: '*'
state: latest
# exclude: kernel*
register: yum_update
- name: Restart the system
reboot:
msg: Automated reboot initiated via Ansible Tower automation
post_reboot_delay: 25
reboot_timeout: 200
when: yum_update.changed
- name: Install the kpatch RPM
yum:
name: kpatch
state: latest
- name: Start the kpatch.service
service:
name: kpatch.service
enabled: yes
state: started
- name: Enable Monitoring of system
debug:
msg: Enable monitoring
- name: Close Change Order
debug:
msg: Add logs to change order and close it
...