passing custom fact into a variable

42 views
Skip to first unread message

Toky

unread,
Jun 19, 2015, 3:16:10 PM6/19/15
to puppet...@googlegroups.com
I have a custom fact (creationkey) which gives me the AWS Creation key name (this is also a local linux user account). I'm trying to use that fact with the rvm module.

https://forge.puppetlabs.com/maestrodev/rvm/readme

rvm::system_user { bturner: ; jdoe: ; jsmith: ; }

I've tried the following:
rvm::system_user { ::creationkey: ; }

rvm::system_user { ::$creationkey: ; }

rvm::system_user { ::${creationkey}: ; }

They all give this error:
Error: Could not create user $creationkey: Execution of '/usr/sbin/useradd -M $creationkey' returned 3: useradd: invalid user name '$creationkey'

I tried:

$user = ::creationkey

rvm::system_user { $user: ; }

But that is not working either.

PS the creationkey fact does work as expected on the instances, its just using it to populate the variable what is failing.

Cheers,

Peter Huene

unread,
Jun 19, 2015, 3:22:22 PM6/19/15
to puppet...@googlegroups.com
Hi Toky,

On Fri, Jun 19, 2015 at 12:16 PM, Toky <toky...@gmail.com> wrote:
I have a custom fact (creationkey) which gives me the AWS Creation key name (this is also a local linux user account). I'm trying to use that fact with the rvm module.

https://forge.puppetlabs.com/maestrodev/rvm/readme

rvm::system_user { bturner: ; jdoe: ; jsmith: ; }

I've tried the following:
rvm::system_user { ::creationkey: ; }

rvm::system_user { ::$creationkey: ; }

rvm::system_user { ::${creationkey}: ; }

I think you're looking for $::creationkey, e.g. rvm::system_user { $::creationkey: }

They all give this error:
Error: Could not create user $creationkey: Execution of '/usr/sbin/useradd -M $creationkey' returned 3: useradd: invalid user name '$creationkey'

I tried:

$user = ::creationkey

rvm::system_user { $user: ; }

But that is not working either.

PS the creationkey fact does work as expected on the instances, its just using it to populate the variable what is failing.

Cheers,

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b21e2e16-c077-4c87-897c-3d550e9fcf85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Join us at PuppetConf 2015, October 5-9 in Portland, OR - www.2015.puppetconf.com 
Register early to save 40%!

Toky

unread,
Jun 19, 2015, 3:29:53 PM6/19/15
to puppet...@googlegroups.com
I just noticed... was trying to delete this message before it got an answer... I guess it will live on now :)

Thanks for the reply.

-Cheers,
Reply all
Reply to author
Forward
0 new messages