# Ansible Play apt: not happy with installing items: tomcat7 tomcat7-admin on vagrant up | ubuntu 12.0.4 | apt

**URL:** <https://forum.ansible.com/t/ansible-play-apt-not-happy-with-installing-items-tomcat7-tomcat7-admin-on-vagrant-up-ubuntu-12-0-4-apt/16475>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 9, 2014, 2:48am UTC](https://forum.ansible.com/t/ansible-play-apt-not-happy-with-installing-items-tomcat7-tomcat7-admin-on-vagrant-up-ubuntu-12-0-4-apt/16475 "2014-10-09T02:48:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terry\_Fundak](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@Terry\_Fundak](https://forum.ansible.com/u/Terry_Fundak)\
**Post date:** [October 9, 2014, 2:48am UTC](https://forum.ansible.com/t/ansible-play-apt-not-happy-with-installing-items-tomcat7-tomcat7-admin-on-vagrant-up-ubuntu-12-0-4-apt/16475/1 "2014-10-09T02:48:47Z")

</div>

Looking for a little advise… new to ansible …

Here is the task …  
which is in playbook from  
github … ansible-for-devops.

`  
tasks:

# TOMCAT 7

- name: Install Tomcat 7.  
apt: “pkg={{ item }} state=installed”  
with\_items:
- tomcat7
- tomcat7-admin

`

---

<div class="post-metadata">

**Author:** ![Michael\_Peters](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@Michael\_Peters](https://forum.ansible.com/u/Michael_Peters)\
**Post date:** [October 9, 2014, 7:59pm UTC](https://forum.ansible.com/t/ansible-play-apt-not-happy-with-installing-items-tomcat7-tomcat7-admin-on-vagrant-up-ubuntu-12-0-4-apt/16475/2 "2014-10-09T19:59:42Z")

</div>

Are you setting sudo to true somewhere else. It's hard to see when  
you've just shown a portion of playbook. If not and you just need sudo  
for this task, then you can set it per-task like so:

tasks:  
&nbsp;&nbsp;# TOMCAT 7 ###################################################################  
&nbsp;&nbsp;- name: Install Tomcat 7.  
&nbsp;&nbsp;&nbsp;&nbsp;apt: "pkg={{ item }} state=installed"  
&nbsp;&nbsp;&nbsp;&nbsp;sudo: true  
&nbsp;&nbsp;&nbsp;&nbsp;with\_items:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- tomcat7  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- tomcat7-admin
