Skip to content

Instantly share code, notes, and snippets.

@deinspanjer
Last active August 29, 2015 13:55
Show Gist options
  • Save deinspanjer/8736534 to your computer and use it in GitHub Desktop.
Save deinspanjer/8736534 to your computer and use it in GitHub Desktop.
Instead of this:
define set_fix {
file_line { "$name":
path => "$name",
line => 'JAVA_HOME=${JAVA_HOME:-/usr/jdk64/jdk1.6.0_31}',
match => 'JAVA_HOME=.*/jdk1\.6\.0.*',
ensure => "present",
}
}
set_fix { set_fix { [ '/etc/hcatalog/conf.dist/hcat-env.sh', '/etc/pig/conf.dist/pig-env.sh', ]: }: }
I should try this:
$files_to_fix = {
'hcat-env.sh' => { path => '/etc/hcatalog/conf.dist/hcat-env.sh' },
'pig-env.sh' => { path => '/etc/pig/conf.dist/pig-env.sh' },
}
$fix_default_attrs = {
line => 'JAVA_HOME=${JAVA_HOME:-/usr/jdk64/jdk1.6.0_31}',
match => 'JAVA_HOME=.*/jdk1\.6\.0.*',
ensure => "present",
}
create_resources('file_line', $files_to_fix, $fix_default_attrs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment