diff --git a/changelogs/fragments/5659-fix-lxc_container-command.yml b/changelogs/fragments/5659-fix-lxc_container-command.yml new file mode 100644 index 0000000000..450d889808 --- /dev/null +++ b/changelogs/fragments/5659-fix-lxc_container-command.yml @@ -0,0 +1,2 @@ +bugfixes: + - lxc_container - fix the arguments of the lxc command which broke the creation and cloning of containers (https://github.com/ansible-collections/community.general/issues/5578). diff --git a/plugins/modules/cloud/lxc/lxc_container.py b/plugins/modules/cloud/lxc/lxc_container.py index 7871f13972..9fe27b8d81 100644 --- a/plugins/modules/cloud/lxc/lxc_container.py +++ b/plugins/modules/cloud/lxc/lxc_container.py @@ -677,7 +677,7 @@ class LxcContainerManagement(object): 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 )