Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 &apos;https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.2/x86_64/repodata/repomd.xml&apos;:
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 &apos;https://download.newrelic.com/infrastructure_agent/linux/zypp/sles/12.2/x86_64/repodata/repomd.xml&apos;:", "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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
646 views
Welcome To Ask or Share your Answers For Others

1 Answer

Error message: Failed to connect to download.newrelic.com port 443: Connection timed out

Seems that it tries to download some additional files. Try to install this package manually on a test environment to see the full error.

Or maybe outbound to download.newrelic.com port 443 is firewalled?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...