Skip to content

Instantly share code, notes, and snippets.

@juliedavila
Created February 4, 2015 14:24
Show Gist options
  • Save juliedavila/d2ae0cdc6720b8b5e3ba to your computer and use it in GitHub Desktop.
Save juliedavila/d2ae0cdc6720b8b5e3ba to your computer and use it in GitHub Desktop.
Rough example of openssl vuln patch
---
- name: Patching Heartbleed
hosts: "{{ hosts }}"
sudo: yes
tasks:
- name: Detect if Vulnerable
command: openssl -b
register: results
ignore_errors: yes
- name: Patching APT based packages
apt: upgrade={{ item }} update_cache=yes
when: ansible_os_family == "Debian" and results.stdout contains "build date SOMEDATE"
notify: Restart Host
with_items:
- libssl
- etc
handlers:
- name: Restart Host
command: /sbin/reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment