redhat-openstack / openstack-puppet-modules

Puppet modules shared between Packstack and TripleO
39 stars 52 forks source link

cinder init.pp manifest: wrong variable evaluation #224

Closed Razique closed 9 years ago

Razique commented 9 years ago

The following evaluation fails:

 if $rabbit_use_ssl {
    if !$kombu_ssl_ca_certs {
      fail('The kombu_ssl_ca_certs parameter is required when rabbit_use_ssl is set to true')
    }
    if !$kombu_ssl_certfile {
      fail('The kombu_ssl_certfile parameter is required when rabbit_use_ssl is set to true')
    }
    if !$kombu_ssl_keyfile {
      fail('The kombu_ssl_keyfile parameter is required when rabbit_use_ssl is set to true')
    }
  }

Because $rabbit_use_ssl is defined as "false" - which equals to true to this statement. The node fails to deploy, because puppet agent complains about a missing variable, dependant upon this one.

We need to update the evaluation, by adding a "str2bool" that will convert the string into a real true or false value. Once updated, puppet is able to deploy the node:

if str2bool($rabbit_use_ssl) {
    if !$kombu_ssl_ca_certs {
      fail('The kombu_ssl_ca_certs parameter is required when rabbit_use_ssl is set to true')
    }
    if !$kombu_ssl_certfile {
      fail('The kombu_ssl_certfile parameter is required when rabbit_use_ssl is set to true')
    }
    if !$kombu_ssl_keyfile {
      fail('The kombu_ssl_keyfile parameter is required when rabbit_use_ssl is set to true')
    }
  }
Razique commented 9 years ago

I guess, all blocks that evaluate these variable need this str2bool function, in order to really work :)

xbezdick commented 9 years ago

hmm we are probably passing string there instead of bool this is puppet thingie as we should be passing bool there :( not openstack module bug but bug on higher level