Sha256: fee6d9a0ca482a6d1771b6438b79cff3ac6a8687daba56d97a68406ce5c86930
Contents?: true
Size: 877 Bytes
Versions: 14
Compression:
Stored size: 877 Bytes
Contents
require 'rundock/operation/base' module Rundock module Operation # You can use this sample as following scenario.yml for example. # # - node: anyhost-01 # host_inventory: # memory: # total: # --- # anyhost-01: # host: 192.168.1.11 # ssh_opts: # port: 22 # user: anyuser # key: ~/.ssh/id_rsa # --- class HostInventory < Base def run(backend, attributes) attributes[:host_inventory].each do |hi| logging(to_inventory(backend, hi), 'info') end end private def to_inventory(backend, inventory) ret = nil inventory.split('/').each do |s| if ret.nil? ret = backend.host_inventory[s.to_s] next end ret = ret[s.to_s] end ret end end end end
Version data entries
14 entries across 14 versions & 1 rubygems