mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-19 11:20:22 -07:00
snap: add RV version (#9598)
* snap: add RV version * add chglog frag * fix typo * fix docs * add missing import * fix sanity * more fixes * Update plugins/modules/snap.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/snap_alias.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
8f29976102
commit
f27d5e7a42
5 changed files with 57 additions and 11 deletions
|
@ -80,13 +80,18 @@ snap_aliases:
|
|||
type: list
|
||||
elements: str
|
||||
returned: always
|
||||
version:
|
||||
description: Versions of snap components as reported by C(snap version).
|
||||
type: dict
|
||||
returned: always
|
||||
version_added: 10.3.0
|
||||
"""
|
||||
|
||||
|
||||
import re
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.module_helper import StateModuleHelper
|
||||
from ansible_collections.community.general.plugins.module_utils.snap import snap_runner
|
||||
from ansible_collections.community.general.plugins.module_utils.snap import snap_runner, get_version
|
||||
|
||||
|
||||
class SnapAlias(StateModuleHelper):
|
||||
|
@ -112,6 +117,7 @@ class SnapAlias(StateModuleHelper):
|
|||
|
||||
def __init_module__(self):
|
||||
self.runner = snap_runner(self.module)
|
||||
self.vars.version = get_version(self.runner)
|
||||
self.vars.set("snap_aliases", self._aliases(), change=True, diff=True)
|
||||
|
||||
def __quit_module__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue