I have the following resource declaration to set the setenv.sh
file via augeas in puppet.
augeas {'test':
lens => 'Properties.lns',
incl => '/tmp/setenv.sh',
changes => "set CATALINA_OPTS \" $CATALINA_OPTS -XX:PermSize=192m -XX:MaxPermSize=192m \"",
}
I have run into a few issues with the above.
The file basically appends configs to the
CATALINA_OPTS
variable which means when I run augeas it removes all instances of that variable and replaces it with my change. How can I achieve the following?CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/appdynamics/appagent/javaagent.jar" CATALINA_OPTS="$CATALINA_OPTS -XX:PermSize=192m -XX:MaxPermSize=192m"
An attempt to run the above fails due to the quotes. The debug output shows:
Debug: Augeas[test](provider=augeas): sending command 'set' with params ["/files/tmp/setenv.sh/CATALINA_OPTS", " -XX:PermSize=192m -XX:MaxPermSize=192m "] Debug: Augeas[test](provider=augeas): Put failed on one or more files, output from /augeas//error: Debug: Augeas[test](provider=augeas): /augeas/files/tmp/setenv.sh/error = put_failed Debug: Augeas[test](provider=augeas): /augeas/files/tmp/setenv.sh/error/path = /files/tmp/setenv.sh Debug: Augeas[test](provider=augeas): /augeas/files/tmp/setenv.sh/error/lens = /usr/share/augeas/lenses/dist/properties.aug:50.25-.100: Debug: Augeas[test](provider=augeas): /augeas/files/tmp/setenv.sh/error/message = Malformed child node 'CATALINA_OPTS'
How can I have the change use double quotes in the string?