File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313 validate_re($title , ' ^[0-9A-Za-z_\- ]+$' , ' The $title fact does not match ^[0-9A-Za-z_\- ]+$' )
1414 $facter_data = { " ${title} " => $value }
15+ if ( versioncmp($::puppetversion , ' 4.0.0' ) < 0 ) {
16+ $validate_cmd = " /usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
17+ } else {
18+ $validate_cmd = " /opt/puppetlabs/puppet/bin/ruby -ryaml -e \" YAML.load_file '%'\" "
19+ }
1520
1621 file { "${facterbasepath}/facts.d/${title}.yaml" :
1722 ensure => $ensure ,
1823 owner => ' root' ,
1924 group => $::puppet::defaults::puppet_group ,
2025 mode => ' 0640' ,
21- validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '%' \" " ,
26+ validate_cmd => $validate_cmd ,
2227 content => template (' puppet/fact.yaml.erb' ),
2328 }
2429
Original file line number Diff line number Diff line change 1414 if $custom_facts {
1515 validate_hash($custom_facts )
1616 }
17+ if ( versioncmp($::puppetversion , ' 4.0.0' ) < 0 ) {
18+ $validate_cmd = " /usr/bin/env ruby -ryaml -e \" YAML.load_file '%'\" "
19+ } else {
20+ $validate_cmd = " /opt/puppetlabs/puppet/bin/ruby -ryaml -e \" YAML.load_file '%'\" "
21+ }
1722
1823 file { "${facterbasepath}/facts.d/local.yaml" :
1924 ensure => file ,
2025 owner => ' root' ,
2126 group => $::puppet::defaults::puppet_group ,
2227 mode => ' 0640' ,
23- validate_cmd => " /usr/bin/env ruby -ryaml -e \" YAML.load_file '%' \" " ,
28+ validate_cmd => $validate_cmd ,
2429 content => template (' puppet/local_facts.yaml.erb' ),
2530 }
2631
You can’t perform that action at this time.
0 commit comments