Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

How to create folder name with custom facts using puppet in Windows ?

$
0
0
I wrote a custom fact to create current date and time in windows.That facts return the current date and time when i notifying it. Eg: notify{"test time": message=>"$::windows_time", } output of above code is '05-04-2016-19_46_45' But When i have tried to create a folder with custom facts , I can't create a folder with timestamp. My Code is below. exec{"current date time folder": cwd=>"${prodequ_backup_loc}", command=>'C:\Windows\System32\cmd.exe /c "md $::windows_time"', } That above code created a folder name with "${windows_time}". my facts for creating date and time-stamp is below: require 'facter' # ##Default for non-Linux nodes Facter.add(:windows_time) do setcode do Facter::Util::Resolution.exec('C:\\Windows\\System32\\cmd.exe /c "C:\\time1.bat"') end end #For Linux Nodes Facter.add(:windows_time) do confine :kernel => :linux setcode do nil end end Any help is much appreciated.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>