real path on fs to the environment in function

6 views
Skip to first unread message

Vasil Mikhalenya

unread,
Dec 1, 2015, 12:07:13 PM12/1/15
to Puppet Users
Hi all,

Could you suggest the right way to determine the path to the current environment in puppet function? I want to store some data outside the modules in the "files" directory in the git work-copy that pulled in each environment and be able to detect the path to the "files".


files_dir = lookupvar("ssh_key_groups::path_to_keys")

files_dir = "files"

files_path = env.modulepath.map{|d| d.sub("modules", "")+files_dir }.select { |d| Puppet::FileSystem.directory?(d) }.shift


--
Best regards,
Vasil Mikhalenya

Vasil Mikhalenya

unread,
Dec 1, 2015, 12:12:40 PM12/1/15
to Puppet Users

sorry, I've just accidentally sent previous unfinished email

files_dir = lookupvar("ssh_key_groups::path_to_keys") // lookup var does not work for puppet-server anymore

files_path = env.modulepath.map{|d| d.sub("modules", "")+files_dir }.select { |d| Puppet::FileSystem.directory?(d) }.shift // this code looks like a hack
Reply all
Reply to author
Forward
0 new messages