m4rcu5nl / ansible-role-zerotier

Ansible role to install Zerotier-One and join a Zerotier network
GNU General Public License v3.0
78 stars 50 forks source link

Module is not idempotent #28

Open snesbittsea opened 5 years ago

snesbittsea commented 5 years ago

Heya!

Not sure this is a bug or a misunderstanding on my part.

The role is not idempotent - the Update ansible_local facts block always reports changed.

Also, if the purpose here is to reload inventory, I think there may be another option using the meta module with the refresh_inventory setting.

m4rcu5nl commented 5 years ago

Technically not a bug. I think we can call it laziness. That block runs a script that generates the file /etc/ansible/facts.d/zerotier.fact on target hosts and I did not give it a proper changed_when condition.

I'm reworking that block to not generate a static file and update that each play but rather use an executable python script for /etc/ansible/facts.d/zerotier.fact that returns up to date JSON data on request. That will eliminate the need for the update and reload tasks altogether.

Thanks for bringing the meta module to my attention again. Haven't had a need for it in quite a while and I was not aware of some of it's newer features yet.

JakobLichterfeld commented 1 year ago

As the PR #39 was never merged and the base repo is deleted, this still persists. No impotence