Check if security updates needed on Ubuntu servers
Here's an Ansible playbook that will output a message for each server that requires a security update.
- name: check if security updates are needed
hosts: myhosts
tasks:
- name: apt-check
shell: "/usr/lib/update-notifier/apt-check 2>&1 | cut -d ';' -f 2"
changed_when: false
register: security_update
- debug: msg="Security update required"
when: security_update.stdout != "0"
Written by Lorin Hochstein
Related protips
1 Response
Excellent tips. Thanks
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#