Skip to content

Instantly share code, notes, and snippets.

@drybjed
Created April 15, 2014 10:10
Show Gist options
  • Save drybjed/10719925 to your computer and use it in GitHub Desktop.
Save drybjed/10719925 to your computer and use it in GitHub Desktop.
---
- hosts: all
vars:
the_user: '{{ lookup("env","USER") }}'
tasks:
- shell: groups {{ the_user }} > /tmp/file1
- user: name={{ the_user }} append=yes groups=www-data
sudo: True
- shell: groups {{ the_user }} > /tmp/file2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment