Set up hiera correctly, add a yaml file to your hierarchy, and and 
translate the CSV file to YAML:

I'm a perl geek, so:
#!/bin/perl

while(<>)  {
  chomp; 
  tr/A-Z/a-z/;
  my @a = split(/\,/);
  push(@{$hash{$a[0]}}, $a[1]);
}
for my $srv (sort(keys(%hash)))  {
  print "startup::$srv\n";
  for my $cmd (@{$hash{$srv}})  {
    print "  - $cmd\n";
  }
}



startup::servera:
  - /usr/local/bin/prog start databasea
  - /usr/local/bin/prog start databaseb 
startup::serverb:
  - /usr/local/bin/prog start database123

Although I'd probably drop the "/usr/local/bin/prog start", since it seems 
to be common to all.

Then a class:

class startup  {

  $array = hiera(startup::$hostname, "none")

  if (! $array == "none") {

   < do stuff >
 }

}

I'm assuming serverb doesn't need to know servera's 

-- 
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/4f045170-082b-4c6c-95df-e3d0e80ad3c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to