community.general.snap_alias module – Manages snap aliases

Note

This module is part of the community.general collection (version 5.4.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.snap_alias.

New in version 4.0.0: of community.general

Synopsis

  • Manages snaps aliases.

Parameters

Parameter

Comments

alias

aliases: aliases

list / elements=string

Aliases to be created or removed.

name

string

Name of the snap.

state

string

Desired state of the alias.

Choices:

  • absent

  • present ← (default)

See Also

See also

community.general.snap

The official documentation on the community.general.snap module.

Examples

# Install "foo" and "bar" snap
- name: Create snap alias
  community.general.snap_alias:
    name: hello-world
    alias: hw

- name: Create multiple aliases
  community.general.snap_alias:
    name: hello-world
    aliases:
      - hw
      - hw2
      - hw3
    state: present   # optional

- name: Remove one specific aliases
  community.general.snap_alias:
    name: hw
    state: absent

- name: Remove all aliases for snap
  community.general.snap_alias:
    name: hello-world
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

snap_aliases

list / elements=string

The snap aliases after execution. If called in check mode, then the list represents the state before execution.

Returned: always

Authors

  • Alexei Znamensky (@russoz)