# MODULE FAILURE when adding "become: true" to a task

**URL:** <https://forum.ansible.com/t/module-failure-when-adding-become-true-to-a-task/37854>\
**Category:** Ansible Project\
**Created:** [April 4, 2023, 10:02pm UTC](https://forum.ansible.com/t/module-failure-when-adding-become-true-to-a-task/37854 "2023-04-04T22:02:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubham\_Shrivastav](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Shubham\_Shrivastav](https://forum.ansible.com/u/Shubham_Shrivastav)\
**Post date:** [April 4, 2023, 10:02pm UTC](https://forum.ansible.com/t/module-failure-when-adding-become-true-to-a-task/37854/1 "2023-04-04T22:02:28Z")

</div>

Hi team,  
I’m trying to install an rpm package to OpenSUSE  
OS config:  
NAME=“SLES”  
VERSION=“12-SP4”  
VERSION\_ID=“12.4”  
PRETTY\_NAME=“SUSE Linux Enterprise Server 12 SP4”  
ID=“sles”  
ANSI\_COLOR=“0;32”  
CPE\_NAME=“cpe:/o:suse:sles:12:sp4”

I’m able to copy it successfully:

- name: Copy promtail rpm file to server  
ansible.builtin.copy:  
src: rpm/promtail-2.7.4.x86\_64.rpm  
dest: /tmp/promtail-2.7.4.x86\_64.rpm

But installation doesn’t work for me

- name: Install promtail package locally  
community.general.zypper:  
name: /tmp/promtail-2.7.4.x86\_64.rpm  
state: present

FAILED! =\> {“changed”: false, “cmd”: [“/usr/bin/zypper”, “–quiet”, “–non-interactive”,  
“–xmlout”, “install”, “–type”, “package”, “–auto-agree-with-licenses”, “–no-recommends”,  
“–”, “/tmp/promtail-2.7.4.x86\_64.rpm”], “msg”: “Zypper run command failed with return code 5.”,  
“rc”: 5, “stderr”: “”, “stderr\_lines”: , “stdout”: “\<?xml version='1.0'?\>\n\n\<message type=  
"error"\>Root privileges are required for installing or uninstalling packages.\n\n”,  
“stdout\_lines”: [“\<?xml version='1.0'?\>”,  
“”, “\<message type="error"\>Root privileges are required for installing or uninstalling packages.”,  
“”]}

When I run it without become: true I get the below error asking me to sudo  
**Root privileges are required for installing or uninstalling packages**

When I add become, it gives me MODULE error:

“module\_stderr”: “OpenSSH\_8.6p1, LibreSSL 3.3.6\r\ndebug1: Reading configuration data /Users/sshrivastava/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 21: include /etc/ssh/ssh\_config.d/\* matched no files\r\ndebug1: /etc/ssh/ssh\_config line 54: Applying options for \*\r\ndebug2: resolve\_canonicalize: hostname 10.43.50.132 is address\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/Users/sshrivastava/.ssh/known\_hosts’\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/Users/sshrivastava/.ssh/known\_hosts2’\r\ndebug1: Authenticator provider $SSH\_SK\_PROVIDER did not resolve; disabling\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 = 82404\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 10.43.50.132 closed.\r\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

These errors are vague and I have no idea what’s happening.

I also tried this on the service module in ansible:

- name: Enabling promtail service  
ansible.builtin.service:  
name: sshd  
state: started  
enabled: yes  
become: true

Ended up getting the same error

fatal: : FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “OpenSSH\_8.6p1, LibreSSL 3.3.6\r\ndebug1: Reading configuration data /Users/sshrivastava/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 21: include /etc/ssh/ssh\_config.d/\* matched no files\r\ndebug1: /etc/ssh/ssh\_config line 54: Applying options for \*\r\ndebug2: resolve\_canonicalize: hostname is address\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/Users/sshrivastava/.ssh/known\_hosts’\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/Users/sshrivastava/.ssh/known\_hosts2’\r\ndebug1: Authenticator provider $SSH\_SK\_PROVIDER did not resolve; disabling\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 = 82912\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 closed.\r\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

Seems this might be an OS compatibility issue. It works on other platforms just not OpenSUSE.

I am able to run these commands successfully on the remote server using sudo.  
Not sure where the problem is.

Below are the Specifications:

Remote python version: 3.4 and 2.7 (currently using 2.7)

ansible\_python\_interpreter=/usr/bin/python

Workstation ansible version:  
ansible [core 2.14.4]  
config file = /Users/sshrivastava/work/ansible/ansible/promtail/ansible.cfg  
configured module search path = [‘/Users/sshrivastava/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /opt/homebrew/Cellar/ansible/7.4.0/libexec/lib/python3.11/site-packages/ansible  
ansible collection location = /Users/sshrivastava/.ansible/collections:/usr/share/ansible/collections  
executable location = /opt/homebrew/bin/ansible  
python version = 3.11.2 (main, Mar 24 2023, 00:13:59) [Clang 14.0.0 (clang-1400.0.29.202)] (/opt/homebrew/Cellar/ansible/7.4.0/libexec/bin/python3.11)  
jinja version = 3.1.2  
libyaml = True

---

<div class="post-metadata">

**Author:** ![Sachin\_Yadav](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Sachin\_Yadav](https://forum.ansible.com/u/Sachin_Yadav)\
**Post date:** [April 10, 2023, 8:35am UTC](https://forum.ansible.com/t/module-failure-when-adding-become-true-to-a-task/37854/2 "2023-04-10T08:35:13Z")

</div>

use **become\_user= root**
