Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29407

Ansible : MODULE FAILURE\nSee stdout/stderr for the exact error

$
0
0

I am trying to install AWS CloudWatch agent in EC2 Centos VM using ansible-playbook. It worked well in the sandbox but when I ran it in Production it fails (integrated with Jenkins pipeline)

Here is my task snippet:

      - name: setup temp directory for install
        file:
          path: /tmp/aws-cw-agent
          state: directory

      - name: download installer
        get_url:
          url: "{{ aws_cw_agent_url }}"
          dest: /tmp/aws-cw-agent/amazon-cloudwatch-agent.rpm

      - name: install agent
        become: true
        shell: rpm -U /tmp/aws-cw-agent/amazon-cloudwatch-agent.rpm

Until "download installer" it works fine and I could find the rpm binary by manually navigating to the directory. But the next task install agent fails. Instead of shell, if I use "yum" module also, it fails.

The error says:

17:16:07 task path: /home/jenkins/workspace/groupesiph-dsir/03227/03227_Cloudwatch_Agent_deploy_hprod/playbook/deployment/roles/aws_cw_agent/tasks/main.yml:22

>17:16:07 Tuesday 10 March 2020  17:16:07 +0100 (0:00:00.098)       0:00:05.352 ********* 
17:16:08 Using module file /usr/lib/python3.6/site-packages/ansible/modules/commands/command.py
17:16:08 Pipelining is enabled.
17:16:08 <10.45.1.136> ESTABLISH SSH CONNECTION FOR USER: ansible

>17:16:08 <10.45.1.136> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="ansible"' -o ConnectTimeout=10 -o ServerAliveInterval=60 -o ServerAliveCountMax=10 -o ControlPath=/home/jenkins/.ansible/cp/84b84369b7 10.45.1.136 '/bin/sh -c '"'"'sudo -H -S -n  -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-syqwibhfpdecwpfqddhe ; /usr/bin/python'"'"'"''&& sleep 0'"'"''>17:16:08 Escalation succeeded
17:16:08 <10.45.1.136> (1, b'', b'')
17:16:08 <10.45.1.136> Failed to connect to the host via ssh: 
17:16:08 fatal: [prod05]: FAILED! => {
17:16:08     "changed": false,
17:16:08     "module_stderr": "",
17:16:08     "module_stdout": "",
17:16:08     "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
17:16:08     "rc": 1
17:16:08 

But if it is a real problem with ssh, then how it is succeeding in the previous task to download the installer.

What could be the problem?

Thanks in advance.


Viewing all articles
Browse latest Browse all 29407

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>