community.general.snap_alias (8.5.0) — module

Manages snap aliases

| "added in version" 4.0.0 of community.general"

Authors: Alexei Znamensky (@russoz) <russoz@gmail.com>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manages snaps aliases.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install "foo" and "bar" snap
- name: Create snap alias
  community.general.snap_alias:
    name: hello-world
    alias: hw
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create multiple aliases
  community.general.snap_alias:
    name: hello-world
    aliases:
      - hw
      - hw2
      - hw3
    state: present   # optional
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove one specific aliases
  community.general.snap_alias:
    name: hw
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove all aliases for snap
  community.general.snap_alias:
    name: hello-world
    state: absent

Inputs

    
name:
    description:
    - Name of the snap.
    type: str

alias:
    aliases:
    - aliases
    description:
    - Aliases to be created or removed.
    elements: str
    type: list

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Desired state of the alias.
    type: str

Outputs

snap_aliases:
  description: The snap aliases after execution. If called in check mode, then the
    list represents the state before execution.
  elements: str
  returned: always
  type: list

See also