gpt4 book ai didi

postgresql - 如何使用ansible设置postgres密码

转载 作者:行者123 更新时间:2023-12-02 02:42:43 24 4
gpt4 key购买 nike

通常我这样做:

sudo -su postgres
psql
\password
\q

更改 postgres 密码。现在我想使用 ansible 自动执行此步骤。

最佳答案

Ansible postgresql_user 模块将帮助设置/重置数据库用户密码。这是示例

- name: pd reset database user
become: yes
become_method: sudo
become_user: postgres
postgresql_user:
db: test
name: test
password: ""

作为引用,这里是ansible链接:https://docs.ansible.com/ansible/latest/collections/community/postgresql/postgresql_user_module.html#ansible-collections-community-postgresql-postgresql-user-module

关于postgresql - 如何使用ansible设置postgres密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63303090/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com