Skip to content

Commit

Permalink
Add support from device_cgroup_rules parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
franjurinec committed Jul 2, 2024
1 parent 1713995 commit 857e63f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/module_utils/module_container/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,11 @@ def _compare_platform(option, param_value, container_value):
))
)

OPTION_DEVICE_CGROUP_RULES = (
OptionGroup()
.add_option('device_cgroup_rules', type='list', elements='str')
)

OPTION_DNS_SERVERS = (
OptionGroup()
.add_option('dns_servers', type='list', elements='str')
Expand Down Expand Up @@ -1194,6 +1199,7 @@ def _compare_platform(option, param_value, container_value):
OPTION_DEVICE_READ_IOPS,
OPTION_DEVICE_WRITE_IOPS,
OPTION_DEVICE_REQUESTS,
OPTION_DEVICE_CGROUP_RULES,
OPTION_DNS_SERVERS,
OPTION_DNS_OPTS,
OPTION_DNS_SEARCH_DOMAINS,
Expand Down
3 changes: 3 additions & 0 deletions plugins/module_utils/module_container/docker_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
OPTION_DEVICE_READ_IOPS,
OPTION_DEVICE_WRITE_IOPS,
OPTION_DEVICE_REQUESTS,
OPTION_DEVICE_CGROUP_RULES,
OPTION_DNS_SERVERS,
OPTION_DNS_OPTS,
OPTION_DNS_SEARCH_DOMAINS,
Expand Down Expand Up @@ -1290,6 +1291,8 @@ def _preprocess_container_names(module, client, api_version, value):
OPTION_DEVICE_REQUESTS.add_engine('docker_api', DockerAPIEngine.host_config_value(
'DeviceRequests', min_api_version='1.40', preprocess_value=_preprocess_device_requests))

OPTION_DEVICE_CGROUP_RULES.add_engine('docker_api', DockerAPIEngine.host_config_value('DeviceCgroupsRules'))

OPTION_DNS_SERVERS.add_engine('docker_api', DockerAPIEngine.host_config_value('Dns'))

OPTION_DNS_OPTS.add_engine('docker_api', DockerAPIEngine.host_config_value('DnsOptions'))
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@
- Driver-specific options.
type: dict
version_added: 0.1.0
device_cgroup_rules:
description:
- List of cgroup rules to apply to the container.
type: list
elements: str
dns_opts:
description:
- List of DNS options.
Expand Down

0 comments on commit 857e63f

Please sign in to comment.