mirror of
https://github.com/ansible/awx.git
synced 2026-03-26 05:15:02 -02:30
Add option for ignoring tls on Container Registry credentials
This commit is contained in:
@@ -1111,6 +1111,12 @@ ManagedCredentialType(
|
|||||||
'secret': True,
|
'secret': True,
|
||||||
'help_text': ugettext_noop('A password or token used to authenticate with'),
|
'help_text': ugettext_noop('A password or token used to authenticate with'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'id': 'verify_ssl',
|
||||||
|
'label': ugettext_noop('Verify SSL'),
|
||||||
|
'type': 'boolean',
|
||||||
|
'default': True,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
'required': ['host'],
|
'required': ['host'],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1068,6 +1068,30 @@ class BaseTask(object):
|
|||||||
|
|
||||||
env['AWX_PRIVATE_DATA_DIR'] = private_data_dir
|
env['AWX_PRIVATE_DATA_DIR'] = private_data_dir
|
||||||
|
|
||||||
|
ee_cred = self.instance.execution_environment.credential
|
||||||
|
if ee_cred:
|
||||||
|
verify_ssl = ee_cred.get_input('verify_ssl')
|
||||||
|
if not verify_ssl:
|
||||||
|
pdd_wrapper_path = os.path.split(private_data_dir)[0]
|
||||||
|
registries_conf_path = os.path.join(pdd_wrapper_path, 'registries.conf')
|
||||||
|
host = ee_cred.get_input('host')
|
||||||
|
|
||||||
|
with open(registries_conf_path, 'w') as registries_conf:
|
||||||
|
os.chmod(registries_conf.name, stat.S_IRUSR | stat.S_IWUSR)
|
||||||
|
|
||||||
|
lines = [
|
||||||
|
'[[registry]]',
|
||||||
|
'location = "{}"'.format(host),
|
||||||
|
'insecure = true',
|
||||||
|
]
|
||||||
|
|
||||||
|
registries_conf.write('\n'.join(lines))
|
||||||
|
|
||||||
|
# Podman >= 3.1.0
|
||||||
|
env['CONTAINERS_REGISTRIES_CONF'] = registries_conf_path
|
||||||
|
# Podman < 3.1.0
|
||||||
|
env['REGISTRIES_CONFIG_PATH'] = registries_conf_path
|
||||||
|
|
||||||
return env
|
return env
|
||||||
|
|
||||||
def should_use_resource_profiling(self, job):
|
def should_use_resource_profiling(self, job):
|
||||||
|
|||||||
Reference in New Issue
Block a user