Created
May 23, 2016 18:59
-
-
Save chrisdev/bab4c0116e722e8cb8dd562581a2fc5d to your computer and use it in GitHub Desktop.
Sudo setting in Ansible Old vs New Playbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible 2.0 has been nagging me about this for a while | |
#Old Way with sudo and user | |
- name: apply common configruation to all nodes | |
hosts: all | |
sudo: yes | |
user: root | |
roles: | |
- common | |
#New way set remote user/become_user | |
- name: apply common configruation to all nodes | |
hosts: all | |
remote_user: django | |
become: yes | |
become_user: root | |
roles: | |
- common | |
#Not exactly a straight one to one mapping | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment