mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
docker_container: fix env_file option (#452)
* Add better tests for env and env_file. * Make sure that non-container options are also passed to preprocessing code. * Add changelog fragment. * Add env_file override test.
This commit is contained in:
@@ -123,6 +123,7 @@ class OptionGroup(object):
|
||||
return values
|
||||
self.preprocess = preprocess
|
||||
self.options = []
|
||||
self.all_options = []
|
||||
self.engines = {}
|
||||
self.ansible_mutually_exclusive = ansible_mutually_exclusive or []
|
||||
self.ansible_required_together = ansible_required_together or []
|
||||
@@ -135,6 +136,7 @@ class OptionGroup(object):
|
||||
option = Option(*args, owner=self, **kwargs)
|
||||
if not option.not_a_container_option:
|
||||
self.options.append(option)
|
||||
self.all_options.append(option)
|
||||
if not option.not_an_ansible_option:
|
||||
ansible_option = {
|
||||
'type': option.ansible_type,
|
||||
|
||||
@@ -258,7 +258,7 @@ class ContainerManager(DockerBaseClass):
|
||||
for options in active_options:
|
||||
values = {}
|
||||
engine = options.get_engine(self.engine_driver.name)
|
||||
for option in options.options:
|
||||
for option in options.all_options:
|
||||
if not option.not_an_ansible_option and self.module.params[option.name] is not None:
|
||||
values[option.name] = self.module.params[option.name]
|
||||
values = options.preprocess(self.module, values)
|
||||
|
||||
Reference in New Issue
Block a user