mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
ansible-config: add simple tests (#34900)
* Revert "Fix ansible-config with python3 (#34673)"
This reverts commit 2a9daaa45b
.
* ansible-config: add simple tests
* Fix ansible-config with python3
* ansible-test: don't quote "unusual" characters
This commit is contained in:
parent
93acd7c651
commit
217ff4498c
5 changed files with 19 additions and 6 deletions
2
test/integration/targets/ansible/ansible-testé.cfg
Normal file
2
test/integration/targets/ansible/ansible-testé.cfg
Normal file
|
@ -0,0 +1,2 @@
|
|||
[defaults]
|
||||
remote_user = admin
|
|
@ -1,9 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
set -eux -o pipefail
|
||||
|
||||
ansible --version
|
||||
ansible --help
|
||||
|
||||
ansible testhost -i ../../inventory -m ping "$@"
|
||||
ansible testhost -i ../../inventory -m setup "$@"
|
||||
|
||||
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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue