[chef] Re: Use template or cookbook_file resources to put something in a user's home directory?


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To:
  • Subject: [chef] Re: Use template or cookbook_file resources to put something in a user's home directory?
  • Date: Tue, 7 Jan 2014 11:24:52 -0500

On Tue, Jan 7, 2014 at 11:08 AM, Stephen Corbesero
< >
 wrote:

> Is there any way to use the template and cookbook_file resources to put
> files in or under a user’s home directory without hardcoding the directory
> as “/home/username”?
>
> Is there some way to get the chef-client to interpret ~username like the
> shell does?

I think File.expand_path should do it?

irb(main):002:0> File.expand_path('~juliandunn')
=> "/Users/juliandunn"

- Julian

-- 
[ Julian C. Dunn 
< >
          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ;]
gopher://sdf.org/1/users/keymaker/           * compliant!    ;]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]



Archive powered by MHonArc 2.6.16.

§