# ERROR! 'state' is not a valid attribute for a Task  (selinux module)

**URL:** <https://forum.ansible.com/t/error-state-is-not-a-valid-attribute-for-a-task-selinux-module/23323>\
**Category:** Ansible Developer\
**Created:** [December 23, 2016, 1:51am UTC](https://forum.ansible.com/t/error-state-is-not-a-valid-attribute-for-a-task-selinux-module/23323 "2016-12-23T01:51:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![twinmegami\_arara](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@twinmegami\_arara](https://forum.ansible.com/u/twinmegami_arara)\
**Post date:** [December 23, 2016, 1:51am UTC](https://forum.ansible.com/t/error-state-is-not-a-valid-attribute-for-a-task-selinux-module/23323/1 "2016-12-23T01:51:36Z")

</div>

Doc:  
[http://docs.ansible.com/ansible/selinux\_module.html](http://docs.ansible.com/ansible/selinux_module.html)

I wrote below task in a role:

`

- selinux:  
state: disabled

# …

- name: start docker  
notify: restart docker

`

But got

`  
ERROR! ‘state’ is not a valid attribute for a Task

The error appears to have been in ‘/mnt/book/docker-registry/roles/docker-registry/tasks/main.yml’: line 5, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# - copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644

- selinux:  
^ here

`

---

<div class="post-metadata">

**Author:** ![twinmegami\_arara](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@twinmegami\_arara](https://forum.ansible.com/u/twinmegami_arara)\
**Post date:** [December 23, 2016, 1:53am UTC](https://forum.ansible.com/t/error-state-is-not-a-valid-attribute-for-a-task-selinux-module/23323/2 "2016-12-23T01:53:18Z")

</div>

My ansible is 2.2.0.0 on centos, target machine is centos too

在 2016年12月23日星期五 UTC+8上午9:51:36，twinmegami arara写道：
