Skip to content

Instantly share code, notes, and snippets.

@joshcampbell
joshcampbell / init_ansible_role.sh
Created October 20, 2015 14:34 — forked from zircote/init_ansible_role.sh
bash function to create a boilerplate ansible role (I am lazy)
#!/bin/sh
function init_ansible_role {
if [[ ! -n $1 ]]; then
echo no init
return
fi
mkdir -p roles/${1}/{defaults,tasks,files,templates,vars,handlers,meta}
for i in defaults tasks vars handlers meta; do
if [[ ! -f roles/${1}/${i}/main.yaml ]]; then
echo creating file: roles/${1}/${i}/main.yaml