From 29a4bfa8e020d52a8dd3f24de37e51b1dcf06258 Mon Sep 17 00:00:00 2001 From: Eric L Date: Sun, 22 Nov 2020 12:29:45 +0100 Subject: [PATCH] Add mac_address field to podman_container module * extended description of podman_container * add mac_address field and add_param function in podman_container_lib * closes #146 --- plugins/module_utils/podman/podman_container_lib.py | 4 ++++ plugins/modules/podman_container.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index fedf4057..21b8f4f3 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -78,6 +78,7 @@ type='str', choices=["debug", "info", "warn", "error", "fatal", "panic"]), log_opt=dict(type='str', aliases=['log_options']), + mac_address=dict(type='str'), memory=dict(type='str'), memory_reservation=dict(type='str'), memory_swap=dict(type='str'), @@ -391,6 +392,9 @@ def addparam_log_opt(self, c): def addparam_log_level(self, c): return c + ['--log-level', self.params['log_level']] + def addparam_mac_address(self, c): + return c + ['--mac-address', self.params['mac_address']] + def addparam_memory(self, c): return c + ['--memory', self.params['memory']] diff --git a/plugins/modules/podman_container.py b/plugins/modules/podman_container.py index 4310f448..593e49c5 100644 --- a/plugins/modules/podman_container.py +++ b/plugins/modules/podman_container.py @@ -426,6 +426,12 @@ type: str aliases: - log_options + mac_address: + description: + - Specify a MAC address for the container, for example + '92:d0:c6:0a:29:33'. + Don't forget that it must be unique within one Ethernet network. + type: str memory: description: - Memory limit (format 10k, where unit = b, k, m or g)