#!/bin/bash daemon=nginx notags_tmp=`ls -1 *ml | sed -r 's/\.ya?ml$//'` notags=`echo $notags_tmp | sed 's/ /|/g'` [[ -z $2 ]] && echo "usage: ${0##*/} <$notags>" && exit 1 target=$1 notag=$2 [[ ! -f $notag.yml ]] && echo cannot find $notag.yml && exit 1 ansible-playbook $notag.yml -i ../../inventory/$daemon -e "target=$target" --diff --check echo ready? read -r ansible-playbook $notag.yml -i ../../inventory/$daemon -e "target=$target" --diff