^ Ansible 2.3

On Friday, May 26, 2017 at 9:34:01 AM UTC-4, Stephen Matyas wrote:
>
> Context: I'm running my playbook against a docker container that is local 
> to ansible's control machine. 
>
> All of the various examples below result in files that are owned by `root` 
> instead of `<username>` (become_user). One caveat *might* be that my 
> `<username>` has a `/sbin/nologin` shell defined for it's account. 
>
> Now, when I run the following in the Docker container directly the results 
> are what I expect:
> su <username> -s /bin/bash -c "<command>"
>
>
> - name: Create virtualenv for {{ package_name }}
>   shell: "{{ package_virtualenv }}  --python={{ package_python }} {{ 
> package_virtualenv_dir }}"
>   become: yes
>   become_user: '<username>'
>   when: check_venv_path.stat.exists == false
>
>
> - name: Create virtualenv for {{ package_name }}
>   shell: "{{ package_virtualenv }}  --python={{ package_python }} {{ 
> package_virtualenv_dir }}"
>   become: yes
>   become_user: '<username>'
>   become_method: su
> #  become_flags: '-s /bin/bash'
>   when: check_venv_path.stat.exists == false
>
>
> - name: Create virtualenv for {{ package_name }}
>   shell: "{{ package_virtualenv }}  --python={{ package_python }} {{ 
> package_virtualenv_dir }}"
>   become: yes
>   become_user: '<username>'
>   become_method: su
>   become_flags: '-s /bin/bash'
>   when: check_venv_path.stat.exists == false
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6ef2c7ea-7163-4784-a3a3-4b824916096d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to