community.general.snap_alias – Manages snap aliases

Note

This plugin is part of the community.general collection (version 4.2.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 Choices/Defaults Comments
alias
list / elements=string
Aliases to be created or removed.

aliases: aliases
name
string
Name of the snap.
state
string
    Choices:
  • absent
  • present ←
Desired state of the alias.

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 Returned Description
snap_aliases
list / elements=string
always
The snap aliases after execution. If called in check mode, then the list represents the state before execution.



Authors