1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 13:55:31 +03:00

improve host key checking configurability

see: https://github.com/ansible/tower/issues/3737
This commit is contained in:
Ryan Petrello 2019-09-30 12:26:30 -04:00
parent d2a5af44de
commit 82be87566f
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777
5 changed files with 20 additions and 1 deletions

View File

@ -298,6 +298,16 @@ register(
category_slug='jobs',
)
register(
'AWX_ISOLATED_HOST_KEY_CHECKING',
field_class=fields.BooleanField,
label=_('Isolated host key checking'),
help_text=_('When set to True, AWX will enforce strict host key checking for communication with isolated nodes.'),
category=_('Jobs'),
category_slug='jobs',
default=False
)
register(
'AWX_ISOLATED_KEY_GENERATION',
field_class=fields.BooleanField,

View File

@ -44,7 +44,7 @@ class IsolatedManager(object):
def build_runner_params(self, hosts, verbosity=1):
env = dict(os.environ.items())
env['ANSIBLE_RETRY_FILES_ENABLED'] = 'False'
env['ANSIBLE_HOST_KEY_CHECKING'] = 'False'
env['ANSIBLE_HOST_KEY_CHECKING'] = str(settings.AWX_ISOLATED_HOST_KEY_CHECKING)
env['ANSIBLE_LIBRARY'] = os.path.join(os.path.dirname(awx.__file__), 'plugins', 'isolated')
set_pythonpath(os.path.join(settings.ANSIBLE_VENV_PATH, 'lib'), env)

View File

@ -33,6 +33,7 @@ class Command(BaseCommand):
]):
ssh_key = settings.AWX_ISOLATED_PRIVATE_KEY
env = dict(os.environ.items())
env['ANSIBLE_HOST_KEY_CHECKING'] = str(settings.AWX_ISOLATED_HOST_KEY_CHECKING)
set_pythonpath(os.path.join(settings.ANSIBLE_VENV_PATH, 'lib'), env)
res = ansible_runner.interface.run(
private_data_dir=path,

View File

@ -403,6 +403,11 @@ EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_TLS = False
# Default to skipping isolated host key checking (the initial connection will
# hang on an interactive "The authenticity of host example.org can't be
# established" message)
AWX_ISOLATED_HOST_KEY_CHECKING = False
# The number of seconds to sleep between status checks for jobs running on isolated nodes
AWX_ISOLATED_CHECK_INTERVAL = 30

View File

@ -71,6 +71,9 @@ export default ['i18n', function(i18n) {
codeMirror: true,
class: 'Form-textAreaLabel Form-formGroup--fullWidth'
},
AWX_ISOLATED_HOST_KEY_CHECKING: {
type: 'toggleSwitch',
},
AWX_ISOLATED_CHECK_INTERVAL: {
type: 'text',
reset: 'AWX_ISOLATED_CHECK_INTERVAL'