ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
836 stars 1.53k forks source link

community.general.flatpak - reports no match, but seems to install #3118

Open bashfulrobot opened 3 years ago

bashfulrobot commented 3 years ago

Summary

I have a role setup where I am leveraging flatpaks to install on my local system. It keeps reporting the package is not found but appears to have been installed.

Thank you for your time.

Issue Type

Bug Report

Component Name

flatpak

Ansible Version


❯ ansible --version
ansible 2.10.5
  config file = None
  configured module search path = ['/home/dustin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.5 (default, May 11 2021, 08:20:37) [GCC 10.3.0]

Configuration

$ ansible-config dump --only-changed

This command results in an empty result.

OS / Environment

❯ cat -p /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04"

Steps to Reproduce

The task component of the role has:

- name: install flatpak
  become: yes
  apt:
    pkg:
      - flatpak
      - gnome-software-plugin-flatpak
    state: present

- name: add the flathub flatpak repository remote to the user installation
  become: yes
  community.general.flatpak_remote:
    name: flathub
    state: present
    flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo

- name: install flathub packages
  become: yes
  community.general.flatpak:
    name: "{{flathub_packages}}"
    state: present
    remote: flathub

Then in a loaded var file, I have:

# Install flathub packages
flathub_packages:
  - org.standardnotes.standardnotes
  - org.some.other

Expected Results

I expect to there be no error displayed and the apps installed.

Actual Results

When I run the playbook, it results in:

fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/flatpak install --system --noninteractive flathub '['\"'\"'org.standardnotes.standardnotes'\"'\"']'", "msg": "error: Nothing matches ['org.standardnotes.standardnotes'] in remote flathub", "rc": 1, "stderr": "error: Nothing matches ['org.standardnotes.standardnotes'] in remote flathub\n", "stderr_lines": ["error: Nothing matches ['org.standardnotes.standardnotes'] in remote flathub"], "stdout": "", "stdout_lines": []}

when I manually run the installation with /usr/bin/flatpak install --system --noninteractive flathub org.standardnotes.standardnotes manually, it reports that the app is already installed.

Code of Conduct

ansibullbot commented 3 years ago

Files identified in the description: None

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

click here for bot help

ansibullbot commented 3 years ago

Files identified in the description:

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

click here for bot help

ansibullbot commented 3 years ago

cc @JayKayy @oolongbrothers click here for bot help

felixfontein commented 3 years ago

The flatpak module only allows to install multiple packages at once since community.general 3.3.0. Are you using this or a newer version of community.general?

needs_info

bashfulrobot commented 3 years ago

Hi there,

I had simply added a task in a role with:

- name: install flatpak
  become: yes
  apt:
    pkg:
      - flatpak
      - gnome-software-plugin-flatpak
    state: present

- name: add the flathub flatpak repository remote to the user installation
  become: yes
  community.general.flatpak_remote:
    name: flathub
    state: present
    flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo

- name: install flathub packages
  become: yes
  community.general.flatpak:
    name: "{{flathub_packages}}"
    state: present
    remote: flathub

And then my var was defined with:

# Install flathub packages
flathub_packages:
  - org.standardnotes.standardnotes

How do I check the version, or update it to the appropriate one?

I am still getting the feel of how things are splitting out into the community stuff (I may have a knowledge gap).

Thank you.

felixfontein commented 3 years ago

You can always run ansible-galaxy collection list to see which collections (with which versions) you have installed where. (If you are using ansible-base 2.10, this list can be incomplete if you installed the collections as part of the Ansible community distribution.)

ansibullbot commented 2 years ago

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