community / community.general / 3.8.10 / module / snap Manages snaps Authors: Victor Carceler (@vcarceler) <vcarceler@iespuigcastellar.xeill.net>, Stanislas Lange (@angristan) <angristan@pm.me>community.general.snap (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Manages snaps packages.
# Install "foo" and "bar" snap - name: Install foo community.general.snap: name: - foo - bar
# Remove "foo" snap - name: Remove foo community.general.snap: name: foo state: absent
# Install a snap with classic confinement - name: Install "foo" with option --classic community.general.snap: name: foo classic: yes
# Install a snap with from a specific channel - name: Install "foo" with option --channel=latest/edge community.general.snap: name: foo channel: latest/edge
name: description: - Name of the snaps. elements: str required: true type: list state: choices: - absent - present - enabled - disabled default: present description: - Desired state of the package. required: false type: str channel: default: stable description: - 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. required: false type: str classic: default: false description: - 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. required: false type: bool
channel: description: The channel the snaps were installed from returned: When snaps are installed type: str classic: description: Whether or not the snaps were installed with the classic confinement returned: When snaps are installed type: bool cmd: description: The command that was executed on the host returned: When changed is true type: str snaps_installed: description: The list of actually installed snaps returned: When any snaps have been installed type: list snaps_removed: description: The list of actually removed snaps returned: When any snaps have been removed type: list