Discussion:
[ansible-project] Why do these SELinux tasks report "changed" every time?
Willard Dennis
2015-07-09 21:57:25 UTC
Permalink
Hi all,

I have two tasks in a playbook as follows:

- name: RHELFAM | Set SELinux to permissive
selinux: policy=targeted state=permissive
tags: secmods

- name: RHELFAM | Disable SELinux in conf file
selinux: state=disabled
tags: secmods

Each time they run, even if the target machine is in the desired state, the
task returns "changed"... Why would that be?

Thanks,
Will
--
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-project+***@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/5cec4a59-e5e7-475a-ac63-3c5e29604db4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brian Coca
2015-07-11 01:25:20 UTC
Permalink
well, i would expect one if not both to always return changed, I
looked at the module code and it does compare against existing state
to determine change status
--
Brian Coca
--
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-project+***@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/CAJ5XC8%3DH1RYZY3KWnG1U7rX4BW2Avkw0--AUqtfpe%3DBw%2BcATTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Willard Dennis
2015-07-11 03:31:40 UTC
Permalink
Ah, I see what you mean... the first one has state=permissive, and the next
state=disabled... So they were just bouncing back and forth... D'oh!

I guess that's why folks suggest code review as a best practice ;)

Thanks!
Will
Post by Brian Coca
well, i would expect one if not both to always return changed, I
looked at the module code and it does compare against existing state
to determine change status
--
Brian Coca
--
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-project+***@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/6888ee2d-1d8a-4013-beae-5978e7586cb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...