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

Error with cockpit-* globbing #51

Closed
tabowling opened this issue Jan 17, 2022 · 7 comments
Closed

Error with cockpit-* globbing #51

tabowling opened this issue Jan 17, 2022 · 7 comments
Labels
question Further information is requested

Comments

@tabowling
Copy link
Collaborator

When using the latest version of linux-system-roles.cockpit from galaxy, I'm receiving the following error:

fatal: [rhel8latest]: FAILED! => {"changed": false, "failures": ["cockpit-* All matches were filtered out by exclude filtering for argument: cockpit-*"], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

playbook is fairly simple, specifying the 'full' option to install all cockpit packages

- hosts: all
  remote_user: root

  vars:
    USE_FIREWALL: 1
  tasks:

    - name: Install RHEL/Fedora Web Console (Cockpit)
      include_role:
        name: linux-system-roles.cockpit
      vars:
        cockpit_packages: "full"   # or minimal, default

    - name: Configure Firewall for Web Console
      include_role:
        name: linux-system-roles.firewall
      vars:
        firewall:
          service: cockpit
          state: enabled
      when: USE_FIREWALL|bool
@tabowling
Copy link
Collaborator Author

Attaching error log with -vvv output
errors.log

If I comment out var cockpit_packages: "full" allowing the default package selection, it succeeds.

martinpitt added a commit to martinpitt/lsr-cockpit that referenced this issue Feb 1, 2022
This has bug reports such as [1], ensure that this generally works
everywhere.

[1] linux-system-roles#51
@martinpitt
Copy link
Collaborator

Hey @tabowling , thanks for the report! I cannot reproduce this on at least my RHEL 8.6 and Fedora 35 cloud images. I filed PR #53 to add a test for the "full" scenario, which is prudent anyway.

Your debug log looks ok to me at first sight. The error message sounds like the exclude list

["cockpit-docker", "cockpit-ostree", "cockpit-tests"]

would be all that cockpit-* matches -- but there are still the explicit packages. Perhaps your machine is missing package indexes, and thus the globbing somehow fails?

Interestingly, full also fails in the GitHub workflow run (Ubuntu 20.04), but for an entirely different reason. I'll wait for the integration tests and collect more data.

@martinpitt
Copy link
Collaborator

The principal difference is that on my local Ubuntu 16.04 runs, and also on github's, the glob actually gets expanded:

"__cockpit_packages_full": ["cockpit-doc", "cockpit-machines", "cockpit-pcp"]

but on Debian/Ubuntu it uses (log confirms that) vars/Debian.yml, which hardcodes that list.

On my local Fedora 35 and RHEL 8.6 runs, it uses vars/Fedora.yml and vars/RedHat-8.yml respectively, and that also looks okay:

TASK [linux-system-roles.cockpit : Set version specific variables] ***********************************************************
ok: [f35] => (item=/var/home/martin/upstream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/Fedora.yml) => {"ansible_
facts": {"__cockpit_packages": {"default": "{{ __cockpit_packages_minimal + __cockpit_packages_default }}", "full": "{{ __cock
pit_packages_minimal + __cockpit_packages_default + __cockpit_packages_full }}", "minimal": "{{ __cockpit_packages_minimal }}"
}, "__cockpit_packages_default": ["cockpit", "cockpit-networkmanager", "cockpit-packagekit", "cockpit-selinux", "cockpit-stora
ged"], "__cockpit_packages_exclude": ["cockpit-docker", "cockpit-ostree", "cockpit-tests"], "__cockpit_packages_full": ["cockp
it-*"], "__cockpit_packages_minimal": ["cockpit-system", "cockpit-ws"]}, "ansible_included_var_files": ["/var/home/martin/upst
ream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/Fedora.yml"], "ansible_loop_var": "item", "changed": false, "item": "/var/home/martin/upstream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/Fedora.yml"}
ok: [r8] => (item=/var/home/martin/upstream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/RedHat-8.yml) => {"ansible_facts": {"__cockpit_packages": {"default": "{{ __cockpit_packages_minimal + __cockpit_packages_default }}", "full": "{{ __cockpit_packages_minimal + __cockpit_packages_default + __cockpit_packages_full }}", "minimal": "{{ __cockpit_packages_minimal }}"}, "__cockpit_packages_default": ["cockpit", "cockpit-networkmanager", "cockpit-packagekit", "cockpit-selinux", "cockpit-storaged"], "__cockpit_packages_exclude": ["cockpit-docker", "cockpit-ostree", "cockpit-tests"], "__cockpit_packages_full": ["cockpit-*"], "__cockpit_packages_minimal": ["cockpit-system", "cockpit-ws"]}, "ansible_included_var_files": ["/var/home/martin/upstream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/RedHat-8.yml"], "ansible_loop_var": "item", "changed": false, "item": "/var/home/martin/upstream/lsr-cockpit/tests/roles/linux-system-roles.cockpit/vars/RedHat-8.yml"}


changed: [f35] => {"changed": true, "msg": "", "rc": 0, "results": ["Installed: cockpit-composer-31-1.fc35.noarch", "Installed: cockpit-session-recording-9-1.fc35.noarch", "Installed: cockpit-260-1.fc35.x86_64", "Installed: cockpit-389-ds-2.0.12-1.fc35.noarch", "Installed: cockpit-bridge-260-1.fc35.x86_64", "Installed: cockpit-doc-260-1.fc35.noarch", "Installed: cockpit-file-sharing-2.4.1-5.fc35.noarch", "Installed: cockpit-kdump-260-1.fc35.noarch", "Installed: cockpit-machines-257-1.fc35.noarch", "Installed: cockpit-navigator-0.5.8-3.fc35.noarch", "Installed: cockpit-networkmanager-260-1.fc35.noarch", "Installed: cockpit-packagekit-260-1.fc35.noarch", "Installed: cockpit-pcp-260-1.fc35.x86_64", "Installed: cockpit-podman-39-1.fc35.noarch", "Installed: cockpit-selinux-260-1.fc35.noarch", "Installed: cockpit-sosreport-260-1.fc35.noarch", "Installed: cockpit-storaged-260-1.fc35.noarch", "Installed: cockpit-system-260-1.fc35.noarch", "Installed: cockpit-ws-260-1.fc35.x86_64"]}
changed: [r8] => {"changed": true, "msg": "", "rc": 0, "results": ["Installed: cockpit-composer-32-1.el8.noarch", "Installed: cockpit-machines-261-1.el8.noarch", "Installed: cockpit-packagekit-261-1.el8.noarch", "Installed: cockpit-pcp-261-1.el8.x86_64", "Installed: cockpit-podman-39-1.module+el8.6.0+13755+68a3e12f.noarch", "Installed: cockpit-session-recording-11-2.el8.noarch", "Installed: cockpit-storaged-261-1.el8.noarch", "Installed: subscription-manager-cockpit-1.28.25-1.el8.noarch", "Installed: cockpit-261-1.el8.x86_64", "Installed: cockpit-bridge-261-1.el8.x86_64", "Installed: cockpit-doc-261-1.el8.noarch", "Installed: cockpit-system-261-1.el8.noarch", "Installed: cockpit-ws-261-1.el8.x86_64"]}

But in your log it doesn't:

TASK [linux-system-roles.cockpit : Set version specific variables] 
 task path: /root/.ansible/roles/linux-system-roles.cockpit/tasks/main.yml:1
ok: [rhel8latest] => (item=/root/.ansible/roles/linux-system-roles.cockpit/vars/RedHat-8.yml) => {
    "ansible_facts": {
        "__cockpit_packages_default": [
            "cockpit",
            "cockpit-networkmanager",
            "cockpit-packagekit",
            "cockpit-selinux",
            "cockpit-storaged"
        ],
        "__cockpit_packages_exclude": [
            "cockpit-docker",
            "cockpit-ostree",
            "cockpit-tests"
        ],
        "__cockpit_packages_full": [
            "cockpit-*"
        ],

So for some reason, yum/dnf can't figure out the globbing.

@tabowling , on the machine where you tried to run this, what's the output of `sudo dnf install 'cockpit-*'? On mine (small cloud VM) it looks like this:

# dnf install 'cockpit-*'
Extra Packages for Enterprise Linux Modular 8 - x86_64                                        1.0 MB/s | 979 kB     00:00    
baseos                                                                                        1.4 MB/s | 2.4 MB     00:01    
appstream                                                                                     2.7 MB/s | 7.4 MB     00:02    
Dependencies resolved.
==============================================================================================================================
 Package                            Architecture Version                                   Repository                    Size
==============================================================================================================================
Installing:
 cockpit-bridge                     x86_64       261-1.el8                                 RHEL-NIGHTLY-BaseOS          533 k
 cockpit-composer                   noarch       32-1.el8                                  RHEL-NIGHTLY-AppStream       2.3 M
 cockpit-doc                        noarch       261-1.el8                                 RHEL-NIGHTLY-BaseOS          186 k
 cockpit-machines                   noarch       261-1.el8                                 RHEL-NIGHTLY-AppStream       811 k
 cockpit-packagekit                 noarch       261-1.el8                                 RHEL-NIGHTLY-AppStream       626 k
 cockpit-pcp                        x86_64       261-1.el8                                 RHEL-NIGHTLY-AppStream       128 k
 cockpit-podman                     noarch       39-1.module+el8.6.0+13755+68a3e12f        RHEL-NIGHTLY-AppStream       484 k
 cockpit-session-recording          noarch       11-2.el8                                  RHEL-NIGHTLY-AppStream       1.6 M
 cockpit-storaged                   noarch       261-1.el8                                 RHEL-NIGHTLY-AppStream       629 k
 cockpit-system                     noarch       261-1.el8                                 RHEL-NIGHTLY-BaseOS          3.2 M
 cockpit-ws                         x86_64       261-1.el8                                 RHEL-NIGHTLY-BaseOS          1.3 M
Installing dependencies:
 cockpit                            x86_64       261-1.el8                                 RHEL-NIGHTLY-BaseOS           78 k
 fuse                               x86_64       2.9.7-12.el8                              RHEL-NIGHTLY-BaseOS           83 k
 osbuild                            noarch       46-1.el8                                  RHEL-NIGHTLY-AppStream       111 k
 osbuild-composer                   x86_64       40-1.el8                                  RHEL-NIGHTLY-AppStream        19 k
 osbuild-composer-core              x86_64       40-1.el8                                  RHEL-NIGHTLY-AppStream       5.5 M
 osbuild-composer-dnf-json          x86_64       40-1.el8                                  RHEL-NIGHTLY-AppStream        12 k
 osbuild-composer-worker            x86_64       40-1.el8                                  RHEL-NIGHTLY-AppStream       8.0 M
 osbuild-ostree                     noarch       46-1.el8                                  RHEL-NIGHTLY-AppStream        26 k
 osbuild-selinux                    noarch       46-1.el8                                  RHEL-NIGHTLY-AppStream        27 k
 ostree                             x86_64       2022.1-2.el8                              RHEL-NIGHTLY-AppStream       251 k
 ostree-libs                        x86_64       2022.1-2.el8                              RHEL-NIGHTLY-AppStream       438 k
 python3-osbuild                    noarch       46-1.el8                                  RHEL-NIGHTLY-AppStream       147 k
 rpm-ostree                         x86_64       2022.1-1.el8                              RHEL-NIGHTLY-AppStream       2.8 M
 rpm-ostree-libs                    x86_64       2022.1-1.el8                              RHEL-NIGHTLY-AppStream        52 k
Installing weak dependencies:
 subscription-manager-cockpit       noarch       1.28.25-1.el8                             RHEL-NIGHTLY-BaseOS          889 k

Transaction Summary
==============================================================================================================================
Install  26 Packages

Total download size: 30 M
Installed size: 110 M
Is this ok [y/N]: 

@martinpitt martinpitt added the question Further information is requested label Feb 1, 2022
martinpitt added a commit to martinpitt/lsr-cockpit that referenced this issue Feb 1, 2022
This has bug reports such as [1], ensure that this generally works
everywhere.

[1] linux-system-roles#51
@richm
Copy link
Contributor

richm commented Feb 1, 2022

according to the Ansible team - you should not use package: name: something-* because globbing is not a supported feature - it is not guaranteed to work on all platforms, and in addition, it may be taken away at some point in the future - so we need to come up with a better, portable way to do "give me a list of all possible packages which matches cockpit-*"

@martinpitt
Copy link
Collaborator

Idea: For DNF (RHEL 8/9/Fedora) we compute the list ourselves with

dnf -C repoquery -a --queryformat='%{name}' '*cockpit*'

I am not sure if that works with yum on RHEL/CentOS 7, but there we can honestly just hardcode the list like we do on other OSes -- it's not going to change any more.

@richm
Copy link
Contributor

richm commented Feb 2, 2022

Idea: For DNF (RHEL 8/9/Fedora) we compute the list ourselves with

dnf -C repoquery -a --queryformat='%{name}' '*cockpit*'

I am not sure if that works with yum on RHEL/CentOS 7, but there we can honestly just hardcode the list like we do on other OSes -- it's not going to change any more.

works for me - do we need a BZ for this?

@richm
Copy link
Contributor

richm commented Jul 23, 2024

fixed by #161

@richm richm closed this as completed Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants