
On Mon, Jan 11, 2021 at 08:44:49AM +0800, Wang Yong wrote:
On Sat, Jan 09, 2021 at 08:46:38PM +0800, Zhang Yale wrote:
This script can be invoked to run the ansible command to deploy ansible-roles which you specified in your environment.
Signed-off-by: Zhang Yale <ylzhangah@qq.com> --- tests/ansible_test | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 tests/ansible_test
diff --git a/tests/ansible_test b/tests/ansible_test new file mode 100755 index 00000000..09e5ca9e --- /dev/null +++ b/tests/ansible_test @@ -0,0 +1,59 @@ +#!/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
+ #ansible all -m authorized_key -a "user=root key='{{ lookup('file', '/root/.ssh/id_rsa.pub') }}' path=/root/.ssh/authorized_keys manage_dir=no" --ask-pass -c paramiko
space after #
Thanks, Yong
Good! I got it. Thanks, Yale