Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This line is not valid Puppet code:

$server = $manufacturer == 'OpenStack Foundation' { 'true' => 'proxy2', default => 'proxy1' }

I'm not exactly sure what you're trying to do, but if it's just comparing a variable to a string to conditionally set the variable, you could use an if statement:

if $manufacturer == 'OpenStack Foundation' {
  $server = 'proxy2'
} else {
  $server = 'proxy1'
}

Personally, I like using a selector for that type of thing though as it's easier to read in my opinion:

$server = $manufacturer ? {
  'OpenStack Foundation' => 'proxy2',
  default                => 'proxy1',
}

And as has already been stated, you can't reassign a variable in Puppet. So if you end up using one of the examples I showed you, you will need to remove the $server parameter.