
On Tue, Jan 19, 2021 at 04:41:42PM +0800, Wang Yong wrote:
On Tue, Jan 19, 2021 at 03:20:32PM +0800, Zhang Yale wrote:
[ideology] 1. This script can test hundreds of the ansible roles in upstream git repo. 2. ansible roles are supported for the EL platform which has 11257 results in ansible-galaxy official website. 3. For testing ansible git repo, those cannot be tested in a unified way, I mainly test ansible roles git repo, and these roles repo will be more and more.
[why] Command "ansible-playbook site.yml" can run in localhost, and only need to create an entry YAML file in which the value of hosts is localhost, for example "site.yml", created in the directory at the same level as the roles directory, which can invoke roles in it. And it dose not need to create a host file in $ansible_path.
``` site.yml --- - hosts: localhost roles: - roles: ansible-role-nginx ``` ansible-role-nginx which is an role in ~/.ansible/roles, can install from galaxy or git clone from github.
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- tests/ansible_test | 94 +++++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 39 deletions(-)
diff --git a/tests/ansible_test b/tests/ansible_test index 09e5ca9e..193bd7e1 100755 --- a/tests/ansible_test +++ b/tests/ansible_test @@ -1,59 +1,75 @@ #!/bin/bash -# username -# rolename -# ansible_host -# ansible_user -# ansible_python_interpreter - -[ -n "$username" ] || echo "username is empty" -[ -n "$rolename" ] || echo "rolename is empty"
use die "xxx" is better?
ok, in fact, I had use die in new patch
-[ -n "$ansible_host" ] || $ansible_host=localhost -[ -n "$ansible_user" ] || $ansible_user=root -[ -n "$ansible_python_interpreter" ] || $ansible_python_interpreter=/user/bin/python3 - -build_mutual_trust() +# - ansible_repo + +set -x
this line should delete
ok Thanks, Yale
Thanks, Yong