Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

known_hosts module fails to set values with spurious error message #43157

Closed
greg-hellings opened this issue Jul 23, 2018 · 4 comments · Fixed by #43163
Closed

known_hosts module fails to set values with spurious error message #43157

greg-hellings opened this issue Jul 23, 2018 · 4 comments · Fixed by #43163
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@greg-hellings
Copy link
Contributor

SUMMARY

The known_hosts module, when run in its default mode of adding entries to a file, fails with the error message "Host parameter does not match hashed host field in supplied key". This is not due to a problem with the key itself but rather in the way that the module writes the test file.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

known_hosts

ANSIBLE VERSION
ansible 2.6.1
  config file = /home/ghelling/.ansible.cfg
  configured module search path = [u'/home/ghelling/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ghelling/venv/tools/lib/python2.7/site-packages/ansible
  executable location = /home/ghelling/venv/tools/bin/ansible
  python version = 2.7.15 (default, May 16 2018, 17:50:09) [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)]
CONFIGURATION

ANSIBLE_PIPELINING(/home/ghelling/.ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/ghelling/.ansible.cfg) = -o ControlMaster=auto -o ControlPersist=600s -o Identiti>
ANSIBLE_SSH_CONTROL_PATH(/home/ghelling/.ansible.cfg) = %(directory)s/%%h-%%r
ANSIBLE_SSH_CONTROL_PATH_DIR(/home/ghelling/.ansible.cfg) = /tmp
DEFAULT_CALLBACK_WHITELIST(/home/ghelling/.ansible.cfg) = ['timer', 'profile_tasks']
DEFAULT_FORKS(/home/ghelling/.ansible.cfg) = 10
DEFAULT_STDOUT_CALLBACK(/home/ghelling/.ansible.cfg) = yaml
HOST_KEY_CHECKING(/home/ghelling/.ansible.cfg) = False

OS / ENVIRONMENT

N/A

EXPECTED RESULTS

Module properly sets a valid SSH pubkey

ACTUAL RESULTS
failed: [test-passwordless_ssh2] (item=test-passwordless_ssh2) => {"changed": false, "item": "test-passwordless_ssh2", "msg": "Host parameter does not match hashed host field in supplied key"}
@ansibot
Copy link
Contributor

ansibot commented Jul 23, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jul 23, 2018

cc @mcv21
click here for bot help

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jul 23, 2018
greg-hellings added a commit to greg-hellings/ansible that referenced this issue Jul 24, 2018
The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes ansible#43157
@greg-hellings
Copy link
Contributor Author

This appears to have been an issue with documentation being unclear. I've updated the docs in a way that seems to reflect the module's intention better. I also left in the test to the code that I had written, since more code testing is rarely a bad thing.

@mcv21
Copy link

mcv21 commented Jul 24, 2018

I'm happy with the documentation suggested in the linked PR.

bcoca pushed a commit that referenced this issue Jul 24, 2018
The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes #43157
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Jul 26, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants