How to switch a user per task or set of tasks?
With Ansible 1.9 or later Ansible uses the become, become_user, and become_method directives to achieve privilege escalation. You can apply them to an entire play or playbook, set them in an included playbook, or set them for a particular task. – name: checkout repo git: repo=https://github.com/some/repo.git version=master dest={{ dst }} become: yes become_user: some_user You … Read more