Hi puppeteers! I''m just starting out on this journey, and any help, stylistic or functional, would be greatly appreciated. This is a puppet file describing several chained steps, in a linear dependent sequence. The last, having built up all the systemic dependencies, is to run a maven web server task. The output for this task is "returns: executed successfully". But the server hasn''t been started and when I look at the directory, it''s clear that the build and compile haven''t even been run. Is it obvious to anyone why this exec step says it''s finished but doesn''t seem to have done? centos.pp: Exec { path => [ "usr/local/bin", "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/", "/srv/apps/jdk-7/bin", "/srv/apps/maven/bin", "/home/vagrant/bin" ] } java::setup { "vagrant-jdk7": ensure => ''present'', source => ''jdk-7u25-linux-x64.tar.gz'', deploymentdir => ''/srv/apps/jdk-7'', user => ''vagrant'', pathfile => ''/home/vagrant/.bashrc'' } -> maven::setup { "vagrant-maven": ensure => ''present'', source => ''apache-maven-3.0.5-bin.tar.gz'', deploymentdir => ''/srv/apps/maven'', user => ''vagrant'', pathfile => ''/home/vagrant/.bashrc'', } -> package { ''git'': ensure => installed, } -> exec { "open firewall": command => ''service iptables stop'', } -> file { ''/srv/loadShop/'': ensure => ''absent'', force => ''true'', } -> vcsrepo { ''/srv/loadShop/'': ensure => latest, provider => git, source => <git server url removed>, } -> exec { "run application": cwd => ''/srv/loadShop/loadShop/'', command => ''mvn jetty:run &'', environment => ''MAVEN_OPTS="-XX:+CMSClassUnloadingEnabled -XX:PermSize=256M -XX:MaxPermSize=512M"'', logoutput => true, } Output: Notice: /Stage[main]//Java::Setup[vagrant-jdk7]/File[/var/run/puppet/java_set working-vagrant-jdk7/jdk-7u25-linux-x64.tar.gz]/ensure: defined content as <md5 removed> Notice: /Stage[main]//Java::Setup[vagrant-jdk7]/Exec[extract_java-vagrant-jdk7 returns: executed successfully Notice: /Stage[main]//Exec[open firewall]/returns: executed successfully Notice: /Stage[main]//File[/srv/loadShop/]/ensure: removed Notice: /Stage[main]//Vcsrepo[/srv/loadShop/]/ensure: Creating repository from latest Notice: /Stage[main]//Vcsrepo[/srv/loadShop/]/ensure: created Notice: /Stage[main]//Exec[run application]/returns: executed successfully Notice: Finished catalog run in 162.61 seconds Thanks in advance for any advice. -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
> The output for this task is "returns: executed successfully". But the > server hasn''t been started and when I look at the directory, it''s clear that > the build and compile haven''t even been run. Is it obvious to anyone why > this exec step says it''s finished but doesn''t seem to have done?The & symbol at the end of the command backgrounds the task in Unix:> exec { "run application": > cwd => ''/srv/loadShop/loadShop/'', > command => ''mvn jetty:run &'', > environment => ''MAVEN_OPTS="-XX:+CMSClassUnloadingEnabled > -XX:PermSize=256M -XX:MaxPermSize=512M"'', > logoutput => true, > }Remove it and see what happens instead. Puppet won''t track background tasks like this, and it might be failing. ken. -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Jason Edgecombe
2013-Jun-26 13:49 UTC
Re: [Puppet Users] Mvn task at end of chained sequence
On 06/25/2013 05:47 PM, Chris Hagan wrote:> Hi puppeteers! > > I''m just starting out on this journey, and any help, stylistic or > functional, would be greatly appreciated. > > This is a puppet file describing several chained steps, in a linear > dependent sequence. The last, having built up all the systemic > dependencies, is to run a maven web server task. > > The output for this task is "returns: executed successfully". But the > server hasn''t been started and when I look at the directory, it''s clear > that the build and compile haven''t even been run. Is it obvious to anyone > why this exec step says it''s finished but doesn''t seem to have done? > > centos.pp: > > Exec { path => [ "usr/local/bin", "/bin/", "/sbin/" , "/usr/bin/", > "/usr/sbin/", "/srv/apps/jdk-7/bin", "/srv/apps/maven/bin", > "/home/vagrant/bin" ] } > > java::setup { "vagrant-jdk7": > ensure => ''present'', > source => ''jdk-7u25-linux-x64.tar.gz'', > deploymentdir => ''/srv/apps/jdk-7'', > user => ''vagrant'', > pathfile => ''/home/vagrant/.bashrc'' > } -> > maven::setup { "vagrant-maven": > ensure => ''present'', > source => ''apache-maven-3.0.5-bin.tar.gz'', > deploymentdir => ''/srv/apps/maven'', > user => ''vagrant'', > pathfile => ''/home/vagrant/.bashrc'', > } -> > package { ''git'': > ensure => installed, > } -> > exec { "open firewall": > command => ''service iptables stop'', > } -> > file { ''/srv/loadShop/'': > ensure => ''absent'', > force => ''true'', > } -> > vcsrepo { ''/srv/loadShop/'': > ensure => latest, > provider => git, > source => <git server url removed>, > } -> > exec { "run application": > cwd => ''/srv/loadShop/loadShop/'', > command => ''mvn jetty:run &'', > environment => ''MAVEN_OPTS="-XX:+CMSClassUnloadingEnabled > -XX:PermSize=256M -XX:MaxPermSize=512M"'', > logoutput => true, > } > > Output: > > Notice: > /Stage[main]//Java::Setup[vagrant-jdk7]/File[/var/run/puppet/java_set working-vagrant-jdk7/jdk-7u25-linux-x64.tar.gz]/ensure: > defined content as <md5 removed> > Notice: > /Stage[main]//Java::Setup[vagrant-jdk7]/Exec[extract_java-vagrant-jdk7 returns: > executed successfully > Notice: /Stage[main]//Exec[open firewall]/returns: executed successfully > Notice: /Stage[main]//File[/srv/loadShop/]/ensure: removed > Notice: /Stage[main]//Vcsrepo[/srv/loadShop/]/ensure: Creating repository > from latest > Notice: /Stage[main]//Vcsrepo[/srv/loadShop/]/ensure: created > Notice: /Stage[main]//Exec[run application]/returns: executed successfully > > Notice: Finished catalog run in 162.61 seconds > > Thanks in advance for any advice. >I think that /usr/local/bin needs a leading slash: Exec { path => [ "< insert slash here >usr/local/bin", "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/", "/srv/apps/jdk-7/bin", "/srv/apps/maven/bin", "/home/vagrant/bin" ] } -- 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.