Robin Lee Powell
2009-May-12 18:15 UTC
[Puppet Users] How to put files in a user''s home dir without knowing it?
What I want to do is: file { "~$user/.zshenv": ...} but that doesn''t work. I made custom facts for home dirs, so that "home_root" should work, but his: file { "${home_$user}/.zshenv": ...} doesn''t work either. Help? -Robin -- They say: "The first AIs will be built by the military as weapons." And I''m thinking: "Does it even occur to you to try for something other than the default outcome?" See http://shrunklink.com/cdiz http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
joe
2009-May-12 19:04 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
If you have a fact called home_root you would use it like this: file { "$home_root/$user/.zshenv": ...} Does that work for you? On May 12, 2:15 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> wrote:> What I want to do is: > > file { "~$user/.zshenv": > ...} > > but that doesn''t work. I made custom facts for home dirs, so that > "home_root" should work, but his: > > file { "${home_$user}/.zshenv": > ...} > > doesn''t work either. > > Help? > > -Robin > > -- > They say: "The first AIs will be built by the military as weapons." > And I''m thinking: "Does it even occur to you to try for something > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***http://www.lojban.org/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Robin Lee Powell
2009-May-12 19:06 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
No, because I''m making a define so I can put a bunch of files in a bunch of different user''s home directories; that why I use $user below. -Robin On Tue, May 12, 2009 at 12:04:08PM -0700, joe wrote:> > If you have a fact called home_root you would use it like this: > > file { "$home_root/$user/.zshenv": > ...} > > Does that work for you? > > On May 12, 2:15 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > wrote: > > What I want to do is: > > > > file { "~$user/.zshenv": > > ...} > > > > but that doesn''t work. I made custom facts for home dirs, so that > > "home_root" should work, but his: > > > > file { "${home_$user}/.zshenv": > > ...} > > > > doesn''t work either. > > > > Help? > > > > -Robin > > > > -- > > They say: "The first AIs will be built by the military as weapons." > > And I''m thinking: "Does it even occur to you to try for something > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***http://www.lojban.org/ > >-- They say: "The first AIs will be built by the military as weapons." And I''m thinking: "Does it even occur to you to try for something other than the default outcome?" See http://shrunklink.com/cdiz http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
joe
2009-May-12 19:15 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
What exactly is your define attempting to do? Define the users for which a certain file gets placed in their home dir or define the file that gets put into all users'' home dirs? On May 12, 3:06 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> wrote:> No, because I''m making a define so I can put a bunch of files in a > bunch of different user''s home directories; that why I use $user > below. > > -Robin > > > > On Tue, May 12, 2009 at 12:04:08PM -0700, joe wrote: > > > If you have a fact called home_root you would use it like this: > > > file { "$home_root/$user/.zshenv": > > ...} > > > Does that work for you? > > > On May 12, 2:15 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > > wrote: > > > What I want to do is: > > > > file { "~$user/.zshenv": > > > ...} > > > > but that doesn''t work. I made custom facts for home dirs, so that > > > "home_root" should work, but his: > > > > file { "${home_$user}/.zshenv": > > > ...} > > > > doesn''t work either. > > > > Help? > > > > -Robin > > > > -- > > > They say: "The first AIs will be built by the military as weapons." > > > And I''m thinking: "Does it even occur to you to try for something > > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***... > > -- > They say: "The first AIs will be built by the military as weapons." > And I''m thinking: "Does it even occur to you to try for something > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***http://www.lojban.org/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Robin Lee Powell
2009-May-12 19:20 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
Define a set of files such that, given a user, all those files get placed under the user''s homedir. I suppose I could pass $home_root to the define, and have it operate on the directory rather than the user name. -Robin On Tue, May 12, 2009 at 12:15:36PM -0700, joe wrote:> > What exactly is your define attempting to do? Define the users for > which a certain file gets placed in their home dir or define the file > that gets put into all users'' home dirs? > > On May 12, 3:06 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > wrote: > > No, because I''m making a define so I can put a bunch of files in a > > bunch of different user''s home directories; that why I use $user > > below. > > > > -Robin > > > > > > > > On Tue, May 12, 2009 at 12:04:08PM -0700, joe wrote: > > > > > If you have a fact called home_root you would use it like this: > > > > > file { "$home_root/$user/.zshenv": > > > ...} > > > > > Does that work for you? > > > > > On May 12, 2:15 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > > > wrote: > > > > What I want to do is: > > > > > > file { "~$user/.zshenv": > > > > ...} > > > > > > but that doesn''t work. I made custom facts for home dirs, so that > > > > "home_root" should work, but his: > > > > > > file { "${home_$user}/.zshenv": > > > > ...} > > > > > > doesn''t work either. > > > > > > Help? > > > > > > -Robin > > > > > > -- > > > > They say: "The first AIs will be built by the military as weapons." > > > > And I''m thinking: "Does it even occur to you to try for something > > > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***... > > > > -- > > They say: "The first AIs will be built by the military as weapons." > > And I''m thinking: "Does it even occur to you to try for something > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***http://www.lojban.org/ > >-- They say: "The first AIs will be built by the military as weapons." And I''m thinking: "Does it even occur to you to try for something other than the default outcome?" See http://shrunklink.com/cdiz http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
joe
2009-May-12 19:33 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
If home_root is being set to /home or /export/home or whatever, then what I told you at first should work... On May 12, 3:20 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> wrote:> Define a set of files such that, given a user, all those files get > placed under the user''s homedir. > > I suppose I could pass $home_root to the define, and have it operate > on the directory rather than the user name. > > -Robin > > > > On Tue, May 12, 2009 at 12:15:36PM -0700, joe wrote: > > > What exactly is your define attempting to do? Define the users for > > which a certain file gets placed in their home dir or define the file > > that gets put into all users'' home dirs? > > > On May 12, 3:06 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > > wrote: > > > No, because I''m making a define so I can put a bunch of files in a > > > bunch of different user''s home directories; that why I use $user > > > below. > > > > -Robin > > > > On Tue, May 12, 2009 at 12:04:08PM -0700, joe wrote: > > > > > If you have a fact called home_root you would use it like this: > > > > > file { "$home_root/$user/.zshenv": > > > > ...} > > > > > Does that work for you? > > > > > On May 12, 2:15 pm, Robin Lee Powell <rlpow...@digitalkingdom.org> > > > > wrote: > > > > > What I want to do is: > > > > > > file { "~$user/.zshenv": > > > > > ...} > > > > > > but that doesn''t work. I made custom facts for home dirs, so that > > > > > "home_root" should work, but his: > > > > > > file { "${home_$user}/.zshenv": > > > > > ...} > > > > > > doesn''t work either. > > > > > > Help? > > > > > > -Robin > > > > > > -- > > > > > They say: "The first AIs will be built by the military as weapons." > > > > > And I''m thinking: "Does it even occur to you to try for something > > > > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***... > > > > -- > > > They say: "The first AIs will be built by the military as weapons." > > > And I''m thinking: "Does it even occur to you to try for something > > > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***... > > -- > They say: "The first AIs will be built by the military as weapons." > And I''m thinking: "Does it even occur to you to try for something > other than the default outcome?" Seehttp://shrunklink.com/cdizhttp://www.digitalkingdom.org/~rlpowell/***http://www.lojban.org/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Trevor Vaughan
2009-May-12 20:34 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
Try this command string to obtain your custom fact for $home_user: getent passwd | grep <username> | cut -f6 -d'':'' Be aware though, that you may experience extreme lag if you have a faulty authentication service (NIS, LDAP, whatever). There''s probably a better way to do it, but that will at least be accurate. Trevor On Tue, May 12, 2009 at 14:15, Robin Lee Powell <rlpowell@digitalkingdom.org> wrote:> > > What I want to do is: > > file { "~$user/.zshenv": > ...} > > but that doesn''t work. I made custom facts for home dirs, so that > "home_root" should work, but his: > > file { "${home_$user}/.zshenv": > ...} > > doesn''t work either. > > Help? > > -Robin > > -- > They say: "The first AIs will be built by the military as weapons." > And I''m thinking: "Does it even occur to you to try for something > other than the default outcome?" See http://shrunklink.com/cdiz > http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Robin Lee Powell
2009-May-12 20:38 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
I have the fact. The problem is that I want to get the user''s homedir based on the $user parameter passed to my define, and ${home_${user}} doesn''t work. I''ve solved the problem by handling things a different way, but it does seem like it shouldn''t be this hard to put a file in a user''s homedir. -Robin On Tue, May 12, 2009 at 04:34:24PM -0400, Trevor Vaughan wrote:> > Try this command string to obtain your custom fact for $home_user: > > getent passwd | grep <username> | cut -f6 -d'':'' > > Be aware though, that you may experience extreme lag if you have a > faulty authentication service (NIS, LDAP, whatever). > > There''s probably a better way to do it, but that will at least be accurate. > > Trevor > > On Tue, May 12, 2009 at 14:15, Robin Lee Powell > <rlpowell@digitalkingdom.org> wrote: > > > > > > What I want to do is: > > > > file { "~$user/.zshenv": > > ...} > > > > but that doesn''t work. I made custom facts for home dirs, so that > > "home_root" should work, but his: > > > > file { "${home_$user}/.zshenv": > > ...} > > > > doesn''t work either. > > > > Help? > > > > -Robin > > > > -- > > They say: "The first AIs will be built by the military as weapons." > > And I''m thinking: "Does it even occur to you to try for something > > other than the default outcome?" See http://shrunklink.com/cdiz > > http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ > > > > > > > > > >-- They say: "The first AIs will be built by the military as weapons." And I''m thinking: "Does it even occur to you to try for something other than the default outcome?" See http://shrunklink.com/cdiz http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Ohad Levy
2009-May-13 02:24 UTC
[Puppet Users] Re: How to put files in a user''s home dir without knowing it?
getent passwd <username> |cut... will reduce a lot of load on your ldap servers...... my 2c Ohad On Wed, May 13, 2009 at 4:34 AM, Trevor Vaughan <peiriannydd@gmail.com>wrote:> > Try this command string to obtain your custom fact for $home_user: > > getent passwd | grep <username> | cut -f6 -d'':'' > > Be aware though, that you may experience extreme lag if you have a > faulty authentication service (NIS, LDAP, whatever). > > There''s probably a better way to do it, but that will at least be accurate. > > Trevor > > On Tue, May 12, 2009 at 14:15, Robin Lee Powell > <rlpowell@digitalkingdom.org> wrote: > > > > > > What I want to do is: > > > > file { "~$user/.zshenv": > > ...} > > > > but that doesn''t work. I made custom facts for home dirs, so that > > "home_root" should work, but his: > > > > file { "${home_$user}/.zshenv": > > ...} > > > > doesn''t work either. > > > > Help? > > > > -Robin > > > > -- > > They say: "The first AIs will be built by the military as weapons." > > And I''m thinking: "Does it even occur to you to try for something > > other than the default outcome?" See http://shrunklink.com/cdiz > > http://www.digitalkingdom.org/~rlpowell/<http://www.digitalkingdom.org/%7Erlpowell/>*** > http://www.lojban.org/ > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---