Ansible Pilot

Install Zoom flatpak in Debian-like systems - Ansible module flatpak

How to automate the installation of Zoom flatpak system-wide in Debian-like systems using Ansible module flatpak.

March 2, 2022
Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons

How to install Zoom flatpak in Debian-like systems with Ansible?

I’m going to show you a live demo with some simple Ansible code. I’m Luca Berton and welcome to today’s episode of Ansible Pilot.

Ansible install Zoom flatpak in Debian-like systems

Today we are going to talk about the Ansible module flatpak. The full name is community.general.flatpak, it’s part of community.general modules maintained by the Ansible Community. The purpose of the flatpak module is to Manage flatpaks in the target system.

Parameters

Let me summarize the parameters of flatpak module. The only required is “name”, where you specify the flatpak name to install or remove. The parameter “state” specifies if you would like to perform the install action (“present” option) or the remove action (“absent” option). The parameter “method” specifies if you would like to install the flatpak system-wide (default) or only for the current user. The following parameters are more for advanced users. For example specify a different source with remote parameter other than the default “flathub”; not install the dependency “no_dependencies” parameter or if the executable is different than the usual flatpak.

The Best Resources For Ansible

Video Course

Books

demo

How to install Zoom flatpak in Debian-like systems with Ansible Playbook.

code

---
- name: flatpak module demo
  hosts: all
  become: true
  gather_facts: false
  tasks:
    - name: flatpak present
      ansible.builtin.apt:
        name: flatpak
        state: present
    - name: flathub flatpak repo
      community.general.flatpak_remote:
        name: flathub
        state: present
        flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
        method: system
    - name: install Zoom via flatpak
      community.general.flatpak:
        name: us.zoom.Zoom
        state: present
        method: system

execution

ansible-pilot $ ansible-playbook -i virtualmachines/ubuntu2110desktop/inventory container/flatpak_debian.yml
PLAY [flatpak module demo] ************************************************************************
TASK [flatpak present] ****************************************************************************
changed: [ubuntu2110.example.com]
TASK [flathub flatpak repo] ***********************************************************************
changed: [ubuntu2110.example.com]
TASK [install Zoom via flatpak] *******************************************************************
changed: [ubuntu2110.example.com]
PLAY RECAP ****************************************************************************************
ubuntu2110.example.com     : ok=3    changed=3    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
ansible-pilot $

idempotency

ansible-pilot $ ansible-playbook -i virtualmachines/ubuntu2110desktop/inventory container/flatpak_debian.yml
PLAY [flatpak module demo] ************************************************************************
TASK [flatpak present] ****************************************************************************
ok: [ubuntu2110.example.com]
TASK [flathub flatpak repo] ***********************************************************************
ok: [ubuntu2110.example.com]
TASK [install Zoom via flatpak] *******************************************************************
ok: [ubuntu2110.example.com]
PLAY RECAP ****************************************************************************************
ubuntu2110.example.com     : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
ansible-pilot $

before execution

ansible-pilot $ ssh [email protected]
Welcome to Ubuntu 21.10 (GNU/Linux 5.13.0-30-generic x86_64)
* Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
0 updates can be applied immediately.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
$ flatpak list
-sh: 1: flatpak: not found
$ flatpak remotes
-sh: 2: flatpak: not found
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 21.10"
NAME="Ubuntu"
VERSION_ID="21.10"
VERSION="21.10 (Impish Indri)"
VERSION_CODENAME=impish
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=impish
$ exit
Connection to ubuntu2110.example.com closed.
ansible-pilot $

after execution

ansible-pilot $ ssh [email protected]
Welcome to Ubuntu 21.10 (GNU/Linux 5.13.0-30-generic x86_64)
* Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
0 updates can be applied immediately.
Last login: Wed Mar  2 06:33:23 2022 from 192.168.0.59
$ flatpak list
Name                   Application ID                        Version      Branch   Installation
Freedesktop Platform   org.freedesktop.Platform              21.08.10     21.08    system
Mesa                   org.freedesktop.Platform.GL.default   21.3.5       21.08    system
openh264               org.freedesktop.Platform.openh264     2.1.0        2.0      system
Zoom                   us.zoom.Zoom                          5.9.6.2225   stable   system
$ flatpak remotes
Name    Options
flathub system
$

code with ❤️ in GitHub

Recap

Now you know how to install Zoom flatpak in Debian-like systems with Ansible. Subscribe to the YouTube channel, Medium, Website, Twitter, and Substack to not miss the next episode of the Ansible Pilot.

Academy

Learn the Ansible automation technology with some real-life examples in my

My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps

BUY the Complete PDF BOOK to easily Copy and Paste the 200+ Ansible code

Want to keep this project going? Please donate

Access the Complete Video Course and Learn Quick Ansible by 200+ Practical Lessons
Trustpilot
Follow me

Subscribe not to miss any new releases

FREE Top 10 Best Practices

Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress