Hi Dan,

Thanks for hint. I am already using hiera, yes the code looks much cleaner 
when using it.

Regards,
Vikas

On Monday, 12 October 2015 23:32:46 UTC+11, LinuxDan wrote:
>
> The puppet manifest would simplify to :
> class foo (
> $services_to_stop = [],
> ) {
>
> include 'stdlib'
>
> if size($services_to_stop) > 0 {
> service { $services_to_stop :
> ensure => stopped,
> enable => false,
> }
> }
> }
>
> You need to set up hiera (http://docs.puppetlabs.com/hiera/1/) to let you 
> choose settings using the "operatingsystem", "osfamily", and/or 
> "operatingsystemmajrelease" facts.
>
> Personally, I am a bit confused as to what services you want stopped under 
> what conditions, so I cannot offer more detail.
>
> The hiera data for your default case would be :
>
> ---
> foo::services_to_stop :
>   - ip6tables
>   - iptables
>   - auditd
>   - cups
>
>
> “Sometimes I think the surest sign that intelligent life exists elsewhere in 
> the universe is that none of it has tried to contact us.”  (Bill Waterson: 
> Calvin & Hobbes)
>
>
> On Oct 10, 2015, at 10:46 PM, Vikas Kumar <vika...@gmail.com <javascript:>> 
> wrote:
>
> Hello Dan,
>
> Would it be possible for you to point me to an example (may be a link) ? 
> Thanks in advance.
>
> Regards,
> Vikas
>
> On Sunday, 11 October 2015 13:43:22 UTC+11, LinuxDan wrote:
>>
>> Has anyone considered taking the array of services out of the code and 
>> putting it into Hiera ? 
>> Much easier to vary the array from there. 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9de84948-546f-4bfe-89d3-d84ee75e4b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to