Hash parameters

I'm currently trying to assign puppetlabs haproxy module (
https://github.com/puppetlabs/puppetlabs-haproxy) to a new node I've
created, There are 2 class parameters that accept a hash as in the example
below:

class { 'haproxy':

enable => true,

global_options => {

'log' => "${::ipaddress} local0",

'chroot' => '/var/lib/haproxy',

'pidfile' => '/var/run/haproxy.pid',

'maxconn' => '4000',

'user' => 'haproxy',

'group' => 'haproxy',

'daemon' => '',

'stats' => 'socket /var/lib/haproxy/stats'

},

defaults_options => {

'log' => 'global',

'stats' => 'enable',

'option' => 'redispatch',

'retries' => '3',

'timeout' => [

'http-request 10s',

'queue 1m',

'connect 10s',

'client 1m',

'server 1m',

'check 10s'

],

'maxconn' => '8000'

},

}

··· #

I’m trying to set this up in foreman, but I seem to be having a lot of trouble with the syntax that foreman is expecting for a hash parameter. Is this documented anywhere or can someone provide an example?

I assume you're talking about adding a Class Parameter in the UI (just be
clear :P). On that basis, I tend to add hashes in YAML format. Select YAML
from the type field, and set the value like:

global_options:
log: '1.2.3.4 local0'
chroot: '/var/lib/haproxy'

and so on.

HTH,
Greg

··· On 31 July 2013 16:19, Andy Bohne wrote:

I’m currently trying to assign puppetlabs haproxy module (
https://github.com/puppetlabs/puppetlabs-haproxy) to a new node I’ve
created, There are 2 class parameters that accept a hash as in the example
below:

That makes sense Greg. I'm trying your suggestion, but I think I'm running
into a bug or something.

When I override the global_options parameter in the UI and set the default
as chroot: /var/lib/haproxy and click submit, everything is fine and I can
see that parameter in the YAML for a host that's consuming the haproxy
class.

However, if I try to add a Matcher-Value, with the same info, when I click
submit, it just takes me back to the edit puppet class screen.

I didn't see any errors in production.log.

Any suggestions?

··· On Wednesday, July 31, 2013 11:32:14 AM UTC-4, Greg Sutcliffe wrote: > > On 31 July 2013 16:19, Andy Bohne <andy....@gmail.com >wrote: > >> I'm currently trying to assign puppetlabs haproxy module ( >> https://github.com/puppetlabs/puppetlabs-haproxy) to a new node I've >> created, There are 2 class parameters that accept a hash as in the example >> below: > > > I assume you're talking about adding a Class Parameter in the UI (just be > clear :P). On that basis, I tend to add hashes in YAML format. Select YAML > from the type field, and set the value like: > > global_options: > log: '1.2.3.4 local0' > chroot: '/var/lib/haproxy' > > and so on. > > HTH, > Greg >

Sounds like Bug #2726: Smart Class Parameter - over-ride match value unable to set yaml - Foreman to me

Greg

··· On 2 August 2013 16:44, Andy Bohne wrote:

That makes sense Greg. I’m trying your suggestion, but I think I’m
running into a bug or something.

When I override the global_options parameter in the UI and set the default
as chroot: /var/lib/haproxy and click submit, everything is fine and I can
see that parameter in the YAML for a host that’s consuming the haproxy
class.

However, if I try to add a Matcher-Value, with the same info, when I click
submit, it just takes me back to the edit puppet class screen.

Thanks. Added my +1 to that bug report.

··· On Friday, August 2, 2013 11:59:56 AM UTC-4, Greg Sutcliffe wrote: > > On 2 August 2013 16:44, Andy Bohne <andy....@gmail.com >wrote: > >> That makes sense Greg. I'm trying your suggestion, but I think I'm >> running into a bug or something. >> >> When I override the global_options parameter in the UI and set the >> default as chroot: /var/lib/haproxy and click submit, everything is fine >> and I can see that parameter in the YAML for a host that's consuming the >> haproxy class. >> >> However, if I try to add a Matcher-Value, with the same info, when I >> click submit, it just takes me back to the edit puppet class screen. >> > > Sounds like http://projects.theforeman.org/issues/2726 to me > > Greg >