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

Doc:
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

`

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

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