diff options
Diffstat (limited to 'roles/local_deploy/files')
-rw-r--r-- | roles/local_deploy/files/ansible_run.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/roles/local_deploy/files/ansible_run.sh b/roles/local_deploy/files/ansible_run.sh index db4888f..4430224 100644 --- a/roles/local_deploy/files/ansible_run.sh +++ b/roles/local_deploy/files/ansible_run.sh @@ -1,3 +1,13 @@ #!/bin/sh cd /etc/ansible -ansible-playbook -l "$(hostname -f)," -c local playbooks/deploy.yml +for i in local $(hostname -s) $(hostname -f); do + FILE=playbooks/${i}.yml + [ -f $FILE ] && RESULT=$FILE +done + +if [ -n $RESULT ]; then + ansible-playbook -c local $RESULT +else + echo "No playbook for this host found" + exit 1 +fi |