Issue: Unable to install rpm package using ansible zypper command
Code:
---
- name: Upgrade NewRelic to latest version on all Linux VMs
hosts: all_linux
tasks:
- name: Copy 11 rpm file to server
copy:
src: /tmp/newrelic/newrelic-infra-1.12.4-1.sles11.x86_64.rpm
dest: /tmp/
when: ansible_distribution == "SLES" and ansible_distribution_major_version == "11"
- name: Install 11 rpm on server
zypper:
name: /tmp/newrelic-infra-1.12.4-1.sles11.x86_64.rpm
#update_cache: yes
force: yes
state: present
when: ansible_distribution == "SLES" and ansible_distribution_major_version == "11"
Error:
fatal: [l1or1mar001]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper", "--quiet", "--non-interactive", "--xmlout", "install", "--type", "package", "--auto-agree-with-licenses", "--no-recommends", "--force", "--", "/tmp/newrelic-infra-1.12.4-1.sles12.2.x86_64.rpm"], "msg": "Zypper run command failed with return code 4.", "rc": 4, "stderr": "", "stderr_lines": [], "stdout": "<?xml version='1.0'?>
<stream>
<message type="error">Download (curl) error for 'https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.2/x86_64/repodata/repomd.xml':
Error code: Connection failed
Error message: Failed to connect to download.newrelic.com port 443: Connection timed out
</message>
<prompt id="8">
<text>Abort, retry, ignore?</text>
<option default="1" value="a" desc="Skip retrieval of the file and abort current operation."/>
<option value="r" desc="Try to retrieve the file again."/>
<option value="i" desc="Skip retrieval of the file and try to continue with the operation without the file."/>
<option value="u" desc="Change current base URI and try retrieving the file again."/>
<option value="s" desc="Disable SSL certificate authority check and continue."/>
</prompt>
<prompt id="8">
<text>Abort, retry, ignore?</text>
<option default="1" value="a" desc="Skip retrieval of the file and abort current operation."/>
<option value="r" desc="Try to retrieve the file again."/>
<option value="i" desc="Skip retrieval of the file and try to continue with the operation without the file."/>
<option value="u" desc="Change current base URI and try retrieving the file again."/>
</prompt>
<message type="error">ABORT request: Aborting requested by user</message>
</stream>
", "stdout_lines": ["<?xml version='1.0'?>", "<stream>", "<message type="error">Download (curl) error for 'https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.2/x86_64/repodata/repomd.xml':", "Error code: Connection failed", "Error message: Failed to connect to download.newrelic.com port 443: Connection timed out", "</message>", "<prompt id="8">", "<text>Abort, retry, ignore?</text>", "<option default="1" value="a" desc="Skip retrieval of the file and abort current operation."/>", "<option value="r" desc="Try to retrieve the file again."/>", "<option value="i" desc="Skip retrieval of the file and try to continue with the operation without the file."/>", "<option value="u" desc="Change current base URI and try retrieving the file again."/>", "<option value="s" desc="Disable SSL certificate authority check and continue."/>", "</prompt>", "<prompt id="8">", "<text>Abort, retry, ignore?</text>", "<option default="1" value="a" desc="Skip retrieval of the file and abort current operation."/>", "<option value="r" desc="Try to retrieve the file again."/>", "<option value="i" desc="Skip retrieval of the file and try to continue with the operation without the file."/>", "<option value="u" desc="Change current base URI and try retrieving the file again."/>", "</prompt>", "<message type="error">ABORT request: Aborting requested by user</message>", "</stream>"]}
question from:
https://stackoverflow.com/questions/65848073/unable-to-install-rpm-package-using-ansible-zypper-command