mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
docker_swarm_service: Don't override docker-py secret/config defaults (#54611)
* Only supply specified config arguments * Only supply specified secret arguments
This commit is contained in:
parent
acaf91d5f0
commit
d56e64f3cd
1 changed files with 36 additions and 20 deletions
|
@ -1815,31 +1815,47 @@ class DockerService(DockerBaseClass):
|
|||
if self.configs is not None:
|
||||
configs = []
|
||||
for config_config in self.configs:
|
||||
configs.append(
|
||||
types.ConfigReference(
|
||||
config_id=config_config['config_id'],
|
||||
config_name=config_config['config_name'],
|
||||
filename=config_config.get('filename'),
|
||||
uid=config_config.get('uid'),
|
||||
gid=config_config.get('gid'),
|
||||
mode=config_config.get('mode')
|
||||
)
|
||||
)
|
||||
config_args = {
|
||||
'config_id': config_config['config_id'],
|
||||
'config_name': config_config['config_name']
|
||||
}
|
||||
filename = config_config.get('filename')
|
||||
if filename:
|
||||
config_args['filename'] = filename
|
||||
uid = config_config.get('uid')
|
||||
if uid:
|
||||
config_args['uid'] = uid
|
||||
gid = config_config.get('gid')
|
||||
if gid:
|
||||
config_args['gid'] = gid
|
||||
mode = config_config.get('mode')
|
||||
if mode:
|
||||
config_args['mode'] = mode
|
||||
|
||||
configs.append(types.ConfigReference(**config_args))
|
||||
|
||||
secrets = None
|
||||
if self.secrets is not None:
|
||||
secrets = []
|
||||
for secret_config in self.secrets:
|
||||
secrets.append(
|
||||
types.SecretReference(
|
||||
secret_id=secret_config['secret_id'],
|
||||
secret_name=secret_config['secret_name'],
|
||||
filename=secret_config.get('filename'),
|
||||
uid=secret_config.get('uid'),
|
||||
gid=secret_config.get('gid'),
|
||||
mode=secret_config.get('mode')
|
||||
)
|
||||
)
|
||||
secret_args = {
|
||||
'secret_id': secret_config['secret_id'],
|
||||
'secret_name': secret_config['secret_name']
|
||||
}
|
||||
filename = secret_config.get('filename')
|
||||
if filename:
|
||||
secret_args['filename'] = filename
|
||||
uid = secret_config.get('uid')
|
||||
if uid:
|
||||
secret_args['uid'] = uid
|
||||
gid = secret_config.get('gid')
|
||||
if gid:
|
||||
secret_args['gid'] = gid
|
||||
mode = secret_config.get('mode')
|
||||
if mode:
|
||||
secret_args['mode'] = mode
|
||||
|
||||
secrets.append(types.SecretReference(**secret_args))
|
||||
|
||||
dns_config_args = {}
|
||||
if self.dns is not None:
|
||||
|
|
Loading…
Reference in a new issue