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.

Install Spotify snap in Debian-like systems - Ansible module snap — Video Tutorial

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

Watch Video

Watch "Install Spotify snap in Debian-like systems - Ansible module snap" on YouTube

What You'll Learn

Full Tutorial Content

How to Install Spotify snap on Debian-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 Debian-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) ## Playbook code ```yaml --- - name: snap module Playbook hosts: all become: true gather_facts: false tasks: - name: snapd present ansible.builtin.apt: name: snapd state: present - name: install Spotify via snap community.general.snap: name: spotify state: present ``` execution ```bash ansible-pilot $ ansible-playbook -i virtualmachines/ubuntu2110desktop/inventory container/snap_debian.yml PLAY [snap module Playbook] *************************************************************************** TASK [snapd present] ****************************************************************************** ok: [ubuntu2110.example.com] TASK [install Spotify via snap] ******************************************************************* changed: [ubuntu2110.example.com] PLAY RECAP **************************************************************************************** ubuntu2110.example.com : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ansible-pilot $ ``` idempotency ```bash ansible-pilot $ ansible-playbook -i virtualmachines/ubuntu2110desktop/inventory container/snap_debian.yml PLAY [snap module Playbook] *************************************************************************** TASK [snapd present] ****************************************************************************** ok: [ubuntu2110.example.com] TASK [install Spotify via snap] ******************************************************************* ok: [ubuntu2110.example.com] PLAY RECAP ****************************************************************************************

About This Tutorial

Read the full written article: Install Spotify snap in Debian-like systems - Ansible module snap

Topics Covered

Related Video Tutorials