Skip to content

Instantly share code, notes, and snippets.

@IssacTran
IssacTran / main.yml
Created June 21, 2016 07:44 — forked from rothgar/main.yml
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']
@IssacTran
IssacTran / pedantically_commented_playbook.yml
Created June 25, 2016 16:36 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
description: Developer Project Policy
context:
project: 'gto' # GTO project
for:
resource:
- equals:
kind: job
allow: [read,run]
- equals:
kind: node
@IssacTran
IssacTran / aclpolicy-template.yaml
Created June 28, 2016 03:18 — forked from gschueler/aclpolicy-template.yaml
template aclpolicy file
description: Project scope for group
context:
project: '.*'
for:
job:
- equals:
group: 'example'
name: 'Restart'
allow: [run,read]
- equals:
@IssacTran
IssacTran / docker-compose.yml
Created June 30, 2016 02:35 — forked from autodidacticon/docker-compose.yml
docker - zookeeper, kafka, kafka-manager
zookeeper:
image: wurstmeister/zookeeper
ports:
- "32772:2181"
kafka:
image: wurstmeister/kafka:latest
ports:
- "9092"
links:
- zookeeper:zk
@IssacTran
IssacTran / 0_readme.md
Created July 4, 2016 20:56 — forked from andineck/0_readme.md
database messaging distributed kafka

database, messaging, distributed system, kafka