# Error - Install tomcat

**URL:** <https://forum.ansible.com/t/error-install-tomcat/33485>\
**Category:** Ansible Project\
**Created:** [July 24, 2020, 3:40pm UTC](https://forum.ansible.com/t/error-install-tomcat/33485 "2020-07-24T15:40:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A11](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@A11](https://forum.ansible.com/u/A11)\
**Post date:** [July 24, 2020, 3:40pm UTC](https://forum.ansible.com/t/error-install-tomcat/33485/1 "2020-07-24T15:40:07Z")

</div>

Please help on the below error

Ansible Codes

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 24, 2020, 3:43pm UTC](https://forum.ansible.com/t/error-install-tomcat/33485/2 "2020-07-24T15:43:45Z")

</div>

ignore\_errors is too far intended

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 27, 2020, 10:04pm UTC](https://forum.ansible.com/t/error-install-tomcat/33485/3 "2020-07-27T22:04:55Z")

</div>

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  
`
