python-hpilo icon indicating copy to clipboard operation
python-hpilo copied to clipboard

How to pass in username/password for managing ILO via puppet?

Open woneill opened this issue 9 years ago • 6 comments

Since I can't sync passwords in local mode as noted in #100 I'm trying to setup http mode. But I can't figure out the format to pass in a username and password.

I've tried embedding it in the URL specified in /etc/puppet/device.conf but the puppet code seems to ignore it:

[ilo.foo.com]
type ilo
url http://username:[email protected]

results in:

Debug: Executing '/usr/bin/hpilo_cli --save-response /var/lib/puppet/devices/ilo.foo.com/cache/get_all_users --json ilo.foo.com get_all_users'
Error: Could not retrieve local facts: Execution of '/usr/bin/hpilo_cli --save-response /var/lib/puppet/devices/ilo.foo.com/cache/get_all_users --json ilo.foo.rsglab.com get_all_users' returned 2: Usage:
  hpilo_cli [options] hostname method [args...] [ + method [args...]...]
  hpilo_cli download_rib_firmware ilotype version [version...]

hpilo_cli: error: No login details provided

woneill avatar May 13 '16 14:05 woneill

Unfortunately the puppet module at the moment only supports reading the credentials from ~/.ilo.conf, which means you'll need to have the same user/pass on all of them. Patches to improve this would be welcome, though I'm not sure I like the idea of storing them in device.conf.

seveas avatar May 13 '16 14:05 seveas

Ah, I'd never used ~/.ilo.conf before so wasn't aware of it. I'll try that out.

I agree on the unease around storing them in device.conf. I figured making it root read-only would be just as safe as ~/.ilo.conf in our case since the only device we have in there at the moment is ILO.

woneill avatar May 13 '16 15:05 woneill

Looks like putting them in device.conf is actuall common, so let's do that. The main problem now is feeding that information to hpilo_cli. I don't want to do this as commandline parameters, as those show up in ps aux output. Ideas welcome :)

seveas avatar May 13 '16 15:05 seveas

I'll mull it over, see if I can come up with a way to do it :)

woneill avatar May 13 '16 15:05 woneill

Hi, i'm in the middle of implementing this using puppet (enterprise) as well, had to make some changes to the puppet code to make things work. I'm also suffering from the username/password issue. If i can help testing a diff i'd be more than happy! Please let me know :)

jmaas avatar Jun 02 '16 14:06 jmaas

Also, what should the format for .ilo.conf be ?

jmaas avatar Jun 02 '16 14:06 jmaas