Set accept_hostkey to False by default in the git module and fail
early if the key is unknown
This commit is contained in:
parent
24eba74edd
commit
13ce8728de
1 changed files with 4 additions and 4 deletions
|
@ -45,7 +45,7 @@ options:
|
||||||
branch name, or a tag name.
|
branch name, or a tag name.
|
||||||
accept_hostkey:
|
accept_hostkey:
|
||||||
required: false
|
required: false
|
||||||
default: true
|
default: false
|
||||||
version_added: "1.5"
|
version_added: "1.5"
|
||||||
description:
|
description:
|
||||||
- Add the hostkey for the repo url if not already added.
|
- Add the hostkey for the repo url if not already added.
|
||||||
|
@ -359,7 +359,7 @@ def main():
|
||||||
force=dict(default='yes', type='bool'),
|
force=dict(default='yes', type='bool'),
|
||||||
depth=dict(default=None, type='int'),
|
depth=dict(default=None, type='int'),
|
||||||
update=dict(default='yes', type='bool'),
|
update=dict(default='yes', type='bool'),
|
||||||
accept_hostkey=dict(default='yes', type='bool'),
|
accept_hostkey=dict(default='no', type='bool'),
|
||||||
executable=dict(default=None),
|
executable=dict(default=None),
|
||||||
bare=dict(default='no', type='bool'),
|
bare=dict(default='no', type='bool'),
|
||||||
),
|
),
|
||||||
|
@ -378,8 +378,8 @@ def main():
|
||||||
git_path = module.params['executable'] or module.get_bin_path('git', True)
|
git_path = module.params['executable'] or module.get_bin_path('git', True)
|
||||||
|
|
||||||
# add the git repo's hostkey
|
# add the git repo's hostkey
|
||||||
if module.params['accept_hostkey']:
|
#if module.params['accept_hostkey']:
|
||||||
add_git_host_key(module, repo, accept_hostkey=True)
|
add_git_host_key(module, repo, accept_hostkey=module.params['accept_hostkey'])
|
||||||
|
|
||||||
if bare:
|
if bare:
|
||||||
gitconfig = os.path.join(dest, 'config')
|
gitconfig = os.path.join(dest, 'config')
|
||||||
|
|
Loading…
Reference in a new issue