ansible-playbook main.yaml -i hosts --user=git -k --become-user=root --ask-become-pass --become-method=su
请告诉我如何实现这一点.
name: Install and Configure IEMhosts: rhelansible_become: yesansible_become_method: suansible_become_user: rootansible_become_pass: passw0rdtasks: - name: Creating masthead file path file: path=/etc/opt/BESClIEnt state=directory - name: Creating install directory解决方法 我用 :
deploy.yml
- name: Todo something hosts: all become: yes become_user: root become_method: su
当您执行playbook时,将密码作为额外的var传递.
--extra-vars='ansible_become_pass=password'总结
以上是内存溢出为你收集整理的ansible – 如何定义登录用户并成为playbook中的root用户全部内容,希望文章能够帮你解决ansible – 如何定义登录用户并成为playbook中的root用户所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)