snap – Manages snaps
New in version 2.8.
Synopsis
- Manages snaps packages.
Parameters
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| channel string | Default: "stable" | Define which release of a snap is installed and tracked for updates. This option can only be specified if there is a single snap in the task. |
| classic boolean |
| Confinement policy. The classic confinement allows a snap to have the same level of access to the system as "classic" packages, like those managed by APT. This option corresponds to the --classic argument. This option can only be specified if there is a single snap in the task. |
| name - / required | Name of the snap to install or remove. Can be a list of snaps. | |
| state - |
| Desired state of the package. |
Examples
# Install "foo" and "bar" snap
- name: Install foo
snap:
name:
- foo
- bar
# Remove "foo" snap
- name: Remove foo
snap:
name: foo
state: absent
# Install a snap with classic confinement
- name: Install "foo" with option --classic
snap:
name: foo
classic: yes
# Install a snap with from a specific channel
- name: Install "foo" with option --channel=latest/edge
snap:
name: foo
channel: latest/edge
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| channel string | When snaps are installed | The channel the snaps were installed from |
| classic boolean | When snaps are installed | Whether or not the snaps were installed with the classic confinement |
| cmd string | When changed is true | The command that was executed on the host |
| snaps_installed list | When any snaps have been installed | The list of actually installed snaps |
| snaps_removed list | When any snaps have been removed | The list of actually removed snaps |
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Victor Carceler (@vcarceler) <vcarceler@iespuigcastellar.xeill.net>
- Stanislas Lange (@angristan) <angristan@pm.me>
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/snap_module.html