Im learning Puppet and currently trying to install tomcat. While trying to replace the Catalina home on the startup.sh using sed in the exec block, Im facing the below error.
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '|export CATALINA_HOME=' at /etc/puppetlabs/code/environments/production/modules/tomcat/manifests/init.pp:26:58 on node agent
Current value of startup.sh
export CATALINA_HOME="/home/john"
export JAVA_HOME="/usr"
......
.....
Expected output
export CATALINA_HOME="/home/john/apache-tomcat-6.0.44"
export JAVA_HOME="/usr/java/default"
My code snippet
.......
exec { 'modify_file':
command => "sed -i 's|export CATALINA_HOME="/home/john"|export CATALINA_HOME="/home/john/apache-tomcat-6.0.44"|g' /home/john/apache-tomcat-6.0.44/bin/startup.sh"
path => '/bin',
}
Any help is really appreciated, thanks in advance.
Also, I had went thru the puppet documents regarding path atrribute of exec block but I'm not sure why it is being used and what should be my path value in my manifest file.