forked from redhat-partner-tech/automated-smart-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_patch.yml
More file actions
30 lines (26 loc) · 781 Bytes
/
server_patch.yml
File metadata and controls
30 lines (26 loc) · 781 Bytes
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
---
- hosts: "env_{{ lifecycle_stage }}"
become: yes
vars:
check_only: yes
tasks:
- name: check operating system
assert:
that: "ansible_os_family == 'RedHat'"
- name: check for updates
yum:
name: '*'
state: latest
exclude: kernel*
check_mode: "{{ check_only }}"
register: updates
- name: output updates dictionary
debug:
msg: "{{ updates }}"
- name: updated package list
debug:
msg: "{% if item[0] in packages %}{{ packages[item[0]][0].version }}-{{ packages[item[0]][0].release }}.{{ packages[item[0]][0].arch }} >>> {{ item[1] }} {% else %} {{ item[1] }}{% endif %}"
loop: "{{ updates.changes.updated }}"
loop_control:
label: "{{ item[0] }}"
when: updates.changes is defined