Re: [Puppet Users] Problem in wordpress moodule.

2011-06-20 Thread Ken Barber
The main reason I separate title from namevar is so when I have
references to the exec they stay consistent - but the command  args
can be updated independently. This matters more when I have references
that cross file boundaries.

ken.

On Sat, Jun 18, 2011 at 7: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?

 --
 vagn

 --
 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.



-- 
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] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
I could not do what you suggested at the weekend.
I tried all the tips you gave me. But I could not fix.
The file directory is specified, the problem is that it gives error
unpacking, and when I run the tar command line manually, it works fine.

Sorry for my English!

-- 
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] Problem in wordpress moodule.

2011-06-20 Thread Ken Barber
Did you try the logouput = on_failure in the exec?

Can you try that and run the content with the --debug flag so we can
all see the output? (try putting the output in pastie.org if its a lot
of information).

ken.

On Mon, Jun 20, 2011 at 1:28 PM, lucas.brig...@ymail.com
grillobri...@gmail.com wrote:
 I could not do what you suggested at the weekend.
 I tried all the tips you gave me. But I could not fix.
 The file directory is specified, the problem is that it
 gives error unpacking, and when I run the tar command line manually, it
 works fine.

 Sorry for my English!

 --
 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.


-- 
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] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
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

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.

Attached is the module.

2011/6/20 Ken Barber k...@puppetlabs.com

 Did you try the logouput = on_failure in the exec?

 Can you try that and run the content with the --debug flag so we can
 all see the output? (try putting the output in pastie.org if its a lot
 of information).

 ken.

 On Mon, Jun 20, 2011 at 1:28 PM, lucas.brig...@ymail.com
 grillobri...@gmail.com wrote:
  I could not do what you suggested at the weekend.
  I tried all the tips you gave me. But I could not fix.
  The file directory is specified, the problem is that it
  gives error unpacking, and when I run the tar command line manually, it
  works fine.
 
  Sorry for my English!
 
  --
  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.
 

 --
 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
www.codebroken.wordpress.com

-- 
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.



wordpress-module.tar.gz
Description: GNU Zip compressed data


Re: [Puppet Users] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
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

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.

Attached is the module.

2011/6/20 Ken Barber k...@puppetlabs.com

 Did you try the logouput = on_failure in the exec?

 Can you try that and run the content with the --debug flag so we can
 all see the output? (try putting the output in pastie.org if its a lot
 of information).

 ken.

 On Mon, Jun 20, 2011 at 1:28 PM, lucas.brig...@ymail.com
 grillobri...@gmail.com wrote:
  I could not do what you suggested at the weekend.
  I tried all the tips you gave me. But I could not fix.
  The file directory is specified, the problem is that it
  gives error unpacking, and when I run the tar command line manually, it
  works fine.
 
  Sorry for my English!
 
  --
  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.
 

 --
 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
www.codebroken.wordpress.com

-- 
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.



wordpress-module.tar.gz
Description: GNU Zip compressed data


Re: [Puppet Users] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
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

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.

Attached is the module.

2011/6/20 Ken Barber k...@puppetlabs.com

 Did you try the logouput = on_failure in the exec?

 Can you try that and run the content with the --debug flag so we can
 all see the output? (try putting the output in pastie.org if its a lot
 of information).

 ken.

 On Mon, Jun 20, 2011 at 1:28 PM, lucas.brig...@ymail.com
 grillobri...@gmail.com wrote:
  I could not do what you suggested at the weekend.
  I tried all the tips you gave me. But I could not fix.
  The file directory is specified, the problem is that it
  gives error unpacking, and when I run the tar command line manually, it
  works fine.
 
  Sorry for my English!
 
  --
  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.
 

 --
 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.



wordpress-module.tar.gz
Description: GNU Zip compressed data


Re: [Puppet Users] Problem in wordpress moodule.

2011-06-20 Thread Ken Barber
 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.

There is a newer version of Puppet in EPEL testing. For example, RHEL/CentOS 5:

http://download.fedora.redhat.com/pub/epel/testing/5Server/x86_64/

I'd suggest upgrading sooner rather then later.

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

So the error you have posted is not related to untar is it? Its a
problem with the cp now ... have you posted the correct thing? Are you
still having trouble with the tar -xzvf ?

err: /Stage[main]//Node[lucas.com.br]/Wordpress::Install[ ]/Exec[cp
-rp /usr/share/wordpress/ /var/www/zertico]/returns: change from
notrun to 0 failed: cp -rp /usr/share/wordpress/ /var/www/zertico
returned 1 instead of one of [0] at
/etc/puppet/modules/wordpress/manifests/install.pp:41

 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.

I'm sorry - I don't understand what you mean here.

ken.

-- 
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] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
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]
 }

But when I run for example:
exec {ps}

The error did not occur previously posted.
-- 
Lucas Pereira Brígida
www.codebroken.wordpress.com

-- 
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] Problem in wordpress moodule.

2011-06-20 Thread lucas.brig...@ymail.com
ken,

The error was occurring because the version of the puppet.
Thank you!

-- 
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] Problem in wordpress moodule.

2011-06-18 Thread Markus Falb
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...,
...
}

-- 
Kind Regards, Markus Falb



signature.asc
Description: OpenPGP digital signature


Re: [Puppet Users] Problem in wordpress moodule.

2011-06-18 Thread vagn scott

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?

--
vagn

--
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] Problem in wordpress moodule.

2011-06-17 Thread lucas.brig...@ymail.com
Hi!

I'm doing a module for the puppet for WordPress will implement.

I'm having problems with this line:

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


And the error generated is this:

err: /Stage[main]//Node[lucas.com.br]/Wordpress::Install[ ]/Exec[tar -vzxf
/var/www/wordpress.tar.gz]/returns: change from notrun to 0 failed: tar
-vzxf /var/www/wordpress.tar.gz returned 1 instead of one of [0] at
/etc/puppet/modules/wordpress/manifests/install.pp:40



Can anyone help me?





-- 
Lucas Pereira Brígida
www.codebroken.wordpress.com

-- 
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] Problem in wordpress moodule.

2011-06-17 Thread Nathan Clemons
Simple question, but does wordpress.tar.gz exist in /var/www/ ?

I would expect that you would want your tar exec to depend on whatever is
deploying the wordpress tar.gz file (another Exec or a File resource), so
that you know it's there before you try to use it.

--
Nathan Clemons
http://www.livemocha.com
The worlds largest online language learning community



On Fri, Jun 17, 2011 at 6:14 AM, lucas.brig...@ymail.com 
grillobri...@gmail.com wrote:

 Hi!

 I'm doing a module for the puppet for WordPress will implement.

 I'm having problems with this line:

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


 And the error generated is this:

 err: /Stage[main]//Node[lucas.com.br]/Wordpress::Install[ ]/Exec[tar -vzxf
 /var/www/wordpress.tar.gz]/returns: change from notrun to 0 failed: tar
 -vzxf /var/www/wordpress.tar.gz returned 1 instead of one of [0] at
 /etc/puppet/modules/wordpress/manifests/install.pp:40



 Can anyone help me?





 --
 Lucas Pereira Brígida
 www.codebroken.wordpress.com

 --
 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.


-- 
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] Problem in wordpress moodule.

2011-06-17 Thread Ken Barber
You should usually run the exec with:

exec { asdf:
   ...
   logoutput = on_failure,
   ...
}

This prints to screen any error. Anyway the clue for your case is in
the error message:

err: /Stage[main]//Node[lucas.com.br]/Wordpress::Install[ ]/Exec[tar
-vzxf /var/www/wordpress.tar.gz]/returns: change from notrun to 0
failed: tar -vzxf /var/www/wordpress.tar.gz returned 1 instead of one
of [0] at /etc/puppet/modules/wordpress/manifests/install.pp:40

So trying to run it:

tar -vzxf /var/www/wordpress.tar.gz
echo $?

Should tell you what is wrong.

ken.

On Fri, Jun 17, 2011 at 2:14 PM, lucas.brig...@ymail.com
grillobri...@gmail.com wrote:
 Hi!
 I'm doing a module for the puppet for WordPress will implement.
 I'm having problems with this line:

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

 And the error generated is this:

 err: /Stage[main]//Node[lucas.com.br]/Wordpress::Install[ ]/Exec[tar -vzxf
 /var/www/wordpress.tar.gz]/returns: change from notrun to 0 failed: tar
 -vzxf /var/www/wordpress.tar.gz returned 1 instead of one of [0] at
 /etc/puppet/modules/wordpress/manifests/install.pp:40

 Can anyone help me?




 --
 Lucas Pereira Brígida
 www.codebroken.wordpress.com

 --
 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.


-- 
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] Problem in wordpress moodule.

2011-06-17 Thread vagn scott

On 06/17/2011 09:14 AM, lucas.brig...@ymail.com wrote:

Hi!

I'm doing a module for the puppet for WordPress will implement.

I'm having problems with this line:

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


1. make sure wordpress.tar.gz is on the machine before you try to untar it
2. put the x first: tar xzvf wordpress.tar.gz

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.

OK, that's confusing. the whole thing (wordpress, not the
entire lamp stack) is in a tarfile attachement.
Hope the list  accepts it.



And the error generated is this:

err: /Stage[main]//Node[lucas.com.br
http://lucas.com.br]/Wordpress::Install[ ]/Exec[tar -vzxf
/var/www/wordpress.tar.gz]/returns: change from notrun to 0
failed: tar -vzxf /var/www/wordpress.tar.gz returned 1 instead of
one of [0] at /etc/puppet/modules/wordpress/manifests/install.pp:40



Can anyone help me?





--
Lucas Pereira Brígida
www.codebroken.wordpress.com http://www.codebroken.wordpress.com --
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.


--
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.



wordpress-module.tgz
Description: application/compressed-tar