An exec resource will always start with an empty environment. I assume that it can not find the java binary. You can try specifying the path => ‘…' attribute. And: log_output => true
Besides this: please take care on being idempotent (only run in case that it is required) and on error handling (how to proceed/revert in case of error). Best, Martin > On 27 Jul 2016, at 18:43, Christian Charpentier <[email protected]> wrote: > > Hi, > > I'm trying to install openam with puppet. To do this i'm using an exec > resource: > > exec { 'openam_install': > command => "source /etc/profile && /opt/openam/bin/openam_install.sh > install ${::env} > /opt/openam/install.log", > provider => shell, > creates => '/var/lib/tomcat/webapps/sso', > } > > The script openam_install.sh exit with an error code: > > Debug: /Stage[main]/Openam::Config/Exec[openam_install]/returns: ERROR: > command execution failed at line 247 ! > > Error: source /etc/profile && /opt/openam/bin/openam_install.sh install cm > returned 1 instead of one of [0] > > Error: /Stage[main]/Openam::Config/Exec[openam_install]/returns: change from > notrun to 0 failed: source /etc/profile && /opt/openam/bin/openam_install.sh > install cm returned 1 instead of one of [0] > > > > Line 247 i have this: > > > > > java -jar > /opt/openam/configurator/openam-configurator-tool-${openAMversion}.jar -f > /opt/openam/configurator/openam.conf > > echo "Restarting OpenAM" > service tomcat restart > > > The java -jar command fail but i can't figure out why because if i try to > launch this command directly in a shell it works. > > > > Any help would be appreciated. > > > > Thanks. > > > > Chris > > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/c0c81a61-b7cc-46e8-b9cf-63020f7598fd%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/044C43BE-53B1-4E7C-83D5-40286269A785%40gmail.com. For more options, visit https://groups.google.com/d/optout.
