On Friday, September 28, 2012 6:05:54 AM UTC-5, ureal frank wrote:
>
> Hi,
>
> I've seen some blog posts about adding server roles to Puppet.
>
> Some of them with this fact snippet:
>
> if File.exists?("/etc/roles.txt")
> File.readlines("/etc/roles.txt").each do |line|
> if line =~ /^(.+)=(.+)
--
Frank
On Friday, September 28, 2012 at 2:35 PM, jcbollinger wrote:
>
>
> On Friday, September 28, 2012 6:05:54 AM UTC-5, ureal frank wrote:
> > Hi,
> >
> > I've seen some blog posts about adding server roles to Puppet.
> >
> > Some of them with this fact snippet:
> >
> > if File.exis
I'm going this way:
roles_file = ""
if Facter.kernel = 'linux'
roles_file = "/etc/roles_facts.txt"
elsif Facter.kernel = 'windows'
roles_file = "C:\\roles_facts.txt"
end
if File.exists?(roles_files)
File.readlines(roles_file).each do |line|
if line =~ /^(.+)=(.+)$/
fact = $1
value = $2
Facter.