I am setting the immutable flag on a file (using template module). It sets the immutable flag fine on cent/rhel7, but on cent/rhel/oel6 it complains. I can set it manually on the *6 boxes just fine. Wondering why you think this may be failing. Seems like a bug with ansible to me:
ok: [ansibletest-rhel7] fatal: [ansibletest-rhel6]: FAILED! => {"changed": false, "details": "Error while setting attributes: /usr/bin/chattr: Clearing extent flag not supported on /etc/resolv.conf\n", "failed": true, "gid": 0, "group": "root", "mode": "0644", "msg": "chattr failed", "owner": "root", "path": "/etc/resolv.conf", "size": 90, "state": "file", "uid": 0} ...ignoring fatal: [ansibletest-oel6]: FAILED! => {"changed": false, "details": "Error while setting attributes: /etc/resolv.conf: Operation not supported\n", "failed": true, "gid": 0, "group": "root", "mode": "0644", "msg": "chattr failed", "owner": "root", "path": "/etc/resolv.conf", "size": 90, "state": "file", "uid": 0} ...ignoring ok: [cent7] fatal: [rhel6]: FAILED! => {"changed": false, "details": "Error while setting attributes: /usr/bin/chattr: Clearing extent flag not supported on /etc/resolv.conf\n", "failed": true, "gid": 0, "group": "root", "mode": "0644", "msg": "chattr failed", "owner": "root", "path": "/etc/resolv.conf", "secontext": "system_u:object_r:net_conf_t:s0", "size": 90, "state": "file", "uid": 0} ...ignoring