I retried the playbook and I rectify a previous assertion: with '*gather_facts: 
no*', the *facts are read from the cache* as expected.
However,  I confirm that with  '*gather_facts: yes*', the *facts are always 
gathered from the remote host, regardless of the cache  timeout value.*

I also tried the same playbook over a compute node (Ubuntu server) (without 
'ansible_connection: network_cli' of course) , and I got the same results: 
the facts are always gathered from the remote device at each run with  
'*gather_facts: 
yes*'

It seems that I'm misunderstanding the real meaning of gather_facts and the 
primary goal of the thread does not seem to be implemented by ansible and 
should be manually implemented somehow by the user.
I suppose that it also means that when the cache timeout expires, all the 
'ansible_facts' data disappear from the cache and that's it. If nothing is 
done by the user to gather them from the remote device, they are not 
accessible anymore.
If the timeout expiration is supposed to trigger some background facts 
gathering from the remote device, it must happen during some playbook run, 
otherwise it is lost.

- If I run the first playbook with '*gather_facts: yes*'*, *then run it 
before the cache timeout expires with '*gather_facts: no*', the 
'ansible_facts' continue to be accessible.
- however, if I run the first playbook with '*gather_facts: yes*'*, *wait 
for the cache timeout to expire and then run it with '*gather_facts: no*', 
the 'ansible_facts' are not accessible anymore. Nothing is triggered.

Is the last behavior expected?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5137df6b-df57-4be5-87dd-86c1a3511991n%40googlegroups.com.

Reply via email to