2016-11-11 05:47:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-01-17 14:33:33 +00:00
|
|
|
set -eux -o pipefail
|
2016-11-11 05:47:12 +00:00
|
|
|
|
|
|
|
ansible --version
|
2017-05-11 05:25:02 +00:00
|
|
|
ansible --help
|
|
|
|
|
|
|
|
ansible testhost -i ../../inventory -m ping "$@"
|
|
|
|
ansible testhost -i ../../inventory -m setup "$@"
|
2018-01-17 14:33:33 +00:00
|
|
|
|
|
|
|
ansible-config -c ./ansible-testé.cfg view | grep 'remote_user = admin'
|
|
|
|
ansible-config -c ./ansible-testé.cfg dump | grep 'DEFAULT_REMOTE_USER([^)]*) = admin\>'
|
|
|
|
ANSIBLE_REMOTE_USER=administrator ansible-config dump| grep 'DEFAULT_REMOTE_USER([^)]*) = administrator\>'
|
|
|
|
ansible-config list | grep 'DEFAULT_REMOTE_USER'
|
|
|
|
|
|
|
|
# 'view' command must fail when config file is missing
|
|
|
|
ansible-config -c ./ansible-non-existent.cfg view && exit 1 || echo 'Failure is expected'
|