summaryrefslogtreecommitdiff
blob: c06b35a3237d55e191c3d78d4f2a6ae560aec2f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash

set -x
set -e

here=$(dirname $0)

GROUP_PLAYBOOK=$1
INVENTORY="$here/inventory/inventory"

# More debug options from ansible docs about auto-provisioning...
# (mostly disables built-in checks and overrides some defaults)
# (broken across lines so all the options are easier to see):
# PYTHONUNBUFFERED=1
# ANSIBLE_FORCE_COLOR=true
# ANSIBLE_HOST_KEY_CHECKING=false
# ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o ControlMaster=auto -o ControlPersist=60s'
# ansible-playbook
# --private-key=/home/someone/.vagrant.d/insecure_private_key
# --user=vagrant
# --connection=ssh
# --limit='machine1'
# --inventory-file=/inventory/vagrant_ansible_inventory
# playbook.yml

# "debug" below formats output as properly indented/pretty printed.
# You can also replace "debug" with "yaml" for a different view.
# For details of all stdout callbacks, see:
# https://docs.ansible.com/ansible/2.5/plugins/callback.html
# and/or
# ansible-doc -t callback -l

# The following assumes you are testing per-host playbooks and the
# host(s) you are testing are a prefix of the playbook name.
# e.g. if your host name is "webby" and you test playbook "web",
#      that's a valid prefix match ("web" is a prefix of "webby")
#      or, you can use direct names: deploy to mailmash using mailmash.yml
ANSIBLE_STDOUT_CALLBACK=debug PYTHONUNBUFFERED=1 ansible-playbook -v --inventory $INVENTORY \
    -l $GROUP_PLAYBOOK \
    "$here/$GROUP_PLAYBOOK.yml" \
    --ask-pass --ask-become-pass
Powered by cgit v1.2.3 (git 2.41.0)