I use this to create two variables that I can use in a cron type: # The variable boot_time is set on the client in the /etc/init.d/ puppet-at-boot script # as a FACTER environmental variable i.e. export FACTER_BOOT_TIME=`date '+%H:%M'`
$boot_hour = regsubst($boot_time,'^([0-9]+)[:]([0-9]+)','\1') $boot_minute = regsubst($boot_time,'^([0-9]+)[:]([0-9]+)','\2') I think you would have to create the variables first, then use the variables in the if/else statements. Ed On May 7, 9:05 am, Ryan <[email protected]> wrote: > Hello all! > > I'm hoping for your help on what I admit is a weird and uncommon > problem. > > I'm working on a module that (among other things) creates a series of > home folders. The format of the home folders looks something like > this /filesys/home/#/letter/userid where # is a number between 0-15, > letter is the first letter of the userid. > > Anyhow, I'm inserting a variable into the manifest something like > this: $folders = ["/filesys/", "/filesys/home", "/filesys/home/0", "/ > filesys/home/0/x/xyz123", /filesys/home/1/a/abc123"] and etc > > My problem is, I want to take that master variable and break it down > so puppet can do different things to different pieces. For example, I > was looking at making an if/else statement to take a regular > expression that would strip out a userid and make that the variable > puppet uses for the owner/group on each of the userid directories. > Else, the owner/group would be sys or whatever else. > > I'm thinking of other stuff too, but my basic question is, does puppet > support using regular expressions in if/else statements like this or > am I really trying to get too crazy? > > Thanks in advance for bearing with me! > > --Ryan > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/puppet-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
