set_fact retain the fact between run?

37 views
Skip to first unread message

Steve Kieu

unread,
Dec 4, 2014, 8:17:09 PM12/4/14
to ansible...@googlegroups.com
Hi Team,

I read that it is retained between each play.

So I got

TASK: [web_base | set fact CUSTOMER_LOCATOR_PORT] *****************************
ok: [demo-web-kr] => {"ansible_facts": {"CUSTOMER_LOCATOR_PORT": "52360"}}

But then I run
ansible -i hosts 'demo-web-kr' -u root -k -msetup|grep LOCATOR

found nothing about that variable. (I did remove the grep and search for it :-) .

And it looks like the same when using ansible-playbook. In the real example on my hosts file I set

CUSTOMER_LOCATOR_PORT="{{ansible_CUSTOMER_LOCATOR_PORT|default(60000|random(50000,10))}}"

and the set_fact is in one of the role task but it does not work - that means it changes every time I run playbook.

Any idea why?

thanks in advance.

Michael DeHaan

unread,
Dec 4, 2014, 8:19:38 PM12/4/14
to ansible...@googlegroups.com

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/86822515-e83b-43d1-8963-9f0fd8b1d6af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages