The M(known_hosts) module lets you add or remove a host from the C(known_hosts) file. This is useful if you're going to want to use the M(git) module over ssh, for example. If you have a very large number of host keys to manage, you will find the M(template) module more useful.

Options

namedescriptionrequiredchoices
name The host to add or remove (must match a host specified in key) true
key The SSH public host key, as a string (required if state=present, optional when state=absent, in which case all keys for the host are removed)
path The known_hosts file to edit no
state I(present) to add the host, I(absent) to remove it. no
  • present
  • absent

Author

Matthew Vernon (@mcv21)