Re: [Puppet Users] Re: rspec-puppet: function stubs

2014-01-05 Thread Johan De Wit

I think the best place to look for examples is the puppet code itself.

I haven't used stubbing that much myself, but this will be coming very 
soon.


I'm trying to write an dynamic openldap type starting from the rspec file.

I documented a bit on every step i did, and tagged the git repo every 
milestone i reached.


This is very draft, but any comments are more then welcome.

https://github.com/Open-Future-Belgium/puppet_rspec_demo

Gtrs

Jo



On 01/03/2014 04:16 AM, Tehmasp Chaudhri wrote:

I'm looking to do this as well. Did you ever have any luck?

On Friday, July 27, 2012 8:44:08 AM UTC-6, James Stremick wrote:


I'm looking for a way to stub a parser function within
rspec-puppet. This function returns data based on a database query
and I'd rather not have to populate dummy data inside my rspec tests.

I can redefine the function by doing something like the following:

Puppet::Parser::Functions::rmfunction("lookup_facts")
Puppet::Parser::Functions::newfunction(:lookup_facts, :type =>
:rvalue) { '127.0.0.1' }

but it isn't in effect on the resulting catalog during the tests.

I'm thinking that either the catalog is already generated or I'm
not telling the compiler to use the updated function.

Any suggestions?

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b7083977-2776-47e0-be96-cb81e7ebe722%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_
 



Next Events:
Puppet Advanced Training | 
http://www.open-future.be/puppet-advanced-training-7-till-9th-january
Puppet Fundamentals Training | 
http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february
Subscribe to our newsletter | http://eepurl.com/BUG8H

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/52CA61E3.5050107%40open-future.be.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Re: Puppet Pro, 2nd edition - status directly from APress

2014-01-05 Thread Johan De Wit

Hi spencer,

I just received the hard-copy of the book.

let's start reading :)

Grts

Jo




On 12/24/2013 11:04 PM, Spencer Krum wrote:

Hello,

I am one of the Authors of Pro Puppet. I'm glad to hear that everyone 
is trying to buy the book. I'm sorry that its taken so long to get it 
written, then even longer to get the book to all of you.


I have a couple responses:

1) If the book is taking too long to get to you, or you are being told 
some ridiculous ship date, please contact me off list and I will do 
what I can to kick this down the road.


2) If you are unable to afford the book due to financial hardship, 
please contact me off list and we can probably work something out.


For what its worth, I haven't received my copies yet either.

Thanks so much for giving us the opportunity to write this, we really 
appreciate it. Any feedback you have would be welcome, positive or 
negative. Though, we would rather see negative feedback sent privately.


Thanks again,
Spencer




On Tue, Dec 24, 2013 at 9:40 AM, Stuart Cracraft > wrote:


Soft-cover/paperback arrived yesterday at my place.

A cursory glance shows better coverage and more practical examples
than I see in the previous edition.


On Monday, December 23, 2013 1:15:44 AM UTC-8, Johan De Wit wrote:

I don't know what they are doing, but it will be an adventure
to get a
hard-copy of the book :)

Krum, Spencer "Pro Puppet (Professional Apress)"
 Voraussichtliches Lieferdatum: 28. Juni 2014 - 30. Juni 2014



On 12/22/2013 02:59 AM, Stuart Cracraft wrote:
> hey did some ruby and cured those blues away.
>
>> On Dec 21, 2013, at 5:55 PM, Felix Frank
 wrote:
>>
>> Uhm, what is now?
>>
>>> On 12/20/2013 11:35 PM, Stuart Cracraft wrote:
>>> It's all too money-centric and materialist.
>>>
>>> What a shame.
>> --
>> You received this message because you are subscribed to a
topic in the Google Groups "Puppet Users" group.
>> To unsubscribe from this topic, visit
https://groups.google.com/d/topic/puppet-users/B-IogA5Tflc/unsubscribe.

>> To unsubscribe from this group and all its topics, send an
email to puppet-users...@googlegroups.com.
>> To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/52B6469C.5090202%40Alumni.TU-Berlin.de.

>> For more options, visit
https://groups.google.com/groups/opt_out.


-- 
Johan De Wit


Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP006)
_

Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax +32 (0)2/255 70 71

3071 KORTENBERG Mobile +32 (0)474/42 40 73

BELGIUM http://www.open-future.be
_


Next Events:
Puppet Advanced Training |
http://www.open-future.be/puppet-advanced-training-7-till-9th-january

Puppet Fundamentals Training |

http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february

Subscribe to our newsletter | http://eepurl.com/BUG8H

-- 
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+unsubscr...@googlegroups.com
.
To view this discussion on the web visit

https://groups.google.com/d/msgid/puppet-users/6b9f7fea-f117-43e1-bf2f-15b88f096ef8%40googlegroups.com.


For more options, visit https://groups.google.com/groups/opt_out.




--
Spencer Krum
(619)-980-7820
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CADt6FWO3FaA0cqC%2BCmy2W81s_S1WHtO%3D%3DFNDD7EQ-QJo6TV-CA%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP006)
_
 
Open-Future Phone +32 (0)2/255 70 70

Zavelstraat 72  Fax   +32 (0)2/255 70 71
3071 KORTENBERG Mobile+32 (0)474/42 40 73
BELGIUM http://www.open-future.be
___

[Puppet Users] Re: Cloud provisioning using Open Source Puppet

2014-01-05 Thread Josh
You could always check out The Foreman [1].

[1] http://theforeman.org

Josh

On Sunday, January 5, 2014 4:14:56 AM UTC-5, Johan Martinez wrote:
>
>
> I am looking for Open Source Puppet solution that will help in launching 
> and managing ec2 instances, RDS instances, elastic cache instances. I think 
> Puppet Enterprise supports AWS out of the box, but I am confused by Puppet 
> Open Source support. Are there any puppetlabs modules  that would hep in 
> AWS/cloud instance management? I found cloud provisioner module - 
> https://forge.puppetlabs.com/puppetlabs/cloud_provisioner , but it's 
> 'getting started' is missing. I would appreciate if someone could point out 
> Puppet Open source solutions for AWS and their documentation.
>
> Thanks,
> -jM
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d739f707-fb23-4968-a838-ccc59755485f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Hiera and ENC-set top-scope variables

2014-01-05 Thread Josh
Hi,

I'm trying to do the exact same thing without success.  If I understand the 
Hiera documentation correctly [1], this should be possible (although, I may 
be misunderstanding this documentation).  The only workaround I have 
currently is to turn the top-scope variable (provided by my ENC) into a 
fact using something like:

file { "/etc/puppetlabs/facter/facts.d/group.txt":
  content => "group=$group",
}

However, this has it's disadvantages, because the $::group fact doesn't 
become available until after the puppet run that declares the file resource.

Any ideas?

Thanks,

Josh

[1] http://docs.puppetlabs.com/hiera/1/variables.html

On Friday, November 22, 2013 12:34:24 PM UTC-5, Matthew Ceroni wrote:
>
> I am trying to use an ENC-set top-scope variable in my Hiera hierarchy. 
> However it doesn't seem to be working.
>
> Here is what is returned by my ENC script (it is the foreman ENC script) 
> for a node:
>
> parameters: 
>   san_rafael-spacewalk: mai01-sprxy-02v
>   puppet_ca: mai01-pmstr-02v
>   group: engineering
>   spacewalk_type: site
>   san_rafael_dmz-spacewalk: mai01-sprxy-01v
>   hostgroup: base/production/engineering/quality_assurance/locked
>   san_rafael_dmz-proxy: mai01-dprxy-01v
>   spacewalk_host: mai02-swalk-01v
>   santa_rosa_dmz-spacewalk: mai02-sprxy-01v
>   root_pw: $1$ubWDPsM+$lzyZdN91QCk6dZAhMXBlM/
>   foreman_env: production
>   santa_rosa_dmz-proxy: mai02-dprxy-01v
>   activation_key: 5-839beb8c567b98c0720db37f19ecb64d
>   puppetmaster: mai01-pmstr-02v
> environment: production
> classes: 
>   security::access: 
>   security::users: 
>
> Then in my hiera.yaml file I have:
>
> ---
> :backend:
>   - yaml
> :hierarchy:
>   - %{::clientcert}
>   - %{::group}
>   - %{::dc_location}_%{::is_dmz}
>   - %{::operatingsystem}
>   - common
>
> :yaml:
>   :datadir: '/var/lib/hiera'
>
> Then within /var/lib/hiera I added an engineering.yaml file. But it 
> doesn't seem to be referenced when Hiera goes through the hierarchy. One 
> way I verified this (to ensure something else funky wasn't going on) is 
> that i purposely put an error in the engineering.yaml file and Puppet runs 
> without issue. 
>
> Is it not possible to use a variable returned from ENC?
>
> Thanks
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/0f5dd617-8144-4c58-9c0d-ac31e3886cbc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet require - failure handling

2014-01-05 Thread Jose Luis Ledesma
Clases WordPress requiere both MySQL and apache, so no resource of WordPress 
will be "executed" if any of them fails

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a9e8974b-623c-496a-acbd-721ed377ad01%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet require - failure handling

2014-01-05 Thread neubyr
That explains how resource ordering works. Is it the same way with require
statement? For example, if apache or mysql class fails on the node, would
wordpress class run be attempted?



On Sun, Jan 5, 2014 at 8:50 AM, Jose Luis Ledesma <
joseluis.lede...@gmail.com> wrote:

> Right! I wrote it from the mobile :s
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/f510902a-d745-4b5b-afa1-fc37388749fd%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALFxCvz9rz%2Bj-XdGCJ%3DhSstECRX2wggWQBJj70hBx58o%3DzjLSw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet require - failure handling

2014-01-05 Thread Jose Luis Ledesma
Right! I wrote it from the mobile :s

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/f510902a-d745-4b5b-afa1-fc37388749fd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet require - failure handling

2014-01-05 Thread Andreas Ntaflos

On 2014-01-05 11:37, Jose Luis Ledesma wrote:

There is not after or before when puppet applies a manifest if there are not 
dependencies explicitly declared. In the example you have written mysql and 
apache will be applied in no particular order between them, but will be 
implemented both before any other resource in the WordPress class.

If you want mysql or apache implemented before the other, you can chain classes:

Class['mysql']=>Class['apache']


To be syntactically correct that should be

Class['mysql'] -> Class['apache']

with a -> and not a =>.

Andreas



signature.asc
Description: OpenPGP digital signature


[Puppet Users] Puppet require - failure handling

2014-01-05 Thread Jose Luis Ledesma
There is not after or before when puppet applies a manifest if there are not 
dependencies explicitly declared. In the example you have written mysql and 
apache will be applied in no particular order between them, but will be 
implemented both before any other resource in the WordPress class.

If you want mysql or apache implemented before the other, you can chain classes:

Class['mysql']=>Class['apache']

This will apply mysql before apache, and only will implement apache if mysql 
goes OK.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e8d6ef4d-edb1-41f4-ab4c-ad840e77754a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Cloud provisioning using Open Source Puppet

2014-01-05 Thread Johan Martinez

I am looking for Open Source Puppet solution that will help in launching 
and managing ec2 instances, RDS instances, elastic cache instances. I think 
Puppet Enterprise supports AWS out of the box, but I am confused by Puppet 
Open Source support. Are there any puppetlabs modules  that would hep in 
AWS/cloud instance management? I found cloud provisioner module - 
https://forge.puppetlabs.com/puppetlabs/cloud_provisioner , but it's 
'getting started' is missing. I would appreciate if someone could point out 
Puppet Open source solutions for AWS and their documentation.

Thanks,
-jM

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/37d28db4-07fe-4e5e-bb45-cddebb5a15e1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet require - failure handling

2014-01-05 Thread Johan Martinez

If I define a wordpress class with require functions as below:

class wordpress { require apache require mysql ... }

Then would it run even if apache or mysql classes fail for some reason? 
Also, if apache class returns an error, would mysql class run get triggered 
or Puppet would exit after apache class error?

-jM

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/3b1969d1-5905-4759-91bb-1f8a240914cf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.