community.general.flatpak_remote – Manage flatpak repository remotes

Note

This plugin is part of the community.general collection (version 3.8.3).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.flatpak_remote.

Synopsis

  • Allows users to add or remove flatpak remotes.

  • The flatpak remotes concept is comparable to what is called repositories in other packaging formats.

  • Currently, remote addition is only supported via flatpakrepo file URLs.

  • Existing remotes will not be updated.

  • See the community.general.flatpak module for managing flatpaks.

Requirements

The below requirements are needed on the host that executes this module.

  • flatpak

Parameters

Parameter

Comments

executable

string

The path to the flatpak executable to use.

By default, this module looks for the flatpak executable on the path.

Default: “flatpak”

flatpakrepo_url

string

The URL to the flatpakrepo file representing the repository remote to add.

When used with state=present, the flatpak remote specified under the flatpakrepo_url is added using the specified installation method.

When used with state=absent, this is not required.

Required when state=present.

method

string

The installation method to use.

Defines if the flatpak is supposed to be installed globally for the whole system or only for the current user.

Choices:

  • system ← (default)

  • user

name

string / required

The desired name for the flatpak remote to be registered under on the managed host.

When used with state=present, the remote will be added to the managed host under the specified name.

When used with state=absent the remote with that name will be removed.

state

string

Indicates the desired package state.

Choices:

  • absent

  • present ← (default)

Examples

- name: Add the Gnome flatpak remote to the system installation
  community.general.flatpak_remote:
    name: gnome
    state: present
    flatpakrepo_url: https://sdk.gnome.org/gnome-apps.flatpakrepo

- name: Add the flathub flatpak repository remote to the user installation
  community.general.flatpak_remote:
    name: flathub
    state: present
    flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
    method: user

- name: Remove the Gnome flatpak remote from the user installation
  community.general.flatpak_remote:
    name: gnome
    state: absent
    method: user

- name: Remove the flathub remote from the system installation
  community.general.flatpak_remote:
    name: flathub
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

command

string

The exact flatpak command that was executed

Returned: When a flatpak command has been executed

Sample: “/usr/bin/flatpak remote-add –system flatpak-test https://dl.flathub.org/repo/flathub.flatpakrepo

msg

string

Module error message

Returned: failure

Sample: “Executable \u0027/usr/local/bin/flatpak\u0027 was not found on the system.”

rc

integer

Return code from flatpak binary

Returned: When a flatpak command has been executed

Sample: 0

stderr

string

Error output from flatpak binary

Returned: When a flatpak command has been executed

Sample: “error: GPG verification enabled, but no summary found (check that the configured URL in remote config is correct)\n”

stdout

string

Output from flatpak binary

Returned: When a flatpak command has been executed

Sample: “flathub\tFlathub\thttps://dl.flathub.org/repo/\t1\t\n”

Authors

  • John Kwiatkoski (@JayKayy)

  • Alexander Bethke (@oolongbrothers)