I want auto script,but something error

my centos deny remoteroot login and how can i improve
it my code

  • hosts: 192.168.30.75

remote_user" chtadm
become: true
become_user: root
tasks:
copy:
src: /tmp/kevin/test
dest:/tmp
owner:root
group:root
mode:0744

it’s my ansbile-vault
192.168.30.75 remote_user=root remote_pass=1qaz@WSX

and i input ansible-playbook test.yml --ask-vault-pass
display error:
the error appears to have been in ‘/tmp/kevin/test.yml’ : line 3,column 3,but may be elsewhere in the file depending on the exact syntax problem.

The error is probably because of this line:

  remote_user" chtadm

But you should turn off the remote_user: root in the vault if
you don't want to SSH directly as root.

Hi Davies:
thanks,i cant direct use root,because my linux policy is permitrootlogin no !!

Best Regards!!

王慧勳於 2017年5月2日星期二 UTC+8上午2時20分48秒寫道:

Yes, but this :

192.168.30.75 remote_user=root remote_pass=1qaz@WSX

says to login directly as root, so don't do that.

The error is

remote_user" chtadm

instead of

remote_user: chtadm