# ansible-playbook fails with error regarding module:setup

**URL:** <https://forum.ansible.com/t/ansible-playbook-fails-with-error-regarding-module-setup/22061>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 20, 2016, 4:05pm UTC](https://forum.ansible.com/t/ansible-playbook-fails-with-error-regarding-module-setup/22061 "2016-07-20T16:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gforster](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gforster/32/535_2.png) [@gforster](https://forum.ansible.com/u/gforster)\
**Post date:** [July 20, 2016, 4:05pm UTC](https://forum.ansible.com/t/ansible-playbook-fails-with-error-regarding-module-setup/22061/1 "2016-07-20T16:05:36Z")

</div>

When I run the playbook on the local computer against the target server, I get a very long error telling me the setup module failed.

`  
$ ansible-playbook -i “server.fqdn,” playbooks/server\_build.yml -K --ask-pass --check -vvvvv

> SSH: EXEC sshpass -d12 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=gforster -o ConnectTimeout=10 -o ControlPath=/home/gforster/.ansible/cp/ansible-ssh-%h-%p-%r -tt server.fqdn ‘/bin/sh -c ‘"’“'su root -c '”’“'”‘"’“'”‘"’“'/bin/sh -c '”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘“‘echo BECOME-SUCCESS-iuykodnbbajmkfusbtcqazxumkvvkrbu; LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /usr/bin/python /idm/idmt\_home/home/gforster/.ansible/tmp/ansible-tmp-1469029304.83-260550837256467/setup; rm -rf “/home/gforster/.ansible/tmp/ansible-tmp-1469029304.83-260550837256467/” \> /dev/null 2\>&1’”’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“'”‘"’“‘’”‘"’“'”‘"’“'”‘"’ && sleep 0’“'”‘’

fatal: [server.fqdn]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “setup”}, “module\_stderr”: “OpenSSH\_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips 1 Mar 2016\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: Applying options for \*\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O\_NONBLOCK\r\ndebug2: mux\_client\_hello\_exchange: master version 4\r\ndebug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux\_client\_request\_session: entering\r\ndebug3: mux\_client\_request\_alive: entering\r\ndebug3: mux\_client\_request\_alive: done pid = 11840\r\ndebug3: mux\_client\_request\_session: session request sent\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\ndebug3: mux\_client\_read\_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to server.fqdn closed.\r\n”, “module\_stdout”: “\r\nsu: Permission denied\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}  
`

And when i run the playbook on the target host itself, I get this error:

`

> ansible-playbook -i “localhost,” -c local playbooks/server\_build.yml -K -b --check

fatal: [localhost]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “su: Permission denied\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “parsed”: false}  
`

I’m not sure where the permission is denied. In the script, I have become root, so I would think it would run correctly. Any ideas what’s gone wrong? Is it me or something with ansible

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 20, 2016, 5:23pm UTC](https://forum.ansible.com/t/ansible-playbook-fails-with-error-regarding-module-setup/22061/2 "2016-07-20T17:23:07Z")

</div>

The user you login in with, gforster, is not allows to run "su root".

Since you become\_method=su the user must have permission to do a su to the become\_user when you are using become=yes.
