ansible.builtin.sorcery (v2.9.27) — module

Package manager for Source Mage GNU/Linux

| "added in version" 2.3 of ansible.builtin"

Authors: Vlad Glagolev (@vaygr)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manages "spells" on Source Mage GNU/Linux using I(sorcery) toolchain


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make sure spell 'foo' is installed
- sorcery:
    spell: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make sure spells 'foo', 'bar' and 'baz' are removed
- sorcery:
    spell: foo,bar,baz
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make sure spell 'foo' with dependencies 'bar' and 'baz' is installed
- sorcery:
    spell: foo
    depends: bar,baz
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make sure spell 'foo' with 'bar' and without 'baz' dependencies is installed
- sorcery:
    spell: foo
    depends: +bar,-baz
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Make sure spell 'foo' with libressl (providing SSL) dependency is installed
- sorcery:
    spell: foo
    depends: libressl(SSL)
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Playbook: make sure spells with/without required dependencies (if any) are installed
- sorcery:
    name: "{{ item.spell }}"
    depends: "{{ item.depends | default(None) }}"
    state: present
  loop:
    - { spell: 'vifm', depends: '+file,-gtk+2' }
    - { spell: 'fwknop', depends: 'gpgme' }
    - { spell: 'pv,tnftp,tor' }
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install the latest version of spell 'foo' using regular glossary
- sorcery:
    name: foo
    state: latest
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Rebuild spell 'foo'
- sorcery:
    spell: foo
    state: rebuild
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Rebuild the whole system, but update Sorcery and Codex first
- sorcery:
    spell: '*'
    state: rebuild
    update: yes
    update_cache: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Refresh the grimoire collection if it's 1 day old using native sorcerous alias
- sorcery:
    update_codex: yes
    cache_valid_time: 86400
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update only Sorcery itself
- sorcery:
    update: yes

Inputs

    
name:
    aliases:
    - spell
    description:
    - Name of the spell
    - multiple names can be given, separated by commas
    - special value '*' in conjunction with states C(latest) or C(rebuild) will update
      or rebuild the whole system respectively

state:
    choices:
    - present
    - latest
    - absent
    - cast
    - dispelled
    - rebuild
    default: present
    description:
    - Whether to cast, dispel or rebuild a package
    - state C(cast) is an equivalent of C(present), not C(latest)
    - state C(latest) always triggers C(update_cache=yes)
    - state C(rebuild) implies cast of all specified spells, not only those existed before

update:
    default: 'no'
    description:
    - Whether or not to update sorcery scripts at the very first stage
    type: bool

depends:
    description:
    - Comma-separated list of _optional_ dependencies to build a spell (or make sure it
      is built) with; use +/- in front of dependency to turn it on/off ('+' is optional
      though)
    - this option is ignored if C(name) parameter is equal to '*' or contains more than
      one spell
    - providers must be supplied in the form recognized by Sorcery, e.g. 'openssl(SSL)'

update_cache:
    aliases:
    - update_codex
    default: 'no'
    description:
    - Whether or not to update grimoire collection before casting spells
    type: bool

cache_valid_time:
    description:
    - Time in seconds to invalidate grimoire collection on update
    - especially useful for SCM and rsync grimoires
    - makes sense only in pair with C(update_cache)