I'm looking for some help in getting the proper escape sequence within the
generate function.
Ultimately what I'm trying to do is generate some random strings, store
them as variables, and use those variables to populate configuration files
stored as templates.
I can get this to work when applying the template on the localhost, but it
fails when applied via the puppet master.:
> $random_1 = generate("/bin/sh", "-c", "/bin/cat /dev/urandom | /usr/bin/tr-
> dc 'a-z0-9' | /usr/bin/fold -w 8 | /usr/bin/head -n 1 | /usr/bin/tr -d
> '\n'")
The closest I've come is to use:
> $random_1 = generate('/bin/sh', '-c', '\"/bin/cat /dev/urandom | /usr/bin/
> tr -dc \'a-z0-9\' | /usr/bin/fold -w 8 | /usr/bin/head -n 1 | /usr/bin/tr-d
> \'\n\'\"'
> )
This however ends up populating the variable with the following and appears
to ignore the the "/usr/bin/tr -d '\n'" as there are line breaks inserted:
> /bin/sh: "/bin/cat: No such file or directory
>
What I'm really wanting (I think) to be executed on the puppet master is
> "/bin/sh" "-c" "/bin/cat /dev/urandom | /usr/bin/tr -dc 'a-z0-9' |
> /usr/bin/fold -w 8 | /usr/bin/head -n 1 | /usr/bin/tr -d '\n'"
Any help would be appreciated.
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.