[Puppet Users] Re: Problem in wordpress moodule.

2011-06-22 Thread jcbollinger


On Jun 20, 5:15 pm, lucas.brig...@ymail.com grillobri...@gmail.com
wrote:
 I actually posted about the problem with tar.
 I decided to modify the module to not depend on tar installed.

 But I realized that any command that has parameters to run, the same problem
 occurswhen using this command:

 exec {$ tar-vzxf downdir} {wordpress.tar.gz
                  path = [/ usr / local / bin, / opt / local / bin, /
 usr / bin, / usr / sbin]
          }


The path in that command is broken: there should be no whitespace
around the slashes.  That could easily be enough to make the Exec
fail.  Beyond the whitespace problem, that path also does not contain
the standard (LSB) location of the tar command (/bin), which would
certainly make the Exec fail if you do not have a copy of tar or a
link to it in one of the directories you do specify.  On the third
hand, the code you posted contains at least two syntax errors, so who
knows what you're really using.


 But when I run for example:
 exec {ps}

 The error did not occur previously posted.


Here you are relying on the default path provided by Puppet, which is
not documented to work.  The docs say that you should either use a
fully-qualified command (e.g. /bin/ps) or specify a search path that
can resolve the command (e.g. [ /bin, /usr/bin, /sbin, /usr/
sbin ]; note no whitespace in the directory names).  I don't know
what Puppet provides as a default, but it must include /bin.


John

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Problem in wordpress moodule.

2011-06-22 Thread lucas.brig...@ymail.com
These errors that you report was due to bad formatting of the text when
posted.
But thanks for the tips.

2011/6/22 jcbollinger john.bollin...@stjude.org



 On Jun 20, 5:15 pm, lucas.brig...@ymail.com grillobri...@gmail.com
 wrote:
  I actually posted about the problem with tar.
  I decided to modify the module to not depend on tar installed.
 
  But I realized that any command that has parameters to run, the same
 problem
  occurswhen using this command:
 
  exec {$ tar-vzxf downdir} {wordpress.tar.gz
   path = [/ usr / local / bin, / opt / local / bin,
 /
  usr / bin, / usr / sbin]
   }


 The path in that command is broken: there should be no whitespace
 around the slashes.  That could easily be enough to make the Exec
 fail.  Beyond the whitespace problem, that path also does not contain
 the standard (LSB) location of the tar command (/bin), which would
 certainly make the Exec fail if you do not have a copy of tar or a
 link to it in one of the directories you do specify.  On the third
 hand, the code you posted contains at least two syntax errors, so who
 knows what you're really using.


  But when I run for example:
  exec {ps}
 
  The error did not occur previously posted.


 Here you are relying on the default path provided by Puppet, which is
 not documented to work.  The docs say that you should either use a
 fully-qualified command (e.g. /bin/ps) or specify a search path that
 can resolve the command (e.g. [ /bin, /usr/bin, /sbin, /usr/
 sbin ]; note no whitespace in the directory names).  I don't know
 what Puppet provides as a default, but it must include /bin.


 John

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
Lucas Pereira Brígida

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Problem in wordpress moodule.

2011-06-21 Thread jcbollinger


On Jun 20, 4:54 pm, lucas.brig...@ymail.com grillobri...@gmail.com
wrote:
 I tried using try the logouput = ON_FAILURE in the exec.
 But my client is a puppet CentOS. (The puppet version is outdated).
 Not recognizing this parameter.

 As you asked, I used the - debug.
 The output was this:http://pastie.org/2098147


The command that is failing now is 'cp -rp /usr/share/wordpress/ /var/
www/zertico'.  Based on the manifests you attached, it looks like you
use this executable path: [/usr/local/bin, /opt/local/bin, /usr/
bin, /usr/sbin] (but I can't be sure, because your manifests don't
exactly match your log).  On my CentOS 5 boxes, the cp command is in /
bin (only; this is the LSB-mandated location), so it will not be found
when Puppet attempts to apply your Exec.  Given that you're running a
simple command rather than a script, I'd recommend that you just
specify the full path to the cp command (i.e. /bin/cp) instead of
using a separate 'path' parameter.


 I discovered that any command that has not executed any parameter. Only simple
 commands.
 exec {Free: path = [/ usr / bin]}

 The problem really is in the function exec.


The problem is in the specific Exec resource(s) in your manifest.
Exec in general works fine for many, many people, with a wide variety
of commands.


John

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Problem in wordpress moodule.

2011-06-20 Thread jcbollinger


On Jun 18, 1:35 pm, vagn scott vagnsc...@gmail.com wrote:
 On 06/18/2011 10:31 AM, Markus Falb wrote:



  On 18.6.2011 05:30, vagn scott wrote:

  or you can do what I do and pipe that archive into tar:

           exec { true $title  wget -O - $upstream | tar xzf - --xform
  's,wordpress/,,':
                   cwd         =  $top,
                   creates     =  $top/license.txt,
                   before      =  File[ $top/setup.mysql ],
           }

  the reason for the 'true $title' part is
  that I want to be able to use this exec multiple times (it is in a
  defined class).
  So I need to get the $title in there so puppet doesn't think it is
  a duplicate definition.

  You can separate the title from the actual command

  exec { uniqe title maybe with $title in it:
     command =  wget...,
     ...
  }

 And then I have to make up a title that won't collide
 with another title somewhere else. Also, I lose a line
 of vertical space on the screen, and I have to go
 looking for what the exec is doing, instead of it being
 on the first line.   Shortcut operators don't slow me
 down at all.  Those are my tradeoffs, and why
 I chose this style.  YMMV.

 But, since you mentioned it: Is it so arcane a practice that
 I should avoid it for the sake of people reading my code?


If your concern is for the people reading your code then yes, you
should give your Execs a plain-language title.  You might even find
that people reading your code includes you, six months from now.  Or
tomorrow.  The readability advantage compounds with the number of
Execs in your manifests and with the complexity of their commands.

There are advantages other than readability, as well.  In particular,
the resource title does not change when you tweak the command.  This
is important if your manifests refer to the Exec resource by title --
in another resource's before or notify parameter, for instance.


John

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
2011/6/20 jcbollinger john.bollin...@stjude.org



 On Jun 18, 1:35 pm, vagn scott vagnsc...@gmail.com wrote:
  On 06/18/2011 10:31 AM, Markus Falb wrote:
 
 
 
   On 18.6.2011 05:30, vagn scott wrote:
 
   or you can do what I do and pipe that archive into tar:
 
exec { true $title  wget -O - $upstream | tar xzf -
 --xform
   's,wordpress/,,':
cwd =  $top,
creates =  $top/license.txt,
before  =  File[ $top/setup.mysql ],
}
 
   the reason for the 'true $title' part is
   that I want to be able to use this exec multiple times (it is in a
   defined class).
   So I need to get the $title in there so puppet doesn't think it is
   a duplicate definition.
 
   You can separate the title from the actual command
 
   exec { uniqe title maybe with $title in it:
  command =  wget...,
  ...
   }
 
  And then I have to make up a title that won't collide
  with another title somewhere else. Also, I lose a line
  of vertical space on the screen, and I have to go
  looking for what the exec is doing, instead of it being
  on the first line.   Shortcut operators don't slow me
  down at all.  Those are my tradeoffs, and why
  I chose this style.  YMMV.
 
  But, since you mentioned it: Is it so arcane a practice that
  I should avoid it for the sake of people reading my code?


 If your concern is for the people reading your code then yes, you
 should give your Execs a plain-language title.  You might even find
 that people reading your code includes you, six months from now.  Or
 tomorrow.  The readability advantage compounds with the number of
 Execs in your manifests and with the complexity of their commands.

 There are advantages other than readability, as well.  In particular,
 the resource title does not change when you tweak the command.  This
 is important if your manifests refer to the Exec resource by title --
 in another resource's before or notify parameter, for instance.


 John

 --
 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+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
Lucas Pereira Brígida

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.