AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Update Zoom flatpak(s) in Linux systems - Ansible module command

By Luca Berton · Published 2024-01-01 · Category: installation

How to automate the update of the Zoom flatpak from version 5.9.1.1380 to 5.9.6.2225 in Linux using Ansible module command.

Update Zoom flatpak(s) in Linux systems - Ansible module command

How to update Zoom flatpak in Linux systems with Ansible? I'm going to show you a live Playbook with some simple Ansible code. I'm Luca Berton and welcome to today's episode of Ansible Pilot.

Ansible update Zoom flatpak in Linux systems

ansible.builtin.command • Execute commands on targets

Today we are going to talk about the Ansible module command. The full name is ansible.builtin.command, it's part of ansible.builtin modules maintained by the Ansible Core. The purpose of the command module is to Execute commands on a target system.

## Playbook

How to Update Zoom flatpak in Linux systems with Ansible Playbook.

code

---
- name: flatpak update Playbook
  hosts: all
  become: true
  gather_facts: false
  tasks:
    - name: update flatpak(s)
      ansible.builtin.command: "flatpak update --noninteractive"

execution

ansible-pilot $ ansible-playbook -i virtualmachines/ubuntu2110desktop/inventory container/flatpak_update.yml
PLAY [flatpak update Playbook] ************************************************************************
TASK [update flatpak(s)] **************************************************************************
changed: [ubuntu2110.example.com]
PLAY RECAP ****************************************************************************************
ubuntu2110.example.com     : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
ansible-pilot $

before execution

ansible-pilot $ ssh devops@ubuntu2110.example.com
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: Thu Mar  3 06:39:45 2022 from 192.168.0.59
$ flapak list
-sh: 1: flapak: not found
$ flatpak list
Name                   Application ID                        Version      Branch   Installation
Freedesktop Platform   org.freedesktop.Platform              21.08.11     21.08    system
Mesa                   org.freedesktop.Platform.GL.default   21.3.6       21.08    system
openh264               org.freedesktop.Platform.openh264     2.1.0        2.0      system
Zoom                   us.zoom.Zoom                          5.9.1.1380   stable   system
$

after execution

ansible-pilot $ ssh devops@ubuntu2110.example.com
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: Thu Mar  3 07:05:53 2022 from 192.168.0.59
$ flatpak list
Name                   Application ID                        Version      Branch   Installation
Freedesktop Platform   org.freedesktop.Platform              21.08.11     21.08    system
Mesa                   org.freedesktop.Platform.GL.default   21.3.6       21.08    system
openh264               org.freedesktop.Platform.openh264     2.1.0        2.0      system
Zoom                   us.zoom.Zoom                          5.9.6.2225   stable   system
$

code with ❤️ in GitHub

See also: Install Zoom flatpak in RedHat-like systems - Ansible module flatpak

Conclusion

Now you know how to update Zoom flatpak in Linux systems with Ansible.

Related Articles

the Ansible become referencemanaging inventory in Ansible

See also: Ansible Playbook for Installing Docker on Linux Systems

Instead of the command module, you can use the dedicated flatpak module:

---
- name: Manage flatpak applications
  hosts: all
  become: true
  tasks:
    - name: Ensure flatpak is installed
      ansible.builtin.package:
        name: flatpak
        state: present

- name: Add Flathub repository community.general.flatpak_remote: name: flathub flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo state: present

- name: Install Zoom via flatpak community.general.flatpak: name: us.zoom.Zoom state: present

- name: Update all flatpak applications ansible.builtin.command: flatpak update -y register: flatpak_update changed_when: "'Nothing to do' not in flatpak_update.stdout"

Managing Multiple Flatpak Applications

- name: Install productivity flatpaks
  community.general.flatpak:
    name: "{{ item }}"
    state: present
  loop:
    - us.zoom.Zoom
    - com.slack.Slack
    - com.visualstudio.code
    - org.mozilla.firefox
    - com.google.Chrome

- name: Remove unused flatpak community.general.flatpak: name: org.example.OldApp state: absent

See also: Install Spotify snap in RedHat-like systems - Ansible module snap

FAQ

Should I use community.general.flatpak or ansible.builtin.command?

Use community.general.flatpak when possible — it's idempotent and reports proper changed status. Use ansible.builtin.command only for operations the flatpak module doesn't support (like flatpak update).

How do I update all flatpaks with Ansible?

The community.general.flatpak module doesn't have an "update all" feature. Use ansible.builtin.command: flatpak update -y with a changed_when condition.

Does this work on all Linux distributions?

Yes. Flatpak is distribution-agnostic. The playbook works on Fedora, Ubuntu, Debian, CentOS, RHEL, and any distro with flatpak installed.

Category: installation

Watch the video: Update Zoom flatpak(s) in Linux systems - Ansible module command — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home