Hello!

I hope someone might be able to give me some directions on this problem. The search didn't come up with something useful because it's some kind of a corner case i think...

I am trying to implement an integration of HP System Insight Manager into Puppet. Unfortunately the HP SIM is running on a windows box to which I only have SSH access and cannot install puppet on it (otherwise Exec would be easy).

My idea was to write a provider and type that i could do something like

node server1 {
   simnode {"$hostname":
      ensure => present,
      simserver => "hpsim.example.com",
   }
}

In the background the provider issues an command over ssh to make sure it is in SIM:

<snip>
Puppet::Type.type(:simnode).provide(:ssh) do
  confine :manufacturer => [ "HP", "Compaq" ]
  commands :ssh => "ssh"

  def create
    ssh @resource[:simserver] "mxnode -a @resource[:name]"
  end

  def exists?
output = ssh @resource[:simserver] "mxnode -ld @resource[:name]" if output =~ /The node specified does not represent a node in this system/i
          false
        else
          true
        end
  end

  def destroy
    ssh @resource[:simserver] "mxnode -r @resource[:name]"
  end
end
<snap>


Of course this is more or less pseudocode but I guess you see what I am intending to do. On the other hand the "mxnode -ld" command also spits out some very interesting information about support status and features that I would like to put into facts respectively there is an XML Output of mxnode which I could use to cache the state if a node has already been added to SIM.

Before I start writing this provider is there any kind of generic SSH wrapper for this something i could start from?

Thank you very much for your help in advance!

Best wishes
Hannes

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to