# 2 sudo tasks in one play, 1 succeeds, the other fails

**URL:** <https://forum.ansible.com/t/2-sudo-tasks-in-one-play-1-succeeds-the-other-fails/16545>\
**Category:** Ansible Project\
**Created:** [October 18, 2014, 11:09am UTC](https://forum.ansible.com/t/2-sudo-tasks-in-one-play-1-succeeds-the-other-fails/16545 "2014-10-18T11:09:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin\_van\_der\_Poel](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Martin\_van\_der\_Poel](https://forum.ansible.com/u/Martin_van_der_Poel)\
**Post date:** [October 18, 2014, 11:09am UTC](https://forum.ansible.com/t/2-sudo-tasks-in-one-play-1-succeeds-the-other-fails/16545/1 "2014-10-18T11:09:00Z")

</div>

So, i’m creating a role to auto install megatools, but i’m having trouble using sudo in a specific command, got the task / playbook and sh output here: [https://gist.github.com/mvdpoel/288ef389abc5329e3ebd](https://gist.github.com/mvdpoel/288ef389abc5329e3ebd)

Just works:

- name: Ensure packages are installed (Debian Family).  
sudo: true  
apt: \>  
name={{ item }}  
state=installed  
with\_items: \_\_required\_packages  
when: ansible\_os\_family == ‘Debian’

Does NOT work:

- name: “Make install”  
sudo: yes  
shell: “make install”  
args:  
chdir: “/home/{{ansible\_ssh\_user}}/{{ src\_folder.stdout }}”

the apt module seems to do fine, but when i do make install it whines over permission denied 🙂  
two tasks in the same book, no useful errors, no useful logs, nothing 😉

sooo, wtf 🙂

---

<div class="post-metadata">

**Author:** ![Dan\_Farrell](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@Dan\_Farrell](https://forum.ansible.com/u/Dan_Farrell)\
**Post date:** [October 19, 2014, 2:07pm UTC](https://forum.ansible.com/t/2-sudo-tasks-in-one-play-1-succeeds-the-other-fails/16545/2 "2014-10-19T14:07:56Z")

</div>

Hi,

Have you tried using ‘true’ instead of ‘yes’ in the make install task?
