2016-11-11 06:47:12 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-01-17 15:33:33 +01:00
|
|
|
set -eux -o pipefail
|
2016-11-11 06:47:12 +01:00
|
|
|
|
|
|
|
ansible --version
|
2017-05-11 07:25:02 +02:00
|
|
|
ansible --help
|
|
|
|
|
|
|
|
ansible testhost -i ../../inventory -m ping "$@"
|
|
|
|
ansible testhost -i ../../inventory -m setup "$@"
|
2018-01-17 15:33:33 +01:00
|
|
|
|
2019-04-23 20:54:39 +02:00
|
|
|
ansible-config view -c ./ansible-testé.cfg | grep 'remote_user = admin'
|
|
|
|
ansible-config dump -c ./ansible-testé.cfg | grep 'DEFAULT_REMOTE_USER([^)]*) = admin\>'
|
2018-01-17 15:33:33 +01:00
|
|
|
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
|
2019-04-23 20:54:39 +02:00
|
|
|
ansible-config view -c ./ansible-non-existent.cfg && exit 1 || echo 'Failure is expected'
|