Re: [Puppet Users] New puppet based service: ServerBishop.com

2012-10-22 Thread Guzman Braso
Hi!

I like very much the visual interface :)

It's importing recipes in the plan already?

Most of us already have our recipes we would like to test with

Thanks!

Guzman

On Mon, Oct 22, 2012 at 10:27 PM, Radu Spineanu wrote:

> Hi.
>
> I've been working on a way to quickly create, share, and deploy puppet
> recipes. It's called serverbishop and you can see it here:
> http://serverbishop.com/.
>
> Here is how it works: you create recipes visually, like
> http://serverbishop.com/radu-spineanu/graphite-debian-squeeze. Each
> recipe can be deployed using one command.  That command downloads the
> recipe and executes it locally. It does not connect servers to
> ServerBishop. However you can send reports back to it. Recipes can be
> public or private.
>
> My vision is to create something like Github for Puppet, with
> repositories, issues, and collaboration.
>
> I'd love to get your input. If you're in the Bay Area and you have an hour
> free I'd also love to buy you coffee/beers.
>
> -Radu
>
> --
> 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/-/HqL4dUzI2tEJ.
> 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.
>



-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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: Variables and autoloading

2012-10-22 Thread Guzman Braso
John:

Very concise and helpful answer, thank you very much for your time!

Best regards from Montevideo,

Guzmán
On Mon, Oct 22, 2012 at 12:37 PM, jcbollinger wrote:

>
>
> On Sunday, October 21, 2012 6:02:39 PM UTC-5, Guzmán Brasó wrote:
>>
>> John,
>>
>> I'm new to puppet and your mails confuse me a little bit... if
>> parameterized classes are not recommended and you suggest when dealing with
>> someone else parameterized class to set it through hiera (Puppet 3).
>> Then I don't understand how to proceed with puppet 2 modules...
>>
>
>
> Here are some of your better choices, none of them especially good:
>
>1. Upgrade your master to Puppet 3.  The clients can stay at 2.7 if
>you wish.
>2. Avoid third-party modules whose interfaces involve parametrized
>classes, unless they have built-in hiera support.
>3. Be very careful and deliberate with the placement of your
>parametrized-style class declarations, and expect to troubleshoot parse
>order issues from time to time.
>
>
>
>>
>> Should I hack every module I need to set the defaults inside the module?
>>
>
>
> That's an option too, but I wouldn't recommend it.
>
>
>>
>> And if making a module, without using parameters, how I can reuse the
>> module with different defaults ? Should I create a different params.pp for
>> each scenario I need and then include it inheriting each one of the
>> defaults, this would be a mess to deal with large arquitectures with many
>> different types of nodes.
>>
>
>
> That is what hiera is for.  Although not integrated into the core until
> Puppet 3, hiera is a widely-used add-on to Puppet 2.  Instead of
>
> class mymodule::foo (
>   $param1 = 'default1',
>   $param2 = 'default2' ) {
>   # declarations
> }
>
> I recommend some variation on
>
> class mymodule::foo {
>   $param1 = hiera('foo::param1', 'default1')
>   $param2 = hiera('foo::param2', 'default2')
>   # declarations
> }
>
> Then put any needed 'parameter' customizations into your hiera data.  That
> way not only can you avoid parametrized-style class declarations, but you
> also achieve separation of your data from your code.
>
>
>
>>
>> I'm sorry to ask but since we started using puppet (a few months ago) we
>> started doing everything with parameters as puppet docs said on
>> http://docs.puppetlabs.com/**guides/parameterized_classes.**html
>>  and
>> since then we had no issue (yet) with it.  And now you say that parameters
>> are a sickness and should not be used. Then how on Puppet 2? And why it's
>> still puppet docs still recommending it?
>>
>>
> Puppetlabs heavily promoted parametrized classes starting with their
> release as part of Puppet 2.6.  Evidently, they perceived and continue to
> perceive substantial demand for such a feature.  That doesn't mean it was
> ever a good idea.
>
> Having promoted the feature so effectively puts PuppetLabs in a difficult
> position.  At least some of their people will acknowledge the problems with
> parametrized classes, at least in Puppet 2.x.  I can only speculate about
> company policy here, but it would be reasonable for PL to judge that doing
> an about-face on parametrized classes could present credibility and trust
> issues for the company.
>
> PL put a lot of effort into improving parametrized classes for Puppet 3,
> and they are indeed better.  As I have lately written, I think the result
> rescues a lot of parametrized classes that are already in use.  That
> doesn't mean that it's a good idea to write new parametrized classes even
> for Puppet 3, however.
>
> And of course, a lot of people are using parametrized classes
> successfully.  My argument has never been that they don't work, only that
> they exact unneeded costs in productivity and stability relative to the
> best available alternative.  Those costs will scale with the number of
> dependencies between classes.
>
>
> John
>
>  --
> 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/-/r53hq-Tk8CsJ.
>
> 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.
>



-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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: Variables and autoloading

2012-10-21 Thread Guzman Braso
John,

I'm new to puppet and your mails confuse me a little bit... if
parameterized classes are not recommended and you suggest when dealing with
someone else parameterized class to set it through hiera (Puppet 3).
Then I don't understand how to proceed with puppet 2 modules...

Should I hack every module I need to set the defaults inside the module?

If this is the way, what if I need to reuse the module with different
defaults?
I thought a good module was a module I don't need to touch and I can set my
defaults from my call, with this approach as soon I start using a module
I'll likely not keep up to date with it, as it will have to deal with all
the hacked code during upgrades.

And if making a module, without using parameters, how I can reuse the
module with different defaults ? Should I create a different params.pp for
each scenario I need and then include it inheriting each one of the
defaults, this would be a mess to deal with large arquitectures with many
different types of nodes.

I'm sorry to ask but since we started using puppet (a few months ago) we
started doing everything with parameters as puppet docs said on
http://docs.puppetlabs.com/guides/parameterized_classes.html and since then
we had no issue (yet) with it.  And now you say that parameters are a
sickness and should not be used. Then how on Puppet 2? And why it's still
puppet docs still recommending it?

Thanks in advance for your time!

Guzmán
On Mon, Oct 15, 2012 at 6:56 PM, jcbollinger wrote:

>
>
> On Monday, October 15, 2012 9:43:48 AM UTC-5, Matt Zagrabelny wrote:
>>
>> Can you suggest an alternative to parameterized classes?
>>
>>
> Funny that you ask.  I just did exactly that a few doors down:
> https://groups.google.com/forum/#!msg/puppet-users/dICUPHn3azY/b0wJaiSbs8kJ.  
> I'm afraid I waxed long-winded, but there is an example in there.
> Basically, thoug
>
h, it's to use hiera, and to do so explicitly instead of via 3.0's hiera /
> class parameter integration.
>
>
> John
>
> --
> 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/-/ZNXpUwtq3UgJ.
>
> 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.
>



-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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] Can Puppet interact with perl script user input fields?

2012-10-04 Thread Guzman Braso
Hi,

Please, be warn that I'm not a puppet guru, and very likely what I'm going
to tell you it's not recommended at all.

I've deal with the same issue with fdisk because sfdisk did not allow me to
do some stuff and needed to align some extra ssd drives from puppet.

exec { "run_abindproxy.pl":
  logoutput => on_failure,
  command => adbindproxy.pl < 
}

That will provide two carrier return on the expected input of
abbdindproxy.pl
If you have 4 questions, two should be hit carrier return to set default,
third should set 2 and four "on", would be:
exec { "run_abindproxy.pl":
  logoutput => on_failure,
  command => adbindproxy.pl < 
}

This works like a charm in puppet 2.7, dunno other versions. And again: I
don't believe this is a recommended way.

Cheers

Guzman
On Thu, Oct 4, 2012 at 6:34 AM, Jon Skarpeteig wrote:

> I'm trying to automate deployment of centrify-samba, which has a
> adbindproxy.pl setup script attached. This script expects user input
> (where 9 out of 10 options can be defaulted). Is there any way for
> Puppet to preconfigure the inputs for this scripts, and mimic user
> behavior by supplying this information?
>
> --
> 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.
>
>


-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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 : Cannot require an Exec

2012-10-02 Thread Guzman Braso
I think it's the expected behavior...

My reading is that if you want Exec["exec-DDD"] being run only when
Exec["exec-CCC"] have run, and at the same time, Exec["exec-CCC"] has
refreshonly attribute, then it's not require the way, it's set it to
refreshonly and tell Exec["exec-CCC"] to notify Exec["exec-"].

When you require exec-CCC from exec-DDD, puppet will make sure of place
exec-CCC before exec-DDD, but if exec-CCC does not run, be it for a ifonly
non true, be it for been a refreshonly type without notice, it will
continue anyway.

Metaparameters page (
http://docs.puppetlabs.com/references/stable/metaparameter.html) says:
>
> This is used purely for guaranteeing that changes to required objects
happen before the dependent object"
>

The word "happen" here is tricky, I would say then than happen means "are
parsed and run if needed".

Or... I'm more lost than I thought with puppet and my english still sucks :)

Cheers

Guzman

On Tue, Oct 2, 2012 at 9:32 PM, Miguel Di Ciurcio Filho <
miguel.fi...@gmail.com> wrote:

> On Tue, Oct 2, 2012 at 5:36 PM, am-aaron  wrote:
> >
> > exec { "exec-AAA":
> >   command => "/bin/true",
> >   returns => 0,
> >   notify  => Exec["exec-BBB"],
> > }
> > exec { "exec-BBB":
> >   refreshonly => true,
> >   command => "/bin/false",
> >   returns => 0,
> >   notify  => Exec["exec-CCC"],
> > }
> > exec { "exec-CCC":
> >   refreshonly => true,
> >   command => "/bin/touch /tmp/CCC",
> >   returns => 0,
> > }
> >
> > exec { "exec-DDD":
> >   require => Exec["exec-CCC"],
> >   command => "/bin/true",
> >   returns => 0,
> >   notify  => Exec["exec-EEE"],
> > }
>
> I tested your code and indeed, it is a strange behavior.
>
> I guess the root cause of the problem is the `refreshonly => true` of
> exec-CCC.
>
> My reading of the situation:
> - exec-BBB runs and fails, sending nothing to exec-CCC.
> - exec-CCC has `refreshonly => true`, since exec-BBB has failed, it
> does nothing.
> - exec-DDD runs, even having `require => Exec['exec-CCC']` which has
> not received a notify because exec-BBB failed.
>
> I did a test using the chaining syntax and the behavior is the same:
>
> Exec['exec-AAA'] ~> Exec['exec-BBB'] ~> Exec['exec-CCC'] ->
> Exec['exec-DDD']
>
> # puppet apply test.pp
> /Stage[main]//Exec[exec-AAA]/returns: executed successfully
> Error: /Stage[main]//Exec[exec-BBB]: Failed to call refresh:
> /bin/false returned 1 instead of one of [0]
> Error: /Stage[main]//Exec[exec-BBB]: /bin/false returned 1 instead of one
> of [0]
> /Stage[main]//Exec[exec-DDD]/returns: executed successfully
>
> Exec['exec-CCC'] does not receive a notification and does not run
> because exec-BBB failed. Although, it fulfills the `require`
> relationship with Exec['exec-DDD'], which runs.
>
> Note: changing the relationship of Exec['exec-CCC'] and
> Exec['exec-DDD'] from `require` para `notify` does not solve the
> problem, the behavior is the same.
>
> Very odd. The documentation about `exec` does not say anything about
> this behavior of `refreshonly` [1].
>
> [1] http://docs.puppetlabs.com/references/stable/type.html#exec
>
> --
> 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.
>
>


-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

-- 
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] Removing intermediate variables in calculation

2012-10-02 Thread Guzman Braso
I'm in no way a puppet guru but rewritting it didnt work? from a logic
point of view this should work:


class 
  $baseurl,
  $webapp_context_path = ''
) {
  if ($webapp_context_path == '') {
# Try to get value from baseurl
$webapp_context_path = regsubst($baseurl, '^https?://[^/]+(/.*)', '\1')
if ($webapp_context_path == '') {
  #Set default
  $webapp_context_path = '/'
}
 }
 notify{"rewritted webapp_context_path='${webapp_context_path}' from
url='${baseurl}'": }
}

But as I said I'm fairly new with puppet, did not tried above code.

On Mon, Oct 1, 2012 at 10:28 PM, Amos Shapira wrote:

> Hello,
>
> I have a small Puppet 2.7 module to configure Sonatype Nexus Professional.
> The module takes, among other things, a baseurl in the form of "
> http://example.com/path"; and I'd like it to extract the "/path" from that
> variable into a separate variable IF an optional "path" variable haven't
> been supplied.
>
> Here is an extract:
> class nexus::config(
> ...
>   $baseurl,
>   $webapp_context_path = ''
> ) {
>   if ($webapp_context_path == '')
>   {
> $webapp_context_path = regsubst($baseurl, '^https?://[^/]+(/.*)', '\1')
>

   $webapp_context_path = regsubst($baseurl, '^https?://[^/]+(/.*)', '\1')

if ($extracted_url_path)
> {
>   $int_webapp_context_path = $extracted_url_path
> }
> else
> {
>   # in case we were given a $baseurl without the tailing "/"
>   $int_webapp_context_path = '/'
> }
> notify{"extracted int_webapp_context_path
> \"${int_webapp_context_path}\" from url \"${baseurl}\"": }
>   }
>
>   # use $int_webapp_context_path in the .erb template file
>
> My question - this use of $int_webapp_context_path and $extracted_url_path
> looks a bit shabby. But I didn't find a way to use conditional assignments
> to remove these intermediate variables and either:
> 1. Assign the value I want to $webapp_context_path if it's not set yet.
> 2. Or at least get rid of the $extracted_url_path
>
> Is there a nicer way to achieve the above?
>
> Thanks.
>
> --
> 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/-/rNRGRX2LrzkJ.
> 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.
>



-- 
GuruHub - Guzmán Brasó
http://www.guruhub.com.uy - +59898674020
Rivera 3565 - CP11400 - Montevideo, Uruguay

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