Error - Install tomcat

Please help on the below error

Ansible Codes

ignore_errors is too far intended

Also the ‘when’ directive is indented too far, I think.

Try like this

`

  • name: install tomcat7 from rhel-x86_64-server-6-datacenter-tomcat-grid-apps
    package:
    name: apache-tomcat-7.0.81
    state: present
    when: ansible_distribution_major_version == “6”
    ignore_errors: yes
    `