File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 include ::puppet::defaults
1111 $facterbasepath = $::puppet::defaults::facterbasepath
1212
13- validate_string ($title )
13+ validate_re ($title , ' ^[0-9A-Za-z_ \- ]+$ ' , ' The $title fact does not match ^[0-9A-Za-z_ \- ]+$ ' )
1414 $facter_data = { " ${title} " => $value }
1515
1616 file { "${facterbasepath}/facts.d/${title}.yaml" :
1717 ensure => $ensure ,
1818 owner => ' root' ,
1919 group => ' puppet' ,
2020 mode => ' 0640' ,
21- validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '<afile> '\" " ,
21+ validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '% '\" " ,
2222 content => template (' puppet/fact.yaml.erb' ),
2323 }
2424
Original file line number Diff line number Diff line change 2121 owner => ' root' ,
2222 group => ' puppet' ,
2323 mode => ' 0640' ,
24- validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '<afile> '\" " ,
24+ validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '% '\" " ,
2525 content => template (' puppet/local_facts.yaml.erb' ),
2626 }
2727
Original file line number Diff line number Diff line change 9494 /facts for my.client.cert/
9595 ) . with_content (
9696 /FQDN my.fq.hostname/
97+ ) . with_validate_cmd (
98+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
9799 ) #.with_content(
98100 # /Environment production/
99101 #)
106108 /FQDN my.fq.hostname/
107109 ) . with_content (
108110 /Environment production/
111+ ) . with_validate_cmd (
112+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
109113 )
110114 end
111115 end
119123 /key1: val1/
120124 ) . with_content (
121125 /key2: val2/
126+ ) . with_validate_cmd (
127+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
122128 )
123129 end
124130 end #custom_facts set key values is string
139145 /- val21/
140146 ) . with_content (
141147 /- val22/
148+ ) . with_validate_cmd (
149+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
142150 )
143151 end
144152 end #custom_facts set key values is array
155163 /key2:/
156164 ) . with_content (
157165 /key21: val21/
166+ ) . with_validate_cmd (
167+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
158168 )
159169 end
160170 end #custom_facts set key values is hash
Original file line number Diff line number Diff line change 109109 /---/
110110 ) . with_content (
111111 /my_fact: my_val/
112+ ) . with_validate_cmd (
113+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
112114 )
113115 end
114116 end
132134 /- my_val0/
133135 ) . with_content (
134136 /- my_val1/
137+ ) . with_validate_cmd (
138+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
135139 )
136140 end
137141 end
155159 /my_key0: my_val0/
156160 ) . with_content (
157161 /my_key1: my_val1/
162+ ) . with_validate_cmd (
163+ "/usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
158164 )
159165 end
160166 end
You can’t perform that action at this time.
0 commit comments