Updating known_hosts module Docs (#58785)

This commit is contained in:
Kedar Kulkarni 2019-07-11 11:41:57 -04:00 committed by Sandra McCann
parent 6e3d54ae81
commit 17c88724ab

View file

@ -27,6 +27,7 @@ options:
aliases: [ 'host' ]
description:
- The host to add or remove (must match a host specified in key). It will be converted to lowercase so that ssh-keygen can find it.
- Must match with <hostname> or <ip> present in key attribute.
required: true
key:
description:
@ -36,6 +37,8 @@ options:
Specifically, the key should not match the format that is found in an SSH pubkey file, but should rather have the hostname prepended to a
line that includes the pubkey, the same way that it would appear in the known_hosts file. The value prepended to the line must also match
the value of the name parameter.
Should be of format `<hostname[,IP]> ssh-rsa <pubkey>`
path:
description:
- The known_hosts file to edit
@ -61,6 +64,13 @@ EXAMPLES = '''
path: /etc/ssh/ssh_known_hosts
name: foo.com.invalid
key: "{{ lookup('file', 'pubkeys/foo.com.invalid') }}"
- name: Another way to call known_hosts
known_hosts:
hostname: host1.example.com # or 10.9.8.77
key: host1.example.com,10.9.8.77 ssh-rsa ASDeararAIUHI324324 # some key gibberish
path: /etc/ssh/ssh_known_hosts
state: present
'''
# Makes sure public host keys are present or absent in the given known_hosts