Class: Ansible::Ruby::Modules::Known_hosts

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/extras/system/known_hosts.rb

Overview

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.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#keyString?

Returns 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).

Returns:

  • (String, nil)

    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)



15
# File 'lib/ansible/ruby/modules/generated/extras/system/known_hosts.rb', line 15

attribute :key

#nameString

Returns The host to add or remove (must match a host specified in key).

Returns:

  • (String)

    The host to add or remove (must match a host specified in key)



11
# File 'lib/ansible/ruby/modules/generated/extras/system/known_hosts.rb', line 11

attribute :name

#pathString?

Returns The known_hosts file to edit.

Returns:

  • (String, nil)

    The known_hosts file to edit



19
# File 'lib/ansible/ruby/modules/generated/extras/system/known_hosts.rb', line 19

attribute :path

#state:present, ...

Returns I(present) to add the host, I(absent) to remove it.

Returns:

  • (:present, :absent, nil)

    I(present) to add the host, I(absent) to remove it.



23
# File 'lib/ansible/ruby/modules/generated/extras/system/known_hosts.rb', line 23

attribute :state