Last active
November 28, 2017 10:15
-
-
Save BjornW/40f8b95a2030aba9f5ca1cf952bc88c7 to your computer and use it in GitHub Desktop.
One-liner to replace sudo in Ansible playbook roles with become
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
grep -irl 'sudo' . | xargs sed -i 's/sudo: yes/become: true/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run this in the directory of your Ansible Playbook & roles and it will replace all occurrences of 'sudo: yes' with 'become: true'. This assumes become's default user is root.