如何成为一个非root用户,而使用(delegate_to)在可转换的剧本?



在这个ansible-playbook中,我将一个任务委托给服务器以非root用户运行,但每次它都以root用户运行。你能告诉我我哪里做错了吗?

- name: Set access to starz app
become: yes
become_user: starz
command: giveaccess {{ inventory_hostname }} {{ access_app_port }}
delegate_to: "{{starz_central_node}}"

插入"remote_user"字段,而不是"become_user"。我仍然不明白为什么当delegate_to字段存在时,become_user不工作。

尝试设置become_method: doas.

最新更新