Change own password from non-root account

24 views
Skip to first unread message

mhh

unread,
Jan 30, 2017, 9:03:53 AM1/30/17
to Ansible Project
Is possible to change own password from non-root account ?
I found example, but it is not working. I did not find any info about ansible_ssh_newpass variable.


Playbook
- hosts: my
tasks:
- shell: 'printf "%s\n" oldpass newpass newpass | passwd'

Iventory
[my]
myexample.com

[my:vars]
ansible_connection=ssh
ansible_ssh_user=myuser
ansible_ssh_pass=oldpass
ansible_ssh_newpass=newpass
ansible_ssh_common_args='-o StrictHostKeyChecking=no'


http://serverfault.com/questions/779165/via-ansible-change-password-of-non-root-account-using-passwd-command-and-picking?answertab=votes#tab-top



EDIT:
I found that shell: 'printf "%s\n" oldpass newpass newpass | passwd' actually works only when your password is not expired, and if you already logged on the server.
Can anyone confirm it? Is there any proper way to change it? Thanks

Brian Coca

unread,
Jan 30, 2017, 9:49:52 AM1/30/17
to ansible...@googlegroups.com
The variable ansible_ssh_newpass is not something Ansible knows about nor supports.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages