Re: [ansible-project] Re: Ansible set variable task?

2014-03-22 Thread Brian Coca
getent facts module https://github.com/ansible/ansible/pull/6625 -- 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 ansible-project+unsubscr...@googlegroups.com.

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Michael DeHaan
If you do ansible hostname -m setup in recent versions, you should see that environment variables are provided, in which case you can pull $HOME from there. This of course would only work for the active user. http://docs.ansible.com/faq.html#how-do-i-access-shell-environment-variables On

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Grant BlahaErath
Okay, my example kind of sucks and I'm not surprised that you noticed. I had to implement this approach after finding that ansible_env.HOME did what it should, but not what I needed. The playbooks run with sudo: yes because it was maddening to declare sudo state for each task.That makes

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Michael DeHaan
I had to implement this approach after finding that ansible_env.HOME did what it should, but not what I needed. Yep! The HOME environment variable is not always predictable in sudo scenarios. On Fri, Mar 21, 2014 at 7:52 PM, Grant BlahaErath gr...@spryhive.comwrote: Okay, my example kind

Re: [ansible-project] Re: Ansible set variable task?

2014-03-21 Thread Will Thames
Surely the result is still in userhome.stdout Since this thread was created, (and still a good while ago) set_fact was invented set_fact: new_variable={{result.stdout}} On 22 Mar 2014, at 09:57, Brian Coca brianc...@gmail.com wrote: shell: 'getent passwd user |cut -f 6 -d : ' register: