Ansible-在Linux中更改用户密码

时间:2019-06-28 06:47:54

标签: linux ansible

尝试通过Linux计算机的ansible中的任务更改密码:

- name: change password for postgres
  expect:
    command: passwd postgres
    responses:
      (?i)password: "mypassword"
  become: true

此任务不会失败,但似乎也无法根据需要更改密码。
在Linux passwd postgres上手动运行命令时,我看到它要求我输入两次密码。

我想知道,难道没有更优雅的方式来更改密码吗?

0 个答案:

没有答案