You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets
Marius Gedminas 2efb692cc4 known_hosts: support --diff (#20349)
* known_hosts: support --diff

* known_hosts: support --diff also without --check

* Add unit tests and fix incorrect diff in one corner case

Tests are good!

* Refactor for readability

* Python 3 compat

* More Python 3 compat

* Add an integration test for known_hosts

* Handle ssh-keygen -HF returning non-zero exit code

AFAICT this is a bug in ssh-keygen in some newer OpenSSH versions
(>= 6.4 probably; see commit dd9d5cc670):
when you invoke ssh-keygen with -H and -F <host> options, it always
returns exit code 1.  This is because in ssh-keygen.c there's a function
do_known_hosts() which calls

  exit (find_host && !ctx.found_key);

at the end, and find_host is 1 (because we passed -F on the command line),
but ctx.found_key is always 0.  Why is found_key always 0?  Because the
callback passed to hostkeys_foreach(), which is known_hosts_hash(),
never bothers to set found_key to 1.

* This test does not need root

* Avoid ssh-ed25519 keys in sample known_hosts file

Older versions of OpenSSH do not like them and ssh-keygen -HF
aborts with an error when it sees such keys:

  line 5 invalid key: example.net...
  /root/ansible_testing/known_hosts is not a valid known_hosts file.

* Fix Python 3 errors

Specifically, the default mode of tempfile.NamedTemporaryFile is 'w+b',
which means Python 3 wants us to write bytes objects to it -- but the
keys we have are all unicode strings.
8 years ago
..
add_host
ansible
apache2_module
apt
apt_repository
args
asa_acl
asa_command
asa_config
assemble
async
async_extra_data
authorized_key
become
binary
binary_modules
binary_modules_posix
binary_modules_winrm
blocks
changed_when
check_mode
cloudscale_server
command_shell
conditionals
connection
connection_chroot
connection_docker
connection_jail
connection_libvirt_lxc
connection_local
connection_lxc
connection_lxd
connection_paramiko_ssh
connection_posix
connection_ssh
connection_winrm
copy
delegate_to
dellos6_command
dellos6_config
dellos6_facts
dellos9_command
dellos9_config
dellos9_facts
dellos10_command
dellos10_config
dellos10_facts
dnf
docker
embedded_module
environment
eos_command
eos_config
eos_eapi
eos_facts
eos_template
facts_d
failed_when
fetch
file
filters
gathering_facts
gem
get_url
git
group_by
groupby_filter
handlers
hash
hg
hosts_field
ignore_errors
include_vars
includes
ios_command
ios_config
ios_facts
ios_template
iosxr_command
iosxr_config
iosxr_facts
iosxr_template
iterators
junos_command
junos_config
junos_netconf
junos_template
known_hosts known_hosts: support --diff (#20349) 8 years ago
lineinfile
locale_gen
lookup_paths
lookup_properties
lookups
loops
module_utils
mount
mysql_db
mysql_user
mysql_variables
net_command
no_log
nxos_command
nxos_config
nxos_facts
nxos_nxapi
nxos_template
ops_command
parsing
ping
pip
postgresql
prepare_eos_tests/tasks
prepare_http_tests
prepare_ios_tests
prepare_iosxr_tests
prepare_nxos_tests/tasks
prepare_tests/tasks
prepare_win_tests
pull_limit_inventory
pull_no_127
pull_run
script
sefcontext
service
setup_mysql_db
setup_postgresql_db
special_vars
stat
subversion
synchronize
tags
task_ordering
template
template_jinja2_latest
templating_settings
test_infra
unarchive
unicode
until
uri
var_blending
var_precedence
vault
vyos_command
vyos_config
win_async_wrapper
win_command
win_copy
win_feature
win_fetch
win_file
win_get_url
win_group
win_lineinfile
win_msi
win_package
win_path
win_ping
win_raw
win_regedit
win_regmerge
win_script
win_service
win_setup
win_shell
win_shortcut
win_slurp
win_stat
win_template
win_user
yum
zypper
zypper_repository