Skip to content

Instantly share code, notes, and snippets.

[defaults]
hostfile = hosts
@5car1z
5car1z / meltdown-spectre-linux.yml
Last active November 27, 2018 14:19
Meltdown and Spectre Kernel Upgrade Packages for Ansible
# https://meltdownattack.com
- name: Patch Linux systems against Meltdown and Spectre
hosts: "{{ target_hosts | default('all') }}"
become: yes
vars:
reboot_after_update: yes
packages:
# https://access.redhat.com/security/vulnerabilities/speculativeexecution
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
###
# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
@5car1z
5car1z / fail2ban-playbook.yml
Last active December 9, 2023 18:42
Simple Ansible playbook to install Fail2ban.
---
- name: installs fail2ban on ansible hosts
hosts: fail2ban-hosts
become: yes
tasks:
- name: install apt fail2ban packages
apt:
name: "{{ item }}"
state: latest
@5car1z
5car1z / jail.local
Created May 18, 2018 15:57
Fail2ban Jail configuration file; for an Ansible playbook example.
[DEFAULT]
# email address to receive notifications.
destemail = root@localhost
# the email address from which to send emails.
sender = root@<fq-hostname>
# name on the notification emails.
sendername = Fail2Ban
# email transfer agent to use.
mta = sendmail