Skip to content

Instantly share code, notes, and snippets.

@timss
Last active February 28, 2017 16:05
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 timss/813a98ae4ab1ccab47f4b21ea8b194a3 to your computer and use it in GitHub Desktop.
Save timss/813a98ae4ab1ccab47f4b21ea8b194a3 to your computer and use it in GitHub Desktop.
Ansible 'become' clause for include statements
# ./roles/foo/tasks/main.yml
- include: foo.yml
- include: foo.yml
become: yes
# ./roles/foo/tasks/foo.yml
- lineinfile:
dest: "~/.bashrc" # resolves '~' on runtime as any other command', unlike ansible_env.HOME
regexp: "^HISTSIZE=.*"
line: "HISTSIZE=10000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment