From c41dce07bd3f6b083608bc21abaa343414678b23 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 5 Dec 2022 13:42:25 +0000 Subject: [PATCH] lxc_container: fix lxc argument when executing lxc command lxc_container fails when executing the lxc command (e.g. when creating a new container) because PR#5358 broke the module argument parsing. The resulting argument dict contained only the module argument name and the argument flag but not the value. E.g. ``` - lxc_container: template: debian ``` would result in lxc command arguments `lxc template --template` instead of `lxc --template debian`. Fixes: 6f88426cf1dc ("lxc_container: minor refactor (#5358)") Fixes #5578 Signed-off-by: Alexander Couzens --- plugins/modules/lxc_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/lxc_container.py b/plugins/modules/lxc_container.py index 7871f139720..9fe27b8d816 100644 --- a/plugins/modules/lxc_container.py +++ b/plugins/modules/lxc_container.py @@ -677,7 +677,7 @@ def _get_vars(self, variables): false_values = BOOLEANS_FALSE.union([None, '']) result = dict( - (k, v) + (v, self.module.params[k]) for k, v in variables.items() if self.module.params[k] not in false_values )