尝试通过Linux计算机的ansible中的任务更改密码:
- name: change password for postgres
expect:
command: passwd postgres
responses:
(?i)password: "mypassword"
become: true
此任务不会失败,但似乎也无法根据需要更改密码。
在Linux passwd postgres
上手动运行命令时,我看到它要求我输入两次密码。
我想知道,难道没有更优雅的方式来更改密码吗?