Commit Graph

15 Commits (5a7a9a0a30b139f38a92323409717b0a2c491cd9)

Author SHA1 Message Date
Brian Coca ecee427cbc added note about behaviour change in 2.2 9 years ago
Leo Antunes d54905ecee Allow multiple keys per host + minor improvements (#716)
* known_hosts: clarify key format in documentation

Add a small clarification to the documentation about the format of the
"key" parameter.
Should make #664 less of a issue for newcomers.

* known_hosts: normalize key entry to simplify input

Keys are normalized before comparing input with present keys. This
should make it easier to deal with some corner cases, such as having a
hashed entry for some host and trying to add it as non-hashed.

* known_hosts: allow multiple entries per host

In order to support multiple key types and allow the installed ssh
version to decide which is more secure, the module now only overwrites
an existing entry in known_hosts if the provided key is of the same
type.
Old keys of different types must be explicitly removed. Setting
state to "absent" and providing no key will remove all entries for the
host.
9 years ago
Michael Scherer 557d37d3f1 Use type='path' rather than str, so path is expanded correctly 9 years ago
Brian Coca 9fb6054500 avoid index error on empty list, key being true means its not None nor []
fixes #13009
9 years ago
Michael Scherer 162f257412 Use the parameter 'name' everywhere for consistency
Fix https://github.com/ansible/ansible/issues/11395
9 years ago
Greg DeKoenigsberg 004dedba8a Changes to author formatting, remove emails 10 years ago
Brian Coca 08445418aa more string corrections 10 years ago
Greg DeKoenigsberg 3d4477ab07 Adding author's github id 10 years ago
Sterling Windmill 7c675705f3 Allow for specifying name instead of host as per the documentation at http://docs.ansible.com/known_hosts_module.html 10 years ago
Brian Coca 2535a49284 fixed 2.4 compatibility 10 years ago
Brian Coca 89284bcce0 now also captrure OSErrors on temp file
fixes #360
10 years ago
Matthew Vernon 30cf73e83a Fix for issue #353 (handle change in ssh-keygen behaviour)
Prior to openssh 6.4, ssh-keygen -F returned 0 (and no output) when no
host was found. After then, it instead returned 1 and no output. This
revised code behaves correctly with either behaviour. There is
currently no other code path that results in exit(1) and no output.
10 years ago
Tyler Kellen c08ce5b30d correct version_added for known_hosts
It was added in 1.9, not 1.6.
10 years ago
Matthew Vernon 7a9e6aee90 Changes from Brian Coca's review of this module
These are all the code changes from Brian's review:
* change #! line
* rename "host" to "name" [keep as alias]
* make documentation clearer
* imports 1 per line
* use get_bin_path to find ssh-keygen
* key not actually required when removing host
10 years ago
Matthew Vernon d821a39131 known_hosts: manage ssh known_hosts files with ansible.
The known_hosts module lets you add or remove a host from the
known_hosts file. This is useful if you're going to want to use the
git module over ssh, for example. If you have a very large number of
host keys to manage, you will find the template module more useful.

This was pull request 7840 from the old ansible repo, which was
accepted-in-principle but not yet merged. The mailing list thread
reading it is:

https://groups.google.com/forum/#!topic/ansible-devel/_e7H_VT6UJE/discussion
10 years ago