Class: Ridley::HostConnector::Base

Inherits:
Object
  • Object
show all
Includes:
Celluloid, Logging
Defined in:
lib/ridley/host_connector.rb

Direct Known Subclasses

SSH, WinRM

Instance Method Summary collapse

Methods included from Logging

logger, #logger, set_logger

Instance Method Details

#bootstrap(host, options = {}) ⇒ HostConnector::Response

Bootstrap a node

Parameters:

  • host (String)

    the host to perform the action on

  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


26
27
28
# File 'lib/ridley/host_connector.rb', line 26

def bootstrap(host, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end

#chef_client(host, options = {}) ⇒ HostConnector::Response

Perform a chef client run on a node

Parameters:

  • host (String)

    the host to perform the action on

  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


37
38
39
# File 'lib/ridley/host_connector.rb', line 37

def chef_client(host, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end

#put_secret(host, secret, options = {}) ⇒ HostConnector::Response

Write your encrypted data bag secret on a node

Parameters:

  • host (String)

    the host to perform the action on

  • secret (String)

    your organization’s encrypted data bag secret

  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


50
51
52
# File 'lib/ridley/host_connector.rb', line 50

def put_secret(host, secret, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end

#ruby_script(host, command_lines, options = {}) ⇒ HostConnector::Response

Execute line(s) of Ruby code on a node using Chef’s embedded Ruby

Parameters:

  • host (String)

    the host to perform the action on

  • command_lines (Array<String>)

    An Array of lines of the command to be executed

  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


63
64
65
# File 'lib/ridley/host_connector.rb', line 63

def ruby_script(host, command_lines, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end

#run(host, command, options = {}) ⇒ HostConnector::Response

Execute a shell command on a node

Parameters:

  • host (String)

    the host to perform the action on

  • command (String)
  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


15
16
17
# File 'lib/ridley/host_connector.rb', line 15

def run(host, command, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end

#uninstall_chef(host, options = {}) ⇒ HostConnector::Response

Uninstall Chef from a node

Parameters:

  • host (String)

    the host to perform the action on

  • options (Hash) (defaults to: {})

Returns:

Raises:

  • (RuntimeError)


74
75
76
# File 'lib/ridley/host_connector.rb', line 74

def uninstall_chef(host, options = {})
  raise RuntimeError, "abstract function: must be implemented on includer"
end