As discussed at here a long time ago
state=import will import the given file unconditionally.
There's a good chance the database has been updated since the original run
of ansible, so this behavior means users should never run ansible after the
server goes public.
The link above discusses several options for only running import once, but
the nuances and trade-offs of each are lost on me as a non-expert.
I would suggest that, since we're not talking about a write-once sort of
target like conf files in /etc, this behavior is bad. In fact, it just now
nearly wiped out a bunch of data for me as I made a configuration change
and confidently (stupidly?) re-ran my ansible script.
The import function should refuse to import data if there's already data in
the database. Or, it shouldn't be it's own 'state' (not really a state)
and be a part of the actions done for state == 'present'.
Have I convinced anybody? If so, I'll file a bug on GitHub... didn't want
to clutter that if I'm off the mark.
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 post to this group, send email to firstname.lastname@example.org.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.