2

I'm trying to install Cider music player (https://download.cider.sh/) using the community.general.snap module in Ansible. This package apparently isn't signed, so to install it I need to pass the --dangerous flag to avoid the following signature verification error: error: cannot find signatures with metadata for snap .

The community.general.snap ansible module doesn't have a "dangerous" parameter https://docs.ansible.com/ansible/latest/collections/community/general/snap_module.html , so I tried passing the flag to the "options" parameter assuming it was a boolean option, but I get the same error: error: cannot find signatures with metadata for snap with this task:

- name: Get Cider Installer
  get_url:
    url: https://github.com/ciderapp/cider-releases/releases/download/v1.5.9/cider_1.5.9_amd64.snap
    dest: /tmp/cider_1.5.9_amd64.snap

- name: Install Cider
  become: true
  community.general.snap:
    name: /tmp/cider_1.5.9_amd64.snap
    options:
      dangerous=true

Besides using the ansible.builtin.shell module & simply running snap install /tmp/cider_1.5.9_amd64.snap --dangerous as a shell command, is there a method for providing that --dangerous flag that I'm overlooking?

Cdhippen
  • 615
  • 1
  • 10
  • 32
  • Shouldn't it be `options: - dangerous=true` and according the [documentation and examples](https://docs.ansible.com/ansible/latest/collections/community/general/snap_module.html#examples)? Furthermore, as I interpret [the source code of `snap.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/snap.py#L181), I would try to run with parameter `options: '--dangerous'` or `options: ['--dangerous']` or even with `=true`. Because of the lack of environment I can't test it by myself. – U880D Dec 20 '22 at 10:49
  • doesn't work as well. – Kevin C Dec 20 '22 at 10:55
  • @KevinC, regarding "_doesn't work as well_", which of the five options? `options: - dangerous=true` or `options: '--dangerous'` or `options: '--dangerous=true'` or `options: ['--dangerous']` or `options: ['--dangerous=true']` or all of them? – U880D Dec 20 '22 at 11:04
  • in this case, all options do not work :D – Kevin C Dec 20 '22 at 11:05
  • @KevinC, I see. Then this might be related to the `snap_name` and `actionable_snaps` and because the package is not in a snap repository. So it could be that the module isn't able to perform this kind of action and a shell module should come in place to perform the task. – U880D Dec 20 '22 at 11:11
  • 1
    @U880D I just tried all these options on my setup as well and can confirm that none of these options work. It seems odd to me that a parameter required for installation of unsigned packages would be unavailable to the ansible module, but I can confirm (as suggested in my post) that using the ansible.builtin.shell module to run snap install with the --dangerous parameter does indeed work. Nevertheless, the question stands for how to use this parameter with the snap ansible module. – Cdhippen Dec 20 '22 at 11:14
  • Yeah, it seems like no options are passed as extra arguments. I've looked at [the source code](https://github.com/ansible-collections/community.general/blob/b531ecdc9bfe48fe98ea6b67279eb048e0c9071d/plugins/modules/snap_alias.py), but can't bake cake from it. Using shell for now would suffice. – Kevin C Dec 20 '22 at 11:14
  • Perhaps I'll open a github issue for the ansible snap module to this effect. – Cdhippen Dec 20 '22 at 11:15
  • 1
    Yes, that would be the best way to proceed! You can [do that here](https://github.com/ansible-collections/community.general/issues). – Kevin C Dec 20 '22 at 11:16
  • 1
    For posterity: https://github.com/ansible-collections/community.general/issues/5715 – Cdhippen Dec 20 '22 at 11:18

0 Answers0