diff options
author | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
commit | 1204730924436ef9e1c7c49c9557837f9a5ed0e8 (patch) | |
tree | 129d79dfd11245751cee6d4082ff5d2f6e941610 /ansible/runner.sh | |
parent | 9635ac4dedf69de5bff65785bcc16bef80b52d75 (diff) | |
download | mail-master.tar.gz |
Diffstat (limited to 'ansible/runner.sh')
-rwxr-xr-x | ansible/runner.sh | 41 |
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 | |||
3 | set -x | ||
4 | set -e | ||
5 | |||
6 | here=$(dirname $0) | ||
7 | |||
8 | GROUP_PLAYBOOK=$1 | ||
9 | INVENTORY="$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 | ||
38 | ANSIBLE_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 | ||