snap_connect: new module to manage snap interface connections (#11682)

* snap_connect: new module to manage snap interface connections

Fixes #7722

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* simplify _get_connections()

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky
2026-04-03 16:18:17 +13:00
committed by GitHub
parent 982f9472c5
commit b79a45753f
7 changed files with 302 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ def snap_runner(module: AnsibleModule, **kwargs) -> CmdRunner:
info=cmd_runner_fmt.as_fixed("info"),
dangerous=cmd_runner_fmt.as_bool("--dangerous"),
version=cmd_runner_fmt.as_fixed("version"),
_connect=cmd_runner_fmt.as_func(lambda v: ["connect", v]),
_disconnect=cmd_runner_fmt.as_func(lambda v: ["disconnect", v]),
_connections=cmd_runner_fmt.as_fixed("connections"),
slot=cmd_runner_fmt.as_list(),
),
check_rc=False,
**kwargs,