Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yum module will not confirm already installed group packages. #30933

Closed
pmkuny opened this issue Sep 26, 2017 · 18 comments
Closed

yum module will not confirm already installed group packages. #30933

pmkuny opened this issue Sep 26, 2017 · 18 comments
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@pmkuny
Copy link

pmkuny commented Sep 26, 2017

module This issue/PR relates to a module.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

yum

ANSIBLE VERSION
ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
CONFIGURATION
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = [u'/etc/ansible/roles', u'/usr/share/ansible/roles']
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30
OS / ENVIRONMENT
Running Ansible From:
OS: CentOS Linux release 7.4.1708 (Core) 
Kernel: Linux ansible 4.4.35-1-pve #1 SMP Fri Dec 9 11:09:55 CET 2016 x86_64 x86_64 x86_64 GNU/Linux

Target Host: 
OS:  CentOS Linux release 7.3.1611 (Core) 
Kernel:  Linux kvm.homelab.lan 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
SUMMARY

Ansible fails with an error message when trying to install a package group, citing that it doesn't exist. However, on the target machine, checking the group with the package manager shows that it does exist, and is installed:

On Target Host:
# yum groupinfo "Virtualization Host"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.blazar.mx
 * extras: repos.dfw.quadranet.com
 * updates: mirrors.cmich.edu

Environment Group: Virtualization Host
 Environment-Id: virtualization-host-environment
 Description: Minimal virtualization host.
 Mandatory Groups:
   +base
   +core
   +virtualization-hypervisor
   +virtualization-tools
 Optional Groups:
   +debugging
   +network-file-system-client
   +remote-system-management
   +virtualization-platform

STEPS TO REPRODUCE

Install package group on target host, then re-run playbook that would install same group on target host.

# tasks/main.yml
- include_vars: main.yml

- name: Install KVM-related Packages
  package:
    name: "{{ packages }}"
    state: installed

# vars/main.yml:
---
# vars file for roles/kvm_host
packages:
 - "@Virtualization Host"
 - "virt-install"
EXPECTED RESULTS

Expected Ansible to check that package group was installed and mark as "ok", changed: false

ACTUAL RESULTS

Ansible complains that the package group does not exist.

TASK [kvm_host : Install KVM-related Packages] ***********************************************************************************************************************************************
task path: /root/infra_playbook/roles/kvm_host/tasks/main.yml:6
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<kvm.homelab.lan> (0, '/root\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124 `" && echo ansible-tmp-1506436940.95-24774472500124="` echo /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124 `" ) && sleep 0'"'"''
<kvm.homelab.lan> (0, 'ansible-tmp-1506436940.95-24774472500124=/root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> PUT /tmp/tmpMGyNl6 TO /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/setup.py
<kvm.homelab.lan> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 '[kvm.homelab.lan]'
<kvm.homelab.lan> (0, 'sftp> put /tmp/tmpMGyNl6 /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/setup.py\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /root size 0\r\ndebug3: Looking up /tmp/tmpMGyNl6\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/setup.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:8 O:131072 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:9 O:163840 S:31590\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 32768 bytes at 98304\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 8 32768 bytes at 131072\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 9 31590 bytes at 163840\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/ /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/setup.py && sleep 0'"'"''
<kvm.homelab.lan> (0, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 -tt kvm.homelab.lan '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1506436940.95-24774472500124/" > /dev/null 2>&1 && sleep 0'"'"''
<kvm.homelab.lan> (0, '\r\n{"invocation": {"module_args": {"filter": "ansible_pkg_mgr", "gather_subset": ["!all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 10}}, "ansible_facts": {"ansible_pkg_mgr": "yum"}}\r\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\nShared connection to kvm.homelab.lan closed.\r\n')
Running yum
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<kvm.homelab.lan> (0, '/root\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392 `" && echo ansible-tmp-1506436941.48-229288002064392="` echo /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392 `" ) && sleep 0'"'"''
<kvm.homelab.lan> (0, 'ansible-tmp-1506436941.48-229288002064392=/root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> PUT /tmp/tmpSx5e8l TO /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/yum.py
<kvm.homelab.lan> SSH: EXEC sftp -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 '[kvm.homelab.lan]'
<kvm.homelab.lan> (0, 'sftp> put /tmp/tmpSx5e8l /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/yum.py\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug3: Sent message fd 5 T:16 I:1\r\ndebug3: SSH_FXP_REALPATH . -> /root size 0\r\ndebug3: Looking up /tmp/tmpSx5e8l\r\ndebug3: Sent message fd 5 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 P:/root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/yum.py\r\ndebug3: Sent message SSH2_FXP_WRITE I:4 O:0 S:32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 4 32768 bytes at 0\r\ndebug3: Sent message SSH2_FXP_WRITE I:5 O:32768 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:6 O:65536 S:32768\r\ndebug3: Sent message SSH2_FXP_WRITE I:7 O:98304 S:32\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 5 32768 bytes at 32768\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 6 32768 bytes at 65536\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: In write loop, ack for 7 32 bytes at 98304\r\ndebug3: Sent message SSH2_FXP_CLOSE I:4\r\ndebug3: SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/ /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/yum.py && sleep 0'"'"''
<kvm.homelab.lan> (0, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\n')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 -tt kvm.homelab.lan '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/yum.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1506436941.48-229288002064392/" > /dev/null 2>&1 && sleep 0'"'"''
<kvm.homelab.lan> (0, '\r\n{"changed": false, "results": ["virt-install-1.4.1-7.el7.noarch providing virt-install is already installed", "Loaded plugins: fastestmirror\\nLoading mirror speeds from cached hostfile\\n * base: mirrors.usinternet.com\\n * extras: mirrors.liquidweb.com\\n * updates: mirrors.cmich.edu\\nGroup Virtualization Host does not exist.\\n"], "failed": true, "rc": 1, "invocation": {"module_args": {"allow_downgrade": false, "name": ["@Virtualization Host", "virt-install"], "list": null, "install_repoquery": true, "conf_file": null, "disable_gpg_check": false, "state": "installed", "disablerepo": null, "update_cache": false, "enablerepo": null, "exclude": null, "security": false, "validate_certs": true, "installroot": "/", "skip_broken": false}}, "msg": "Error: Nothing to do\\n"}\r\n', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\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 = 30995\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 0\r\nShared connection to kvm.homelab.lan closed.\r\n')
fatal: [kvm.homelab.lan]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "allow_downgrade": false, 
            "conf_file": null, 
            "disable_gpg_check": false, 
            "disablerepo": null, 
            "enablerepo": null, 
            "exclude": null, 
            "install_repoquery": true, 
            "installroot": "/", 
            "list": null, 
            "name": [
                "@Virtualization Host", 
                "virt-install"
            ], 
            "security": false, 
            "skip_broken": false, 
            "state": "installed", 
            "update_cache": false, 
            "validate_certs": true
        }
    }, 
    "msg": "Error: Nothing to do\n", 
    "rc": 1, 
    "results": [
        "virt-install-1.4.1-7.el7.noarch providing virt-install is already installed", 
        "Loaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.usinternet.com\n * extras: mirrors.liquidweb.com\n * updates: mirrors.cmich.edu\nGroup Virtualization Host does not exist.\n"
    ]
}

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug_report module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 26, 2017
@bcoca bcoca changed the title Ansible will not confirm already installed group packages. yum module will not confirm already installed group packages. Sep 26, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Sep 26, 2017
@bcoca
Copy link
Member

bcoca commented Sep 26, 2017

@pmkuny
Copy link
Author

pmkuny commented Sep 26, 2017

Note that I manually removed the virt-install package on the target host and re-ran the playbook with no errors. Below is the output. While the run is reporting a changed state and not throwing errors, it's not installing the Virtualization Host group package either, just virt-install

I can manually SSH to the target host and run yum groupinstall "Virtualization Host" and it will install all the group packages.

Output after removing virt-install and re-running playbook:

TASK [kvm_host : Install KVM-related Packages] ***********************************************************************************************************************************************
task path: /root/infra_playbook/roles/kvm_host/tasks/main.yml:6
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<kvm.homelab.lan> (0, '/root\n', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201 `" && echo ansible-tmp-1506437797.79-10562056174201="` echo /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201 `" ) && sleep 0'"'"''
<kvm.homelab.lan> (0, 'ansible-tmp-1506437797.79-10562056174201=/root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201\n', '')
<kvm.homelab.lan> PUT /tmp/tmpQOrQ1G TO /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/setup.py
<kvm.homelab.lan> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 '[kvm.homelab.lan]'
<kvm.homelab.lan> (0, 'sftp> put /tmp/tmpQOrQ1G /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/setup.py\n', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/ /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/setup.py && sleep 0'"'"''
<kvm.homelab.lan> (0, '', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 -tt kvm.homelab.lan '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1506437797.79-10562056174201/" > /dev/null 2>&1 && sleep 0'"'"''
<kvm.homelab.lan> (0, '\r\n{"invocation": {"module_args": {"filter": "ansible_pkg_mgr", "gather_subset": ["!all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 10}}, "ansible_facts": {"ansible_pkg_mgr": "yum"}}\r\n', 'Shared connection to kvm.homelab.lan closed.\r\n')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/os/yum.py
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<kvm.homelab.lan> (0, '/root\n', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621 `" && echo ansible-tmp-1506437798.29-224461092535621="` echo /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621 `" ) && sleep 0'"'"''
<kvm.homelab.lan> (0, 'ansible-tmp-1506437798.29-224461092535621=/root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621\n', '')
<kvm.homelab.lan> PUT /tmp/tmpDYEnbu TO /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/yum.py
<kvm.homelab.lan> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 '[kvm.homelab.lan]'
<kvm.homelab.lan> (0, 'sftp> put /tmp/tmpDYEnbu /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/yum.py\n', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 kvm.homelab.lan '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/ /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/yum.py && sleep 0'"'"''
<kvm.homelab.lan> (0, '', '')
<kvm.homelab.lan> ESTABLISH SSH CONNECTION FOR USER: None
<kvm.homelab.lan> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/e42281e165 -tt kvm.homelab.lan '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/yum.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1506437798.29-224461092535621/" > /dev/null 2>&1 && sleep 0'"'"''
<kvm.homelab.lan> (0, '\r\n{"msg": "", "invocation": {"module_args": {"allow_downgrade": false, "name": ["@Virtualization Host", "virt-install"], "list": null, "install_repoquery": true, "conf_file": null, "disable_gpg_check": false, "state": "installed", "disablerepo": null, "update_cache": false, "enablerepo": null, "exclude": null, "security": false, "validate_certs": true, "installroot": "/", "skip_broken": false}}, "changed": true, "results": ["Loaded plugins: fastestmirror\\nLoading mirror speeds from cached hostfile\\n * base: mirrors.usinternet.com\\n * extras: mirrors.liquidweb.com\\n * updates: mirrors.cmich.edu\\nGroup Virtualization Host does not exist.\\nResolving Dependencies\\n--> Running transaction check\\n---> Package virt-install.noarch 0:1.4.1-7.el7 will be installed\\n--> Finished Dependency Resolution\\n\\nDependencies Resolved\\n\\n================================================================================\\n Package               Arch            Version              Repository     Size\\n================================================================================\\nInstalling:\\n virt-install          noarch          1.4.1-7.el7          base           92 k\\n\\nTransaction Summary\\n================================================================================\\nInstall  1 Package\\n\\nTotal download size: 92 k\\nInstalled size: 87 k\\nDownloading packages:\\nRunning transaction check\\nRunning transaction test\\nTransaction test succeeded\\nRunning transaction\\n  Installing : virt-install-1.4.1-7.el7.noarch                              1/1 \\n  Verifying  : virt-install-1.4.1-7.el7.noarch                              1/1 \\n\\nInstalled:\\n  virt-install.noarch 0:1.4.1-7.el7                                             \\n\\nComplete!\\n"], "rc": 0}\r\n', 'Shared connection to kvm.homelab.lan closed.\r\n')
changed: [kvm.homelab.lan] => {
    "changed": true, 
    "failed": false, 
    "invocation": {
        "module_args": {
            "allow_downgrade": false, 
            "conf_file": null, 
            "disable_gpg_check": false, 
            "disablerepo": null, 
            "enablerepo": null, 
            "exclude": null, 
            "install_repoquery": true, 
            "installroot": "/", 
            "list": null, 
            "name": [
                "@Virtualization Host", 
                "virt-install"
            ], 
            "security": false, 
            "skip_broken": false, 
            "state": "installed", 
            "update_cache": false, 
            "validate_certs": true
        }
    }, 
    "msg": "", 
    "rc": 0, 
    "results": [
        "Loaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.usinternet.com\n * extras: mirrors.liquidweb.com\n * updates: mirrors.cmich.edu\nGroup Virtualization Host does not exist.\nResolving Dependencies\n--> Running transaction check\n---> Package virt-install.noarch 0:1.4.1-7.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package               Arch            Version              Repository     Size\n================================================================================\nInstalling:\n virt-install          noarch          1.4.1-7.el7          base           92 k\n\nTransaction Summary\n================================================================================\nInstall  1 Package\n\nTotal download size: 92 k\nInstalled size: 87 k\nDownloading packages:\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : virt-install-1.4.1-7.el7.noarch                              1/1 \n  Verifying  : virt-install-1.4.1-7.el7.noarch                              1/1 \n\nInstalled:\n  virt-install.noarch 0:1.4.1-7.el7                                             \n\nComplete!\n"
    ]
}
META: ran handlers
META: ran handlers

@mkrizek mkrizek self-assigned this Sep 26, 2017
@mkrizek
Copy link
Contributor

mkrizek commented Sep 26, 2017

@pmkuny Thanks for the bugreport, I am working on a fix. As a temporary workaround, would using the group "Virtualization" do the job?

@pmkuny
Copy link
Author

pmkuny commented Sep 26, 2017

Running with "@Virtualization gives the same output from Ansible, but in this case I can confirm on the target host that the "Virtualization" group doesn't actually exist:

# yum groupinfo "Virtualization"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.usinternet.com
 * extras: repos.dfw.quadranet.com
 * updates: mirrors.cmich.edu
Warning: group/environment Virtualization does not exist.

@mkrizek
Copy link
Contributor

mkrizek commented Sep 26, 2017

@pmkuny oh, just noticed that "Virtualization" is only available in the EPEL repo.

@pmkuny
Copy link
Author

pmkuny commented Sep 26, 2017

@mkrizek Thanks. After installing epel-release, output is successful, is this a packaging problem on my end instead of the yum module? @Virtualization Host was working on 2.3 on this same machine, and I'm not modifying any other packages.

ok: [kvm.homelab.lan] => {
    "changed": false, 
    "failed": false, 
    "invocation": {
        "module_args": {
            "allow_downgrade": false, 
            "conf_file": null, 
            "disable_gpg_check": false, 
            "disablerepo": null, 
            "enablerepo": null, 
            "exclude": null, 
            "install_repoquery": true, 
            "installroot": "/", 
            "list": null, 
            "name": [
                "@Virtualization", 
                "virt-install"
            ], 
            "security": false, 
            "skip_broken": false, 
            "state": "installed", 
            "update_cache": false, 
            "validate_certs": true
        }
    }, 
    "msg": "Warning: Group virtualization does not have any packages to install.\n", 
    "rc": 0, 
    "results": [
        "virt-install-1.4.1-7.el7.noarch providing virt-install is already installed", 
        "Loaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.usinternet.com\n * epel: mirror.steadfast.net\n * extras: mirrors.liquidweb.com\n * updates: mirrors.cmich.edu\nNothing to do\n"
    ]
}
META: ran handlers
META: ran handlers

@mkrizek
Copy link
Contributor

mkrizek commented Sep 26, 2017

@pmkuny No, this seems like a bug in the yum module. Hopefully the "epel workaround" will suffice for you until this is fixed :)

@pmkuny
Copy link
Author

pmkuny commented Sep 26, 2017

@mkrizek No worries, just a testing system. :) Let me know if I can provide anything else to help

@jsumners
Copy link
Contributor

This is definitely a bug. To easily replicate it use a task like:

- name: install haproxy
  yum:
    name: "https://github.com/jsumners/haproxy-rhel7/releases/download/v{{haproxy_version.major}}/haproxy-jbs-{{haproxy_version.major}}-{{haproxy_version.release}}.el7.centos.x86_64.rpm"
    state: present

When the package is not already installed then that task will work correctly. On subsequent runs it gives the "does not update installed package" error.

The only workaround I have for it right now is:

- name: install haproxy
  yum:
    name: "https://github.com/jsumners/haproxy-rhel7/releases/download/v{{haproxy_version.major}}/haproxy-jbs-{{haproxy_version.major}}-{{haproxy_version.release}}.el7.centos.x86_64.rpm"
    state: present
  register: install_haproxy_result
  failed_when: install_haproxy_result.rc != 0 and
    'Nothing to do' not in install_haproxy_result.msg

@mkrizek
Copy link
Contributor

mkrizek commented Oct 9, 2017

@jsummers Can you provide the exact version of the rpm? Also can you try with the latest devel if you still see the issue? Thanks!

needs_info

@mkrizek mkrizek removed the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Oct 9, 2017
@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) labels Oct 9, 2017
@ansibot
Copy link
Contributor

ansibot commented Oct 9, 2017

@ansibot ansibot removed the needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) label Oct 9, 2017
@jsumners
Copy link
Contributor

jsumners commented Oct 9, 2017

@mkrizek it's 1.7.9-1 at https://github.com/jsumners/haproxy-rhel7/releases

I'm not going to have time to test it today. I might be able to get to it tomorrow, but you'd likely be better off running the task against your VM.

@buggsdummy
Copy link

I see this issue too, not for the group install but just installing a bunch of software packages and then re-running it again it's showing as failed.

@mkrizek
Copy link
Contributor

mkrizek commented Oct 10, 2017

@jsumners can you please try if #31529 fixes the issue? Thanks!

@ansibot
Copy link
Contributor

ansibot commented Jan 31, 2018

@pmkuny This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@jsumners
Copy link
Contributor

Sorry. I do not have the time to patch together an Ansible binary with PRs to test things. Please just use the information provided and a unit test to verify functionality.

@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. and removed needs_info This issue requires further information. Please answer any outstanding questions. labels Jan 31, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
@ansibot
Copy link
Contributor

ansibot commented Mar 9, 2018

@pmkuny This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Mar 17, 2018

@pmkuny You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

@ansibot ansibot closed this as completed Mar 17, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

6 participants