summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/runner.sh')
-rwxr-xr-xansible/runner.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/ansible/runner.sh b/ansible/runner.sh
new file mode 100755
index 0000000..c06b35a
--- /dev/null
+++ b/ansible/runner.sh
@@ -0,0 +1,41 @@
1#!/usr/bin/env bash
2
3set -x
4set -e
5
6here=$(dirname $0)
7
8GROUP_PLAYBOOK=$1
9INVENTORY="$here/inventory/inventory"
10
11# More debug options from ansible docs about auto-provisioning...
12# (mostly disables built-in checks and overrides some defaults)
13# (broken across lines so all the options are easier to see):
14# PYTHONUNBUFFERED=1
15# ANSIBLE_FORCE_COLOR=true
16# ANSIBLE_HOST_KEY_CHECKING=false
17# ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s'
18# ansible-playbook
19# --private-key=/home/someone/.vagrant.d/insecure_private_key
20# --user=vagrant
21# --connection=ssh
22# --limit='machine1'
23# --inventory-file=/inventory/vagrant_ansible_inventory
24# playbook.yml
25
26# "debug" below formats output as properly indented/pretty printed.
27# You can also replace "debug" with "yaml" for a different view.
28# For details of all stdout callbacks, see:
29# https://docs.ansible.com/ansible/2.5/plugins/callback.html
30# and/or
31# ansible-doc -t callback -l
32
33# The following assumes you are testing per-host playbooks and the
34# host(s) you are testing are a prefix of the playbook name.
35# e.g. if your host name is "webby" and you test playbook "web",
36# that's a valid prefix match ("web" is a prefix of "webby")
37# or, you can use direct names: deploy to mailmash using mailmash.yml
38ANSIBLE_STDOUT_CALLBACK=debug PYTHONUNBUFFERED=1 ansible-playbook -v --inventory $INVENTORY \
39 -l $GROUP_PLAYBOOK \
40 "$here/$GROUP_PLAYBOOK.yml" \
41 --ask-pass --ask-become-pass
Powered by cgit v1.2.3 (git 2.41.0)