Skip to content

Instantly share code, notes, and snippets.

@chrisdev
Created May 23, 2016 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdev/bab4c0116e722e8cb8dd562581a2fc5d to your computer and use it in GitHub Desktop.
Save chrisdev/bab4c0116e722e8cb8dd562581a2fc5d to your computer and use it in GitHub Desktop.
Sudo setting in Ansible Old vs New Playbook
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