Skip to content

community.general.flatpak: Second run always fails #4000

@WhyNotHugo

Description

@WhyNotHugo

Summary

If a URL-based package is already installed, ansible fails.

Issue Type

Bug Report

Component Name

community.general.flatpak

Ansible Version

$ ansible [core 2.12.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/hugo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/hugo/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

# /usr/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.2.0

Configuration

$ ansible-config dump --only-changed

(empty)

OS / Environment

$ uname -sro
Linux 5.15.11-arch2-1 GNU/Linux

Steps to Reproduce

main.yaml:

- hosts: localhost
  tasks:
   - import_tasks: tasks/flatpak.yaml

tasks/flatpak.yaml :

- name: Install 1Password Flatpak
  community.general.flatpak:
    name: https://downloads.1password.com/linux/flatpak/1Password.flatpakref
    state: present

Expected Results

This should work when run more than once.

Actual Results

  • Run this once: it works.
  • Run this a second time: it fails:
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/flatpak install --system --noninteractive https://downloads.1password.com/linux/flatpak/1Password.flatpakref", "msg": "error: App com.onepassword.OnePassword, branch stable is already installed", "rc": 1, "stderr": "error: App com.onepassword.OnePassword, branch stable is already installed\n", "stderr_lines": ["error: App com.onepassword.OnePassword, branch stable is already installed"], "stdout": "", "stdout_lines": []}

It looks like ansible acts as if the package were not installed, even though it is. This sounds remotely related to ansible/ansible#68256, which does not seem to have been addressed.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions