Install Spotify snap in RedHat-like systems - Ansible module snap — Video Tutorial
How to automate the installation of Spotify snap system-wide in RedHat-like systems using Ansible module snap.
Watch Video
Watch "Install Spotify snap in RedHat-like systems - Ansible module snap" on YouTube
What You'll Learn
- How to Install Spotify snap on RedHat-like systems with Ansible?
- Ansible installs Spotify snap on RedHat-like systems
- Parameters
- Links
- Playbook
- code
- execution
- idempotency
- before execution
- after execution
Full Tutorial Content
How to Install Spotify snap on RedHat-like 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 installs Spotify snap on RedHat-like systems
- `community.general.snap`
- Manages snaps
Today we are going to talk about the Ansible module `snap`.
The full name is `community.general.snap`, it's part of `community.general` modules maintained by the Ansible Community.
The purpose of the `snap` module is to Manage snaps in the target system.
Parameters
- name _string_ - snap name
- state _string_ - present/absent
- channel _string_ - "stable"
- classic _boolean_ - no/yes
Let me summarize the parameters of `snap` module.
The only required is "name", where you specify the snap 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 "channel" specifies which channel to use, default the "stable" channel.
The parameter "classic" allows the confinement allows a snap to have the same level of access to the system as "classic" packages.
Links
- [community.general.snap](https://docs.ansible.com/ansible/latest/collections/community/general/snap_module.html)
- [spotify snap](https://snapcraft.io/spotify)
- [Installing snap on Fedora](https://snapcraft.io/docs/installing-snap-on-fedora)
Playbook
code
```yaml
---
- name: snap module Playbook
hosts: all
become: true
gather_facts: false
tasks:
- name: snapd present
ansible.builtin.yum:
name:
- snapd
- fuse
- squashfs-tools
- squashfuse
- kernel-modules
state: present
- name: symlink /snap
ansible.builtin.file:
src: "/var/lib/snapd/snap"
dest: "/snap"
state: link
- name: load squashfs module
community.general.modprobe:
name: "squashfs"
state: present
- name: install Spotify via snap
community.general.snap:
name: spotify
state: present
```
execution
```bash
ansible-pilot $ ansible-playbook -i virtualmachines/fedora35/inventory container/snap_redhat.yml
PLAY [snap module Playbook] ***************************************************************************
TASK [snapd present] ******************************************************************************
changed: [fedora.example.com]
TASK [symlink /snap] ******************************************************************************
ok: [fedora.example.com]
TASK [load squashfs module] ***********************************************************************
changed: [fedora.example.com]
TASK [install Spotify via snap] *******************************************************************
changed: [fedora.example.com]
PLAY RECAP ****************************************************************************************
fedora.example.com : ok=4 changed=3 u
About This Tutorial
- Author: Luca Berton
- Difficulty: Beginner
- Read time: 4 min
- Category: installation
Read the full written article: Install Spotify snap in RedHat-like systems - Ansible module snap
Topics Covered
Related Video Tutorials
- Ansible Playbook for Installing Docker on Linux Systems — Learn how to install Docker on Linux systems using an Ansible playbook. Follow our guide for a seamless Docker setup and start process.
- Install Zoom flatpak in RedHat-like systems - Ansible module flatpak — How to automate the installation of Zoom flatpak system-wide in RedHat-like systems using Ansible module flatpak.
- Update Zoom flatpak(s) in Linux systems - Ansible module command — 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.
- Install Google Chrome on Red Hat Using Ansible — Use Ansible to install Google Chrome on Red Hat. Follow our detailed playbook to add repositories and install Chrome efficiently.
- Install Microsoft Edge in RedHat-like systems - Ansible module rpm_key, yum_repository and yum — How to install the latest Microsoft Edge Stable on a RedHat-like workstation verify software using the public GPG key and set up the Microsoft repository. Included Playbook in Fedora 34.
- Install Spotify snap in Debian-like systems - Ansible module snap — How to automate the installation of Spotify snap system-wide in Debian-like systems using Ansible module snap.