Skip to content

Instantly share code, notes, and snippets.

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@rothgar
rothgar / main.yml
Last active March 8, 2024 07:16
Generate /etc/hosts with Ansible
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source.
# Will include all hosts the playbook is run on.
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html
- name: "Build hosts file"
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present
when: hostvars[item].ansible_default_ipv4.address is defined
with_items: groups['all']
@seth-paxton
seth-paxton / gist:d19571620e8986c2ef1a
Created October 6, 2014 22:27
Sensu Remediate Example
1. Download the plugin from: https://github.com/sensu/sensu-community-plugins/blob/master/handlers/remediation/sensu.rb
2. Create the handler definition:
{
"handlers": {
"remediator": {
"type": "pipe",
"command": "/etc/sensu/handlers/remediator.rb"
}
}
}
@mrbobbytables
mrbobbytables / 100-mesos.groovy
Last active March 9, 2016 13:17
jenkins mesos dynamic config
#!/usr/bin/env groovy
/*
Fairly self explanatory if you look at the options in the UI.
Main thing to note is the JENKINS_MESOS_SLAVE_<number>. Anything with the same
number will be associated together option wise.
For things like JENKINS_MESOS_SLAVE_<number>_VOL_<number> The trailing
number just signifies more than one.
--Available Environment Variables --