Skip to content

Instantly share code, notes, and snippets.

---
- hosts: all
  sudo: yes
  tasks:
    - name: Remove user ubuntu
      user: name=ubuntu remove=yes state=absent
- hosts: all
  tasks:
    
    - name: set marker
      set_fact:
        marker: marker
    
    - name: group by marker
 group_by: key=marker
#!/bin/bash
ls ~/.ssh/config.d/ | {
echo -n '' > ~/.ssh/config
while read file
do
cat ~/.ssh/config.d/$file >> ~/.ssh/config
echo '' >> ~/.ssh/config
done
}
#!/bin/sh -ux
on_die()
{
echo "Dying..."
exit 0
}
trap 'on_die' TERM INT
@hryamzik
hryamzik / role_to_submodule.md
Created June 25, 2015 13:58
role to submodule

Convert a git folder to a submodule retrospectively

Correct answer

path=roles/
target=openvpn
reponame=ansible-role-${target}
fullpath=${path}${target}
#!/bin/bash
repo="$(git config --get remote.origin.url|sed -E 's/http(s)?:[/]{2}([^/]+)[/]/git@\2:/')"
test -n "$repo" || repo="$PWD"
if ! security find-generic-password -gw -s "$repo" -a "ansible-vault" -D "ansible vault"
then
echo "Enter password for $repo:" 1>&2
read pass
d-i partman-auto/disk string /dev/sda /dev/sdb /dev/sdc
d-i partman-auto/method string raid
d-i partman-auto-lvm/new_vg_name string vg_big
d-i partman-auto/expert_recipe string \
raid-lvm :: \
512 10 512 raid \
$primary{ } $lvmignore{ } $bootable{ } \
method{ raid } \
. \

This is not a generic postgres role, it's sverka-tuned one!

Replication setup, performed from master

slave=192.168.160.1
master=192.168.160.120
ssh $slave hostname
search_index: /srv/graphite/index
finders:
- cyanite.CyaniteFinder
cyanite:
urls:
{% for host in groups[cyanite_hosts_group] %}
{% set j_proto = 'https' if hostvars[host].cyanite_https is defined and hostvars[host].cyanite_https else 'http' %}
{% set j_port = hostvars[host].cyanite_api_port|default(default_cyanite_api_port) %}
{% if hostvars[host]['cyanite_access_by_inventory_hostname_not_ip'] is defined and hostvars[host]['cyanite_access_by_inventory_hostname_not_ip'] %}
{% set j_addr = hostvars[host]['inventory_hostname'] %}
TASK: [ruby-rvm | check if RVM is installed] **********************************
fatal: [dev01.reviseapp.net] => Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to template {{ var }}: Failed to t