无法使用 ansible zypper 命令安装 rpm 包
Unable to install rpm package using ansible zypper command
问题:无法使用 ansible zypper 命令安装 rpm 包
代码:
---
- name: Upgrade package to latest version on all OS VMs
hosts: all_OS
tasks:
- name: Copy 11 rpm file to server
copy:
src: /tmp/package/package-v1.4-1.OStype11.rpm
dest: /tmp/
when: ansible_distribution == "OStype" and ansible_distribution_major_version == "v1"
- name: Install 11 rpm on server
zypper:
name: /tmp/package-v1.4-1.OStype11.rpm
#update_cache: yes
force: yes
state: present
when: ansible_distribution == "OStype" and ansible_distribution_major_version == "v1"
错误:
fatal: [dummy]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper", "--quiet", "--non-interactive", "--xmlout", "install", "--type", "package", "--auto-agree-with-licenses", "--no-recommends", "--force", "--", "/tmp/package-v1.4-1.OStype12.2.rpm"], "msg": "Zypper run command failed with return code 4.", "rc": 4, "stderr": "", "stderr_lines": [], "stdout": "<?xml version='1.0'?>\n<stream>\n<message type=\"error\">Download (curl) error for 'https://site/infrastructure_agent/OS/zypp/OStype/12.2/x86_64/repodata/repomd.xml':\nError code: Connection failed\nError message: Failed to connect to site port 443: Connection timed out\n</message>\n<prompt id=\"8\">\n<text>Abort, retry, ignore?</text>\n<option default=\"1\" value=\"a\" desc=\"Skip retrieval of the file and abort current operation.\"/>\n<option value=\"r\" desc=\"Try to retrieve the file again.\"/>\n<option value=\"i\" desc=\"Skip retrieval of the file and try to continue with the operation without the file.\"/>\n<option value=\"u\" desc=\"Change current base URI and try retrieving the file again.\"/>\n<option value=\"s\" desc=\"Disable SSL certificate authority check and continue.\"/>\n</prompt>\n<prompt id=\"8\">\n<text>Abort, retry, ignore?</text>\n<option default=\"1\" value=\"a\" desc=\"Skip retrieval of the file and abort current operation.\"/>\n<option value=\"r\" desc=\"Try to retrieve the file again.\"/>\n<option value=\"i\" desc=\"Skip retrieval of the file and try to continue with the operation without the file.\"/>\n<option value=\"u\" desc=\"Change current base URI and try retrieving the file again.\"/>\n</prompt>\n<message type=\"error\">ABORT request: Aborting requested by user</message>\n</stream>\n", "stdout_lines": ["<?xml version='1.0'?>", "<stream>", "<message type=\"error\">Download (curl) error for 'https://site/infrastructure_agent/OS/zypp/OStype/12.2/x86_64/repodata/repomd.xml':", "Error code: Connection failed", "Error message: Failed to connect to site 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>"]}
Error message: Failed to connect to download.newrelic.com port 443: Connection timed out
它似乎试图下载一些额外的文件。尝试在测试环境中手动安装此包以查看完整错误。
或者到 download.newrelic.com 端口 443 的出站是否有防火墙?
问题:无法使用 ansible zypper 命令安装 rpm 包
代码:
---
- name: Upgrade package to latest version on all OS VMs
hosts: all_OS
tasks:
- name: Copy 11 rpm file to server
copy:
src: /tmp/package/package-v1.4-1.OStype11.rpm
dest: /tmp/
when: ansible_distribution == "OStype" and ansible_distribution_major_version == "v1"
- name: Install 11 rpm on server
zypper:
name: /tmp/package-v1.4-1.OStype11.rpm
#update_cache: yes
force: yes
state: present
when: ansible_distribution == "OStype" and ansible_distribution_major_version == "v1"
错误:
fatal: [dummy]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper", "--quiet", "--non-interactive", "--xmlout", "install", "--type", "package", "--auto-agree-with-licenses", "--no-recommends", "--force", "--", "/tmp/package-v1.4-1.OStype12.2.rpm"], "msg": "Zypper run command failed with return code 4.", "rc": 4, "stderr": "", "stderr_lines": [], "stdout": "<?xml version='1.0'?>\n<stream>\n<message type=\"error\">Download (curl) error for 'https://site/infrastructure_agent/OS/zypp/OStype/12.2/x86_64/repodata/repomd.xml':\nError code: Connection failed\nError message: Failed to connect to site port 443: Connection timed out\n</message>\n<prompt id=\"8\">\n<text>Abort, retry, ignore?</text>\n<option default=\"1\" value=\"a\" desc=\"Skip retrieval of the file and abort current operation.\"/>\n<option value=\"r\" desc=\"Try to retrieve the file again.\"/>\n<option value=\"i\" desc=\"Skip retrieval of the file and try to continue with the operation without the file.\"/>\n<option value=\"u\" desc=\"Change current base URI and try retrieving the file again.\"/>\n<option value=\"s\" desc=\"Disable SSL certificate authority check and continue.\"/>\n</prompt>\n<prompt id=\"8\">\n<text>Abort, retry, ignore?</text>\n<option default=\"1\" value=\"a\" desc=\"Skip retrieval of the file and abort current operation.\"/>\n<option value=\"r\" desc=\"Try to retrieve the file again.\"/>\n<option value=\"i\" desc=\"Skip retrieval of the file and try to continue with the operation without the file.\"/>\n<option value=\"u\" desc=\"Change current base URI and try retrieving the file again.\"/>\n</prompt>\n<message type=\"error\">ABORT request: Aborting requested by user</message>\n</stream>\n", "stdout_lines": ["<?xml version='1.0'?>", "<stream>", "<message type=\"error\">Download (curl) error for 'https://site/infrastructure_agent/OS/zypp/OStype/12.2/x86_64/repodata/repomd.xml':", "Error code: Connection failed", "Error message: Failed to connect to site 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>"]}
Error message: Failed to connect to download.newrelic.com port 443: Connection timed out
它似乎试图下载一些额外的文件。尝试在测试环境中手动安装此包以查看完整错误。
或者到 download.newrelic.com 端口 443 的出站是否有防火墙?