[PR #5866/7e3c73ce backport][stable-6] lxd_container: add check- and diff-mode support (#6032)

`lxd_container`: add check- and diff-mode support (#5866)

* lxd_container module: Automate CONFIG_PARAM handling.

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>

* lxd_container: check- and diff mode

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>

* Make JSON lookups safer and fix crashes in check mode when instance is absent

* lxd_profile: fix docstring typos

* lxd_container: simplify _needs_to_change_instance_config()

* lxd_container: add docstring for check- and diff-mode and changelog fragment

* style fixes

* lxd_container: fix typo in actions: "unfreez" lacks an "e"

---------

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
(cherry picked from commit 7e3c73ceb2)

Co-authored-by: Prawn <Insane.Prawny@gmail.com>
This commit is contained in:
patchback[bot] 2023-02-22 14:49:28 +01:00 committed by GitHub
parent db451bf68a
commit 0c295d4f61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 87 additions and 64 deletions

View file

@ -35,7 +35,7 @@ options:
type: str
config:
description:
- 'The config for the container (e.g. {"limits.memory": "4GB"}).
- 'The config for the instance (e.g. {"limits.memory": "4GB"}).
See U(https://github.com/lxc/lxd/blob/master/doc/rest-api.md#patch-3)'
- If the profile already exists and its "config" value in metadata
obtained from
@ -247,7 +247,7 @@ CONFIG_PARAMS = [
class LXDProfileManagement(object):
def __init__(self, module):
"""Management of LXC containers via Ansible.
"""Management of LXC profiles via Ansible.
:param module: Processed Ansible Module.
:type module: ``object``