Skip to content

Instantly share code, notes, and snippets.

View hryamzik's full-sized avatar

Roman Belyakovsky hryamzik

View GitHub Profile
#!/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
@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/sh -ux
on_die()
{
echo "Dying..."
exit 0
}
trap 'on_die' TERM INT
#!/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
}
- hosts: all
  tasks:
    
    - name: set marker
      set_fact:
        marker: marker
    
    - name: group by marker
 group_by: key=marker
---
- hosts: all
  sudo: yes
  tasks:
    - name: Remove user ubuntu
      user: name=ubuntu remove=yes state=absent