Thanks Will.
I did not know about set_facts. I am not surprised that I got the
search term wrong. If we are lucky, this thread will bridge the two
lexical choices in the goog.
I modified my snippet to look like this.
pre_tasks:
- name: Get ansible_user home directory
shell: 'getent passwd "{{ansible_ssh_user}}" | cut -d: -f6'
register: ansible_home_result
- name: Set the fact for the other scripts to use
set_fact: ansible_home='{{ansible_home_result.stdout}}'
I also submitted a pull for a doc change in the variable documentation
since it was the first place i went looking for answers.
On 3/21/14, 5:00 PM, Will Thames wrote:
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 <[email protected]
<mailto:[email protected]>> wrote:
shell: 'getent passwd <user> |cut -f 6 -d ":" '
register: userhome
--
You received this message because you are subscribed to a topic in
the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/wqiclLkqmGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CADn%2BHszUR%3DzcKWDjiiS0OXDMLuz_6-hg1oHOw93s502uDv8A0w%40mail.gmail.com
<https://groups.google.com/d/msgid/ansible-project/CADn%2BHszUR%3DzcKWDjiiS0OXDMLuz_6-hg1oHOw93s502uDv8A0w%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the
Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/wqiclLkqmGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6B08BD98-9E7D-468C-BD6B-B1EAF0C5A0A4%40thames.id.au
<https://groups.google.com/d/msgid/ansible-project/6B08BD98-9E7D-468C-BD6B-B1EAF0C5A0A4%40thames.id.au?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
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/5330B417.5060502%40spryhive.com.
For more options, visit https://groups.google.com/d/optout.