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

Failed to install snap package: snap \"shellcheck\" has no updates available #6821

Closed
1 task done
ltshb opened this issue Jun 30, 2023 · 8 comments · Fixed by #6835
Closed
1 task done

Failed to install snap package: snap \"shellcheck\" has no updates available #6821

ltshb opened this issue Jun 30, 2023 · 8 comments · Fixed by #6835
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type) traceback

Comments

@ltshb
Copy link

ltshb commented Jun 30, 2023

Summary

After the upgrade of the community.general to version 7.1.0, the installation of a snap package that is already present failed. Reverting community.general to version 7.0.1 solved the issue.

Issue Type

Bug Report

Component Name

snap

Ansible Version

$ ansible --version
ansible [core 2.14.6]
  config file = None
  configured module search path = ['/home/ltshb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /home/ltshb/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
# /home/ltshb/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 7.1.0  

# /usr/local/lib/python3.10/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 6.5.0  

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

Ubuntu 22.04

Steps to Reproduce

- name: Install latest shellcheck
  become: true
  community.general.snap:
    channel: edge
    name: shellcheck

Expected Results

No error, the package is already installed and ansible task should be green

Actual Results

TASK [shelltool : Install latest shellcheck] ****************************************************************************************
task path: .../roles/shelltool/tasks/main.yml:9
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: ltshb
<localhost> EXEC /bin/sh -c 'echo ~ltshb && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ltshb/.ansible/tmp `"&& mkdir "` echo /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014 `" && echo ansible-tmp-1688130988.6489294-134720-233180584502014="` echo /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014 `" ) && sleep 0'
Using module file /home/ltshb/.ansible/collections/ansible_collections/community/general/plugins/modules/snap.py
<localhost> PUT /home/ltshb/.ansible/tmp/ansible-local-130699sd05x0z9/tmp8536jboh TO /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014/AnsiballZ_snap.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014/ /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014/AnsiballZ_snap.py && sleep 0'
<localhost> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=zzvldjejqxzpyurrmtyqjpbziykqtzsl] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-zzvldjejqxzpyurrmtyqjpbziykqtzsl ; GOBIN=/usr/local/bin PATH=/home/ltshb/.local/bin:/home/ltshb/.nvm/versions/node/v16.20.0/bin:/home/ltshb/.local/bin:/home/ltshb/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin /usr/bin/python3 /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014/AnsiballZ_snap.py'"'"' && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/ltshb/.ansible/tmp/ansible-tmp-1688130988.6489294-134720-233180584502014/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/deco.py", line 52, in wrapper
    func(self, *args, **kwargs)
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/base.py", line 80, in run
    self.__run__()
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/mixins/state.py", line 37, in __run__
    return func()
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/modules/snap.py", line 350, in state_present
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/modules/snap.py", line 341, in _present
  File "/tmp/ansible_community.general.snap_payload_q4svvtq3/ansible_community.general.snap_payload.zip/ansible_collections/community/general/plugins/module_utils/mh/base.py", line 40, in do_raise
    raise _MHE(*args, **kwargs)
ansible_collections.community.general.plugins.module_utils.mh.exceptions.ModuleHelperException
fatal: [localhost]: FAILED! => {
    "changed": false,
    "channel": "edge",
    "classic": false,
    "cmd": "['state', 'classic', 'channel', 'shellcheck']",
    "invocation": {
        "module_args": {
            "channel": "edge",
            "classic": false,
            "name": [
                "shellcheck"
            ],
            "options": null,
            "state": "present"
        }
    },
    "msg": "Ooops! Snap installation failed while executing '['state', 'classic', 'channel', 'shellcheck']', please examine logs and error output for more details.",
    "output": {
        "channel": "edge",
        "classic": false,
        "cmd": "['state', 'classic', 'channel', 'shellcheck']",
        "run_info": [
            {
                "args_order": [
                    "state",
                    "classic",
                    "channel",
                    "name"
                ],
                "check_rc": false,
                "cmd": [
                    "/usr/bin/snap",
                    "refresh",
                    "--channel",
                    "edge",
                    "shellcheck"
                ],
                "context_run_args": {
                    "name": [
                        "shellcheck"
                    ],
                    "state": "refresh"
                },
                "environ_update": {
                    "LANGUAGE": "C",
                    "LC_ALL": "C"
                },
                "ignore_value_none": true,
                "results_err": "snap \"shellcheck\" has no updates available\n",
                "results_out": "",
                "results_processed": [
                    0,
                    "",
                    "snap \"shellcheck\" has no updates available\n"
                ],
                "results_rc": 0,
                "run_command_args": {
                    "check_rc": false,
                    "environ_update": {
                        "LANGUAGE": "C",
                        "LC_ALL": "C"
                    }
                }
            }
        ],
        "snaps_installed": [
            "shellcheck"
        ],
        "status_out": [
            [
                "bare",
                "latest/stable"
            ],
            [
                "core18",
                "latest/stable"
            ],
            [
                "core20",
                "latest/stable"
            ],
            [
                "core22",
                "latest/stable"
            ],
            [
                "firefox",
                "latest/stable/…"
            ],
            [
                "gnome-3-34-1804",
                "latest/stable"
            ],
            [
                "gnome-3-38-2004",
                "latest/stable/…"
            ],
            [
                "gnome-42-2204",
                "latest/stable"
            ],
            [
                "gtk-common-themes",
                "latest/stable/…"
            ],
            [
                "shellcheck",
                "latest/edge"
            ],
            [
                "slack",
                "latest/stable"
            ],
            [
                "snap-store",
                "latest/stable/…"
            ],
            [
                "snapd",
                "latest/stable"
            ],
            [
                "snapd-desktop-integration",
                "latest/stable/…"
            ],
            [
                "yq",
                "latest/stable"
            ]
        ],
        "status_run_info": {
            "args_order": [
                "_list"
            ],
            "check_rc": false,
            "cmd": [
                "/usr/bin/snap",
                "list"
            ],
            "context_run_args": {
                "check_rc": true
            },
            "environ_update": {
                "LANGUAGE": "C",
                "LC_ALL": "C"
            },
            "ignore_value_none": true,
            "results_err": "",
            "results_out": "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
            "results_processed": [
                0,
                "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
                ""
            ],
            "results_rc": 0,
            "run_command_args": {
                "check_rc": false,
                "environ_update": {
                    "LANGUAGE": "C",
                    "LC_ALL": "C"
                }
            }
        }
    },
    "run_info": [
        {
            "args_order": [
                "state",
                "classic",
                "channel",
                "name"
            ],
            "check_rc": false,
            "cmd": [
                "/usr/bin/snap",
                "refresh",
                "--channel",
                "edge",
                "shellcheck"
            ],
            "context_run_args": {
                "name": [
                    "shellcheck"
                ],
                "state": "refresh"
            },
            "environ_update": {
                "LANGUAGE": "C",
                "LC_ALL": "C"
            },
            "ignore_value_none": true,
            "results_err": "snap \"shellcheck\" has no updates available\n",
            "results_out": "",
            "results_processed": [
                0,
                "",
                "snap \"shellcheck\" has no updates available\n"
            ],
            "results_rc": 0,
            "run_command_args": {
                "check_rc": false,
                "environ_update": {
                    "LANGUAGE": "C",
                    "LC_ALL": "C"
                }
            }
        }
    ],
    "snaps_installed": [
        "shellcheck"
    ],
    "status_out": [
        [
            "bare",
            "latest/stable"
        ],
        [
            "core18",
            "latest/stable"
        ],
        [
            "core20",
            "latest/stable"
        ],
        [
            "core22",
            "latest/stable"
        ],
        [
            "firefox",
            "latest/stable/…"
        ],
        [
            "gnome-3-34-1804",
            "latest/stable"
        ],
        [
            "gnome-3-38-2004",
            "latest/stable/…"
        ],
        [
            "gnome-42-2204",
            "latest/stable"
        ],
        [
            "gtk-common-themes",
            "latest/stable/…"
        ],
        [
            "shellcheck",
            "latest/edge"
        ],
        [
            "slack",
            "latest/stable"
        ],
        [
            "snap-store",
            "latest/stable/…"
        ],
        [
            "snapd",
            "latest/stable"
        ],
        [
            "snapd-desktop-integration",
            "latest/stable/…"
        ],
        [
            "yq",
            "latest/stable"
        ]
    ],
    "status_run_info": {
        "args_order": [
            "_list"
        ],
        "check_rc": false,
        "cmd": [
            "/usr/bin/snap",
            "list"
        ],
        "context_run_args": {
            "check_rc": true
        },
        "environ_update": {
            "LANGUAGE": "C",
            "LC_ALL": "C"
        },
        "ignore_value_none": true,
        "results_err": "",
        "results_out": "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
        "results_processed": [
            0,
            "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
            ""
        ],
        "results_rc": 0,
        "run_command_args": {
            "check_rc": false,
            "environ_update": {
                "LANGUAGE": "C",
                "LC_ALL": "C"
            }
        }
    },
    "vars": {
        "channel": "edge",
        "classic": false,
        "cmd": "['state', 'classic', 'channel', 'shellcheck']",
        "run_info": [
            {
                "args_order": [
                    "state",
                    "classic",
                    "channel",
                    "name"
                ],
                "check_rc": false,
                "cmd": [
                    "/usr/bin/snap",
                    "refresh",
                    "--channel",
                    "edge",
                    "shellcheck"
                ],
                "context_run_args": {
                    "name": [
                        "shellcheck"
                    ],
                    "state": "refresh"
                },
                "environ_update": {
                    "LANGUAGE": "C",
                    "LC_ALL": "C"
                },
                "ignore_value_none": true,
                "results_err": "snap \"shellcheck\" has no updates available\n",
                "results_out": "",
                "results_processed": [
                    0,
                    "",
                    "snap \"shellcheck\" has no updates available\n"
                ],
                "results_rc": 0,
                "run_command_args": {
                    "check_rc": false,
                    "environ_update": {
                        "LANGUAGE": "C",
                        "LC_ALL": "C"
                    }
                }
            }
        ],
        "snaps_installed": [
            "shellcheck"
        ],
        "status_out": [
            [
                "bare",
                "latest/stable"
            ],
            [
                "core18",
                "latest/stable"
            ],
            [
                "core20",
                "latest/stable"
            ],
            [
                "core22",
                "latest/stable"
            ],
            [
                "firefox",
                "latest/stable/…"
            ],
            [
                "gnome-3-34-1804",
                "latest/stable"
            ],
            [
                "gnome-3-38-2004",
                "latest/stable/…"
            ],
            [
                "gnome-42-2204",
                "latest/stable"
            ],
            [
                "gtk-common-themes",
                "latest/stable/…"
            ],
            [
                "shellcheck",
                "latest/edge"
            ],
            [
                "slack",
                "latest/stable"
            ],
            [
                "snap-store",
                "latest/stable/…"
            ],
            [
                "snapd",
                "latest/stable"
            ],
            [
                "snapd-desktop-integration",
                "latest/stable/…"
            ],
            [
                "yq",
                "latest/stable"
            ]
        ],
        "status_run_info": {
            "args_order": [
                "_list"
            ],
            "check_rc": false,
            "cmd": [
                "/usr/bin/snap",
                "list"
            ],
            "context_run_args": {
                "check_rc": true
            },
            "environ_update": {
                "LANGUAGE": "C",
                "LC_ALL": "C"
            },
            "ignore_value_none": true,
            "results_err": "",
            "results_out": "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
            "results_processed": [
                0,
                "Name                       Version           Rev    Tracking         Publisher    Notes\nbare                       1.0               5      latest/stable    canonical**  base\ncore18                     20230530          2785   latest/stable    canonical**  base\ncore20                     20230613          1950   latest/stable    canonical**  base\ncore22                     20230612          766    latest/stable    canonical**  base\nfirefox                    114.0.2-1         2800   latest/stable/…  mozilla**    -\ngnome-3-34-1804            0+git.3556cb3     93     latest/stable    canonical**  -\ngnome-3-38-2004            0+git.6f39565     140    latest/stable/…  canonical**  -\ngnome-42-2204              0+git.ff35a85     111    latest/stable    canonical**  -\ngtk-common-themes          0.1-81-g442e511   1535   latest/stable/…  canonical**  -\nshellcheck                 v0.9.0            1709   latest/edge      koalaman     -\nslack                      4.32.127          79     latest/stable    slack**      -\nsnap-store                 41.3-71-g709398e  959    latest/stable/…  canonical**  -\nsnapd                      2.59.5            19457  latest/stable    canonical**  snapd\nsnapd-desktop-integration  0.9               83     latest/stable/…  canonical**  -\nyq                         v4.34.1           2194   latest/stable    mikefarah    -\n",
                ""
            ],
            "results_rc": 0,
            "run_command_args": {
                "check_rc": false,
                "environ_update": {
                    "LANGUAGE": "C",
                    "LC_ALL": "C"
                }
            }
        }
    }
}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) traceback labels Jun 30, 2023
@bgrande12
Copy link

+1 I also ran into this. Pinning to 7.0.1 fixes it.

amazon-ebs.ubuntu: TASK [common : Install SSM Agent via snap] *************************************
    amazon-ebs.ubuntu: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible_collections.community.general.plugins.module_utils.mh.exceptions.ModuleHelperException
    amazon-ebs.ubuntu: fatal: [default]: FAILED! => {"changed": false, "channel": "candidate", "classic": true, "cmd": "['state', 'classic', 'channel', 'amazon-ssm-agent']", "msg": "Ooops! Snap installation failed while executing '['state', 'classic', 'channel', 'amazon-ssm-agent']', please examine logs and error output for more details.", "output": {"channel": "candidate", "classic": true, "cmd": "['state', 'classic', 'channel', 'amazon-ssm-agent']", "snaps_installed": ["amazon-ssm-agent"]}, "snaps_installed": ["amazon-ssm-agent"], "vars": {"channel": "candidate", "classic": true, "cmd": "['state', 'classic', 'channel', 'amazon-ssm-agent']", "snaps_installed": ["amazon-ssm-agent"]}}

@russoz
Copy link
Collaborator

russoz commented Jul 2, 2023

@ltshb I jsut managed to reproduce your error, should be working in a fix in the next couple of days or so.

@russoz
Copy link
Collaborator

russoz commented Jul 2, 2023

@bgrande12 thanks for reporting. Could you please repeat the error using -vvvv to produce debugging information and paste that either here or in a gist/pastebin? TIA

@russoz
Copy link
Collaborator

russoz commented Jul 3, 2023

Hi @ltshb @bgrande12

Would you please confirm whether the PR above fixes your issues? I managed to reproduce @ltshb 's case and added that as a testcase in unit tests. @bgrande12 if it still does not work for you, please send that extra-verbose output and I can make a testcase out of it. ;-)

@ltshb
Copy link
Author

ltshb commented Jul 3, 2023

@russoz I tried to use your PR to test but I couldn't, I'm not a profi with Ansible and might need guidance in order to test your PR.
Here what I did, I modified my ansible-galaxy requirements.yml file like this

collections:
  - name: git@github.com:ansible-collections/community.general.git
    type: git
    version: russoz-ansible:6821-snap-failure

and re-run ansible-galaxy install -r requirements.yml --force but I got the following error

ansible-galaxy [core 2.14.6]
  config file = None
  configured module search path = ['/home/ltshb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /home/ltshb/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-galaxy
  python version = 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
...
Starting galaxy collection install process
Process install dependency map
Cloning into '/home/ltshb/.ansible/tmp/ansible-local-41542z_edhd_n/tmp0vb9aj10/community.general4qv5o64k'...
remote: Enumerating objects: 65138, done.
remote: Counting objects: 100% (1124/1124), done.
remote: Compressing objects: 100% (569/569), done.
remote: Total 65138 (delta 659), reused 946 (delta 549), pack-reused 64014
Receiving objects: 100% (65138/65138), 24.74 MiB | 4.82 MiB/s, done.
Resolving deltas: 100% (42981/42981), done.
error: pathspec 'russoz-ansible:6821-snap-failure' did not match any file(s) known to git
ERROR! Failed to switch a cloned Git repo `git@github.com:ansible-collections/community.general.git` to the requested revision `russoz-ansible:6821-snap-failure`.

@russoz
Copy link
Collaborator

russoz commented Jul 6, 2023

hi @ltshb

Almost that. Try:

collections:
  - name: https://github.com/russoz-ansible/community.general.git
    type: git
    version: 6821-snap-failure

The working branches are on people's github accounts or projects (as in my case).
(Update: you must use the https URL or else it will fail)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type) traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants