Maxim Ianoglo
2010-Apr-29 07:54 UTC
[Puppet Users] Puppet manifests under version control issue
Hello, I tried to add a pre-commit hook using this tutorial: projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control But I get this error. ============================================================================[im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ manifests] > svn commit Sending manifests/init.pp Transmitting file data .svn: Commit failed (details follow): svn: ''pre-commit'' hook failed with error output: /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not found: hostname /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not found: hostname /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not found: dnsdomainname /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not found: domainname /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method `downcase'' for nil:NilClass (NoMethodError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'' from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in `require'' from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 from /usr/bin/puppet:70:in `require'' from /usr/bin/puppet:70 Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ manifests/init.pp. svn: Your commit message was left in a temporary file: svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- commit.2.tmp'' ============================================================================ If I run this from console - everything is ok. I tried to add PATH variable, but no luck. Did anyone faced this issue before ? Puppet Version: puppet-0.25.4-1 OS Version: CentOS release 5.4 (Final) Ruby Version: 1.8.6 Thakn you. -- Maxim Ianoglo -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Patrick
2010-Apr-29 08:18 UTC
Re: [Puppet Users] Puppet manifests under version control issue
On Apr 29, 2010, at 12:54 AM, Maxim Ianoglo wrote:> Hello, > > I tried to add a pre-commit hook using this tutorial: > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > But I get this error. > ============================================================================> [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > manifests] > svn commit > Sending manifests/init.pp > Transmitting file data .svn: Commit failed (details follow): > svn: ''pre-commit'' hook failed with error output: > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: hostname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: hostname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: dnsdomainname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: domainname > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > `downcase'' for nil:NilClass (NoMethodError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > `require'' > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > from /usr/bin/puppet:70:in `require'' > from /usr/bin/puppet:70 > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > manifests/init.pp. > > svn: Your commit message was left in a temporary file: > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > commit.2.tmp'' > ============================================================================> > If I run this from console - everything is ok. > > I tried to add PATH variable, but no luck. > > Did anyone faced this issue before ?Sorry but I got a bit lost. What''s working from the console and where is it failing from? Is it the verify script failing when called from the hook or does "svn commit" work only if it''s run on the console? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Maxim Ianoglo
2010-Apr-29 12:30 UTC
[Puppet Users] Re: Puppet manifests under version control issue
Here is the history :) After I setup pre-commit hook, I tried to commit some changes and got the error I mentioned in first post. I thought that could be the issue with puppet itself, so I tried to run this command from console: /usr/bin/puppet --color=false --confdir=/tmp --vardir=/tmp --parseonly --ignoreimport shell.pp And it worked fine. Then i read ( and thought ) that the cause could be PATH variable. I set it - but no luck. On Apr 29, 11:18 am, Patrick <kc7...@gmail.com> wrote:> On Apr 29, 2010, at 12:54 AM, Maxim Ianoglo wrote: > > > > > > > Hello, > > > I tried to add a pre-commit hook using this tutorial: > > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > > But I get this error. > > =========================================================================== => > [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > > manifests] > svn commit > > Sending manifests/init.pp > > Transmitting file data .svn: Commit failed (details follow): > > svn: ''pre-commit'' hook failed with error output: > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: hostname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: hostname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: dnsdomainname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: domainname > > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > > `downcase'' for nil:NilClass (NoMethodError) > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `gem_original_require'' > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `require'' > > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > > `require'' > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > > from /usr/bin/puppet:70:in `require'' > > from /usr/bin/puppet:70 > > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > > manifests/init.pp. > > > svn: Your commit message was left in a temporary file: > > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > > commit.2.tmp'' > > =========================================================================== => > > If I run this from console - everything is ok. > > > I tried to add PATH variable, but no luck. > > > Did anyone faced this issue before ? > > Sorry but I got a bit lost. What''s working from the console and where is it failing from? Is it the verify script failing when called from the hook or does "svn commit" work only if it''s run on the console? > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brad Lhotsky
2010-Apr-29 16:29 UTC
Re: [Puppet Users] Re: Puppet manifests under version control issue
Also remember puppet is running at the user puppet, so you have to have execute for the user or group puppet on your pre-commit hook. On Thu, Apr 29, 2010 at 8:30 AM, Maxim Ianoglo <dotnox@gmail.com> wrote:> Here is the history :) > > After I setup pre-commit hook, I tried to commit some changes and got > the error I mentioned in first post. > > I thought that could be the issue with puppet itself, so I tried to > run this command from console: > /usr/bin/puppet --color=false --confdir=/tmp --vardir=/tmp --parseonly > --ignoreimport shell.pp > > And it worked fine. > > Then i read ( and thought ) that the cause could be PATH variable. I > set it - but no luck. > > On Apr 29, 11:18 am, Patrick <kc7...@gmail.com> wrote: > > On Apr 29, 2010, at 12:54 AM, Maxim Ianoglo wrote: > > > > > > > > > > > > > Hello, > > > > > I tried to add a pre-commit hook using this tutorial: > > > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > > > > But I get this error. > > > > ==========================================================================> => > > [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > > > manifests] > svn commit > > > Sending manifests/init.pp > > > Transmitting file data .svn: Commit failed (details follow): > > > svn: ''pre-commit'' hook failed with error output: > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: dnsdomainname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: domainname > > > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > > > `downcase'' for nil:NilClass (NoMethodError) > > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `gem_original_require'' > > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > > > from /usr/bin/puppet:70:in `require'' > > > from /usr/bin/puppet:70 > > > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > > > manifests/init.pp. > > > > > svn: Your commit message was left in a temporary file: > > > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > > > commit.2.tmp'' > > > > ==========================================================================> => > > > > If I run this from console - everything is ok. > > > > > I tried to add PATH variable, but no luck. > > > > > Did anyone faced this issue before ? > > > > Sorry but I got a bit lost. What''s working from the console and where is > it failing from? Is it the verify script failing when called from the hook > or does "svn commit" work only if it''s run on the console? > > > > -- > > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > > For more options, visit this group athttp:// > groups.google.com/group/puppet-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Brad Lhotsky -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Trevor Hemsley
2010-Apr-29 16:34 UTC
Re: [Puppet Users] Re: Puppet manifests under version control issue
Don''t forget that subversion hooks run without an environment... For security reasons, the Subversion repository executes hook scripts with an empty environment---that is, no environment variables are set at all, not even $PATH or %PATH%. Because of this, a lot of administrators are baffled when their hook script runs fine by hand, but doesn''t work when run by Subversion. Be sure to explicitly set environment variables in your hook and/or use absolute paths to programs. Does it work if you fully qualify the paths to the executables in your hook script? On 29/04/2010 17:29, Brad Lhotsky wrote:> Also remember puppet is running at the user puppet, so you have to > have execute for the user or group puppet on your pre-commit hook. > > On Thu, Apr 29, 2010 at 8:30 AM, Maxim Ianoglo <dotnox@gmail.com > <mailto:dotnox@gmail.com>> wrote: > > Here is the history :) > > After I setup pre-commit hook, I tried to commit some changes and got > the error I mentioned in first post. > > I thought that could be the issue with puppet itself, so I tried to > run this command from console: > /usr/bin/puppet --color=false --confdir=/tmp --vardir=/tmp --parseonly > --ignoreimport shell.pp > > And it worked fine. > > Then i read ( and thought ) that the cause could be PATH variable. I > set it - but no luck. > > On Apr 29, 11:18 am, Patrick <kc7...@gmail.com > <mailto:kc7...@gmail.com>> wrote: > > On Apr 29, 2010, at 12:54 AM, Maxim Ianoglo wrote: > > > > > > > > > > > > > Hello, > > > > > I tried to add a pre-commit hook using this tutorial: > > > > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control <http://projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control> > > > > > But I get this error. > > > > ==========================================================================> => > > > [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > > > manifests] > svn commit > > > Sending manifests/init.pp > > > Transmitting file data .svn: Commit failed (details follow): > > > svn: ''pre-commit'' hook failed with error output: > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: dnsdomainname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: domainname > > > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined > method > > > `downcase'' for nil:NilClass (NoMethodError) > > > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `gem_original_require'' > > > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > > > from > /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > > > from /usr/bin/puppet:70:in `require'' > > > from /usr/bin/puppet:70 > > > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > > > manifests/init.pp. > > > > > svn: Your commit message was left in a temporary file: > > > svn: > ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > > > commit.2.tmp'' > > > > ==========================================================================> => > > > > If I run this from console - everything is ok. > > > > > I tried to add PATH variable, but no luck. > > > > > Did anyone faced this issue before ? > > > > Sorry but I got a bit lost. What''s working from the console and > where is it failing from? Is it the verify script failing when > called from the hook or does "svn commit" work only if it''s run on > the console? > > > > -- > > You received this message because you are subscribed to the > Google Groups "Puppet Users" group. > > To post to this group, send email to > puppet-users@googlegroups.com <mailto:puppet-users@googlegroups.com>. > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com > <mailto:puppet-users%2Bunsubscribe@googlegroups.com>. > > For more options, visit this group > athttp://groups.google.com/group/puppet-users?hl=en > <http://groups.google.com/group/puppet-users?hl=en>. > > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com > <mailto:puppet-users@googlegroups.com>. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com > <mailto:puppet-users%2Bunsubscribe@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > > > > -- > Brad Lhotsky > -- > You received this message because you are subscribed to the Google > Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- Trevor Hemsley Infrastructure Engineer ................................................. * C A L Y P S O * Brighton, UK OFFICE +44 (0) 1273 666 350 FAX +44 (0) 1273 666 351 ................................................. www.calypso.com This electronic-mail might contain confidential information intended only for the use by the entity named. If the reader of this message is not the intended recipient, the reader is hereby notified that any dissemination, distribution or copying is strictly prohibited. * P * /*/ Please consider the environment before printing this e-mail /*/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Joe McDonagh
2010-Apr-29 19:26 UTC
Re: [Puppet Users] Puppet manifests under version control issue
Maxim Ianoglo wrote:> Hello, > > I tried to add a pre-commit hook using this tutorial: > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > But I get this error. > ============================================================================> [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > manifests] > svn commit > Sending manifests/init.pp > Transmitting file data .svn: Commit failed (details follow): > svn: ''pre-commit'' hook failed with error output: > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: hostname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: hostname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: dnsdomainname > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > found: domainname > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > `downcase'' for nil:NilClass (NoMethodError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `gem_original_require'' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > `require'' > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > `require'' > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > from /usr/bin/puppet:70:in `require'' > from /usr/bin/puppet:70 > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > manifests/init.pp. > > svn: Your commit message was left in a temporary file: > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > commit.2.tmp'' > ============================================================================> > If I run this from console - everything is ok. > > I tried to add PATH variable, but no luck. > > Did anyone faced this issue before ? > > Puppet Version: puppet-0.25.4-1 > OS Version: CentOS release 5.4 (Final) > Ruby Version: 1.8.6 > > Thakn you. > -- > Maxim Ianoglo > >Please paste the code from the pre-commit. -- Joe McDonagh AIM: YoosingYoonickz IRC: joe-mac on freenode "When the going gets weird, the weird turn pro." -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Maxim Ianoglo
2010-Apr-30 07:37 UTC
[Puppet Users] Re: Puppet manifests under version control issue
Hello, Here it is: #!/bin/sh REPOS="$1" TXN="$2" # synthax check of commited sources PATH=''/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/bin:/sbin:/ usr/bin:/usr/sbin:'' tmpfile=`mktemp` export HOME=/ SVNLOOK=/usr/bin/svnlook $SVNLOOK changed -t "$TXN" "$REPOS" | awk ''{print $2}'' | grep ''\.pp$'' | while read line do $SVNLOOK cat -t "$TXN" "$REPOS" "$line" > $tmpfile if [ $? -ne 0 ] then echo "Warning: Failed to checkout $line" >&2 fi /usr/bin/puppet --color=false --confdir=/tmp --vardir=/tmp -- parseonly --ignoreimport $tmpfile >&2 if [ $? -ne 0 ] then echo "Puppet syntax error in $line." >&2 exit 2 fi done res=$? rm -f $tmpfile if [ $res -ne 0 ] then exit $res fi Thank you. -- Maxim Ianoglo On Apr 29, 10:26 pm, Joe McDonagh <Joseph.E.McDon...@gmail.com> wrote:> Maxim Ianoglo wrote: > > Hello, > > > I tried to add a pre-commit hook using this tutorial: > > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > > But I get this error. > > =========================================================================== => > [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > > manifests] > svn commit > > Sending manifests/init.pp > > Transmitting file data .svn: Commit failed (details follow): > > svn: ''pre-commit'' hook failed with error output: > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: hostname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: hostname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: dnsdomainname > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > found: domainname > > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > > `downcase'' for nil:NilClass (NoMethodError) > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `gem_original_require'' > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > `require'' > > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > > `require'' > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > > from /usr/bin/puppet:70:in `require'' > > from /usr/bin/puppet:70 > > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > > manifests/init.pp. > > > svn: Your commit message was left in a temporary file: > > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > > commit.2.tmp'' > > =========================================================================== => > > If I run this from console - everything is ok. > > > I tried to add PATH variable, but no luck. > > > Did anyone faced this issue before ? > > > Puppet Version: puppet-0.25.4-1 > > OS Version: CentOS release 5.4 (Final) > > Ruby Version: 1.8.6 > > > Thakn you. > > -- > > Maxim Ianoglo > > Please paste the code from the pre-commit. > > -- > Joe McDonagh > AIM: YoosingYoonickz > IRC: joe-mac on freenode > "When the going gets weird, the weird turn pro." > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Brad Lhotsky
2010-Apr-30 15:01 UTC
Re: [Puppet Users] Re: Puppet manifests under version control issue
I just put up a subversion pupppet module for automated deployment from release tags: http://github.com/reyjrar/svnutils I wrote a wrapper script for deploying the /etc/puppet stuff: #!/bin/bash BINDIR="/opt/local/sbin" SVNURL="svn+ssh://svn/path/to/puppet" TARGET="/etc/puppet" BACKUP="/etc/puppet.old" $BINDIR/svncheckrel $SVNURL $TARGET rc=$?; if [ "$rc" -eq "0" ]; then if [ -d $BACKUP ]; then rm -rf $BACKUP; fi; mv $TARGET $BACKUP; $BINDIR/svnexportrel $SVNURL $TARGET fi; That''s in /etc/cron.d for every 10 minutes. I have a post-commit hook looking at the "tags/release-" commits and it builds a Changelog from the last "tags/release-" and emails it to specified users. I''ll add that to my github repo today. On Fri, Apr 30, 2010 at 3:37 AM, Maxim Ianoglo <dotnox@gmail.com> wrote:> Hello, > > Here it is: > #!/bin/sh > > REPOS="$1" > TXN="$2" > > # synthax check of commited sources > PATH=''/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/bin:/sbin:/ > usr/bin:/usr/sbin:'' > tmpfile=`mktemp` > export HOME=/ > SVNLOOK=/usr/bin/svnlook > $SVNLOOK changed -t "$TXN" "$REPOS" | awk ''{print $2}'' | grep ''\.pp$'' > | while read line > do > $SVNLOOK cat -t "$TXN" "$REPOS" "$line" > $tmpfile > if [ $? -ne 0 ] > then > echo "Warning: Failed to checkout $line" >&2 > fi > /usr/bin/puppet --color=false --confdir=/tmp --vardir=/tmp -- > parseonly --ignoreimport $tmpfile >&2 > if [ $? -ne 0 ] > then > echo "Puppet syntax error in $line." >&2 > exit 2 > fi > done > res=$? > rm -f $tmpfile > if [ $res -ne 0 ] > then > exit $res > fi > > > Thank you. > -- > Maxim Ianoglo > > On Apr 29, 10:26 pm, Joe McDonagh <Joseph.E.McDon...@gmail.com> wrote: > > Maxim Ianoglo wrote: > > > Hello, > > > > > I tried to add a pre-commit hook using this tutorial: > > > projects.puppetlabs.com/projects/puppet/wiki/Puppet_Version_Control > > > > > But I get this error. > > > > ==========================================================================> => > > [im(1000)@tech04:~/puppet2/trunk/clients/puppet/modules/main/inetd/ > > > manifests] > svn commit > > > Sending manifests/init.pp > > > Transmitting file data .svn: Commit failed (details follow): > > > svn: ''pre-commit'' hook failed with error output: > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: hostname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: dnsdomainname > > > /usr/lib/ruby/site_ruby/1.8/facter/util/loader.rb:73: command not > > > found: domainname > > > /usr/lib/ruby/site_ruby/1.8/puppet/defaults.rb:216: undefined method > > > `downcase'' for nil:NilClass (NoMethodError) > > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `gem_original_require'' > > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet.rb:110 > > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1:in > > > `require'' > > > from /usr/lib/ruby/site_ruby/1.8/puppet/application/puppet.rb:1 > > > from /usr/bin/puppet:70:in `require'' > > > from /usr/bin/puppet:70 > > > Puppet syntax error in trunk/clients/puppet/modules/main/inetd/ > > > manifests/init.pp. > > > > > svn: Your commit message was left in a temporary file: > > > svn: ''/home/im/puppet2/trunk/clients/puppet/modules/main/inetd/svn- > > > commit.2.tmp'' > > > > ==========================================================================> => > > > > If I run this from console - everything is ok. > > > > > I tried to add PATH variable, but no luck. > > > > > Did anyone faced this issue before ? > > > > > Puppet Version: puppet-0.25.4-1 > > > OS Version: CentOS release 5.4 (Final) > > > Ruby Version: 1.8.6 > > > > > Thakn you. > > > -- > > > Maxim Ianoglo > > > > Please paste the code from the pre-commit. > > > > -- > > Joe McDonagh > > AIM: YoosingYoonickz > > IRC: joe-mac on freenode > > "When the going gets weird, the weird turn pro." > > > > -- > > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > > For more options, visit this group athttp:// > groups.google.com/group/puppet-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Brad Lhotsky -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Maxim Ianoglo
2010-May-06 11:29 UTC
[Puppet Users] Re: Puppet manifests under version control issue
Hello, I found my issue. I should export the PATH variable - not just define it: export PATH=''/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/ bin:/sbin:/ and now it works Thank you. -- Maxim Ianoglo -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
mikewootini
2012-Aug-22 21:06 UTC
Re: [Puppet Users] Re: Puppet manifests under version control issue
Had the same problem as Maxim, thanks for the posting your fix as this worked great for me. -mike On Thursday, May 6, 2010 4:29:30 AM UTC-7, Maxim Ianoglo wrote:> > Hello, > > I found my issue. > > I should export the PATH variable - not just define it: > export PATH=''/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/ > bin:/sbin:/ > and now it works > > Thank you. > -- > Maxim Ianoglo > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet...@googlegroups.com<javascript:>. > > To unsubscribe from this group, send email to > puppet-users...@googlegroups.com <javascript:>. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/PhEkuSr9-W8J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.