community.general.flatpak module – Manage flatpaks
Note
This module is part of the community.general collection (version 8.6.8).
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
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.flatpak
.
Synopsis
Allows users to add or remove flatpaks.
See the community.general.flatpak_remote module for managing flatpak remotes.
Aliases: packaging.os.flatpak
Requirements
The below requirements are needed on the host that executes this module.
flatpak
Parameters
Parameter |
Comments |
---|---|
The path to the By default, this module looks for the Default: |
|
The installation method to use. Defines if the Choices:
|
|
The name of the flatpak to manage. To operate on several packages this can accept a list of packages. When used with Both When supplying a reverse DNS name, you can use the When used with When supplying a URL with |
|
If installing runtime dependencies should be omitted or not This parameter is primarily implemented for integration testing this module. There might however be some use cases where you would want to have this, like when you are packaging your own flatpaks. Choices:
|
|
The flatpak remote (repository) to install the flatpak from. By default, See the community.general.flatpak_remote module for managing flatpak remotes. Default: |
|
Indicates the desired package state. The value Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: partial If |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Install the spotify flatpak
community.general.flatpak:
name: https://s3.amazonaws.com/alexlarsson/spotify-repo/spotify.flatpakref
state: present
- name: Install the gedit flatpak package without dependencies (not recommended)
community.general.flatpak:
name: https://git.gnome.org/browse/gnome-apps-nightly/plain/gedit.flatpakref
state: present
no_dependencies: true
- name: Install the gedit package from flathub for current user
community.general.flatpak:
name: org.gnome.gedit
state: present
method: user
- name: Install the Gnome Calendar flatpak from the gnome remote system-wide
community.general.flatpak:
name: org.gnome.Calendar
state: present
remote: gnome
- name: Install multiple packages
community.general.flatpak:
name:
- org.gimp.GIMP
- org.inkscape.Inkscape
- org.mozilla.firefox
- name: Update the spotify flatpak
community.general.flatpak:
name: https://s3.amazonaws.com/alexlarsson/spotify-repo/spotify.flatpakref
state: latest
- name: Update the gedit flatpak package without dependencies (not recommended)
community.general.flatpak:
name: https://git.gnome.org/browse/gnome-apps-nightly/plain/gedit.flatpakref
state: latest
no_dependencies: true
- name: Update the gedit package from flathub for current user
community.general.flatpak:
name: org.gnome.gedit
state: latest
method: user
- name: Update the Gnome Calendar flatpak from the gnome remote system-wide
community.general.flatpak:
name: org.gnome.Calendar
state: latest
remote: gnome
- name: Update multiple packages
community.general.flatpak:
name:
- org.gimp.GIMP
- org.inkscape.Inkscape
- org.mozilla.firefox
state: latest
- name: Remove the gedit flatpak
community.general.flatpak:
name: org.gnome.gedit
state: absent
- name: Remove multiple packages
community.general.flatpak:
name:
- org.gimp.GIMP
- org.inkscape.Inkscape
- org.mozilla.firefox
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The exact flatpak command that was executed Returned: When a flatpak command has been executed Sample: |
|
Module error message Returned: failure Sample: |
|
Return code from flatpak binary Returned: When a flatpak command has been executed Sample: |
|
Error output from flatpak binary Returned: When a flatpak command has been executed Sample: |
|
Output from flatpak binary Returned: When a flatpak command has been executed Sample: |