Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

service attributes based off hiera - is this bone headed?

$
0
0
I would like modify service attributes based on a hiera lookup. So far I have tried the following and get an Invalid value "$foo::params::foo_ensure" Valid values are stopped and running." If this is a terrible way to do this, then what would you suggest?

class foo::params {
  $manage_foo = hiera('foo::active', false)

  if $manage_foo  {
    $foo_enable = true
    $foo_ensure = 'running'
   }
  
  else {
    $cups_enable = false
    $cups_ensure = 'stopped'
   }
}

class foo {

  include foo::params

  service {'foo':
      ensure    => '$foo::params::foo_ensure',
      enable    => '$foo::params::foo_enable',
     }
Many thanks from a puppet rookie!

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>