Hi,
I need to use a file that is delivered with a recipe. I do not need to copy it out of the cookbook. It contains some sql needed to initialize a DB.
Problem 1 - I can’t find a way to refer to a file inside a cookbook (ex: <cookbook_path>/files/default/myfile.sql). I end up with something like #{Chef::Config[:file_cache_path]}/cookbooks/my_cookbook/files/default/myfile.sql. It works but doesn’t feel right.
Problem 2 - I need to use the cookbook_file resource and copy the file to tmp otherwise the file is not available locally. Again, this feels like this is not what I should be doing.
Cheers,
Florian
From: Dennis Benzinger [mailto:dennis.benzinger@hybris.com]
Sent: 09 May 2014 17:58
To: chef@lists.opscode.com
Subject: [chef] Re: who is the current user
Hello Florian,
you can use the following node attribute provided by Ohai:
node[‘current_user’]
Cheers,
Dennis
On 08.05.2014 09:57, Florian Hehlen wrote:
Hi,
Is there a way to know from within a recipe the name of the user running the recipe?
Cheers,
Florian
LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.
Dennis Benzinger
Platform Automation Engineer
Managed Services
Nymphenburger Straße 86
80636 München, Deutschland
www.hybris.comhttp://www.hybris.com
Geschäftsführer:
Ariel Lüdi, Carsten Thoma, Moritz Zimmermann, Michael Zips
Amtsgericht:
München, HRB 124384
LEGAL DISCLAIMER
This communication and any attached documents are strictly confidential and/or legally privileged and they may not be used or disclosed by someone who is not a named recipient. If you have received this electronic communication in error please notify the sender by replying to this electronic communication inserting the word “misdirected” as the subject and delete this communication from your system.