[Puppet Users] Re: [Puppet-dev] Re: Modules Triage Time Change

2016-06-17 Thread Hunter Haugen
>> For those of you in APAC, we apologize for the still-inconvenient time
>> slot. Feel free to reply here with ideas!
>>
>>
>  I just talked to Hunter on IRC. Maybe we can flip flop the times of the
> meeting. For example 9:00UTC and the next week 17:00UTC. This would allow
> us a kind of US meeting and a Europe Meeting. The amount of contributors
> grows, especially in Europe. Maybe this will allow more people to join.
>

The 9:00UTC would be convenient for APAC & EMEA, and 17:00UTC for EMEA &
Americas. I think that would cover all interested parties, and even give a
few options to some.

-- 
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/CAJaQvGB%3DrZkA1%3D%2BUmtaLFAB7ebJBuapp%2B1rUD_LXqbieei4PNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Fwd: Modules Triage Time Change

2016-05-26 Thread Hunter Haugen
Hello,

tl;dr Puppet Modules Community Triage meeting is moving to 17:00-18:00 UTC

This is a quick note that in the last Puppet Modules Community Triage
meeting we discussed a change in the specified time that the meeting
happens.

For those of you who are curious about what the triage meeting is, every
Thursday at 10:00 Pacific Time the Puppet modules team get on a public
video chat (https://bluejeans.com/280736660/) and go over any tickets or
pull requests or any other module-related questions you might have. So want
to chat about any of the puppetlabs (or even voxpupuli) modules, then come
join us today!

So the current time that the meeting happens is 10:00 Pacific Time. The
meeting is a fairly international meeting so we want to move it to UTC and
given time slots of either 16:00-17:00 or 17:00-18:00 we chose the
17:00-18:00 slot. This means it's still the SAME TIME until daylight
savings ends at which point it will be 9:00 PST... see why timezones suck?

For those of you in APAC, we apologize for the still-inconvenient time
slot. Feel free to reply here with ideas!

Cheers,
-Hunter

-- 
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/CAJaQvGCHvgfvaufNbqcHDMwN%2Bg%2Bcvh%3D8O0hCKm%2BwUtqnd%3D6eiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 4 syntax highlighting in Wordpress

2016-04-11 Thread Hunter Haugen
On Mon, Apr 11, 2016 at 4:55 PM, Trevor Vaughan 
wrote:

> Nigel, that is pure sorcery and how did I not know this existed?!
>
> On Mon, Apr 11, 2016 at 3:48 PM, Nigel Kersten  wrote:
>
>> I do Puppet syntax highlighting like this:
>>
>> Open up puppet code in Vim with syntax highlighting on.
>>
>> Use ":TOhtml" to save it as a formatted HTML file.
>>
>
I've been using spacemacs for a while. It's pretty spiffy. It has the
equivalent via `htmlize-file` or just `htmlize-region` if you don't need
the whole file:
http://spacemacs.brianthicks.com/2015/10/06/render-a-file-to-html/

(oh, and that also works in emacs)


>
>> Either use the HTML snippet directly on a web page, or for some GUI HTML
>> editors, they'll understand styled text in your clipboard buffer (that's
>> how I preserve editable text, but syntax highlighted for PowerPoint/Keynote
>> slide decks)
>>
>> This way I can toggle stuff like Vim line numbering that sometimes I want
>> on, and sometimes I want off, and I'm using the same syntax highlighter
>> that I use for normal editing of Puppet code.
>>
>>
>>
>> On Sat, Apr 9, 2016 at 1:35 AM, Alex Harvey 
>> wrote:
>>
>>> I still haven't found any Puppet syntax highlighting plugins for Puppet
>>> (3 or 4).  I'll be most grateful to anyone willing to share their secrets
>>> with me. :)
>>>
>>> --
>>> 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/247df98c-0a7c-4883-ae27-7580d5c2a808%40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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/CAGUqgV8abAnVfSzk5mH_nzMETxjo2APa-%2B7-V_HUTUL9o499bg%40mail.gmail.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
>
> -- This account not approved for unencrypted proprietary information --
>
> --
> 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/CANs%2BFoW1S-Y1Ac4_VVTty-58bsfFniQ%2Bc5-zxqb6YETbmwP4rQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJaQvGAZ2fXN-J%3DOB2mkkni-4DZmjbwJnx3ZecU5TaFCaJ_FFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] DRY duplicated manifest code

2016-03-23 Thread Hunter Haugen
Given the resource you want to apply this pattern to, it can be turned into
a one-liner with a collector:

file { '/tmp/something':
  ensure => file,
}
File['/tmp/something'] ~> Service <| title == 'apache2' |>

This means that if there is a service with a title of apache2 EVER added to
the catalog, it'll be refreshed on file changes. If the service doesn't
exist, then the dependency does nothing.

Now, this isn't exactly what you asked since you wanted the variable
$services_to_notify and didn't say what you're going to do with it, but I
assume this is what you want? Because collectors are not parse-order
specific, you can't do variable assignments like $services_to_notify =
Service <| title == 'apache2' |> (because variables are evaluated in parse
order and collectors are not).

If you really want to make a function that searches the catalog and returns
references, it can be done with something like
`scope.catalog.resource('Service[apache2]')` inside the function I believe,
though that may not be the exact call.



-Hunter

On Wed, Mar 23, 2016 at 12:40 PM, Matt Zagrabelny 
wrote:

> Greetings Puppet Users,
>
> I have a chuck of code I'd like to centralize - you know DRY.
>
> I've looked into a custom function, but I'm uncertain how to get at
> the the puppet resources inside of ruby.
>
> Here is the verbatim copy of the chuck in a puppet manifest:
>
> if defined(Service['apache2']) {
> $services_to_notify = [
> Service['apache2'],
> ]
> }
> else {
> $services_to_notify = []
> }
>
> and here is some hand-wavy pseudocode:
>
> function return_service_array_if_defined($service) {
> if defined(Service[$service]) {
> return [
> Service[$service],
> ]
> }
> else {
> return []
> }
> }
>
> Any suggestions or ideas for implementation?
>
> Thanks!
>
> -m
>
> --
> 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/CAOLfK3V6i82smoDO2kwOYJTiurqdD3O_bt%2BaR4RYUGMsqCPgSw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJaQvGDdEGF8mdSt2b8pxdX49YaY3vg9pnSgnHQJ4d%3D3dQXDxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Changes to Puppet Enterprise compatibility module metadata

2016-03-21 Thread Hunter Haugen
Summary:

If you frequent the Puppet Forge, you are probably familiar with this box,
which indicates the compatibility of various operating systems, Puppet
versions, and Puppet Enterprise versions available at the top of every
module page:

[image: pe_metadata.png]

In the near future, the Forge will indicate the Puppet Enterprise
compatibility information based on the version(s) of Puppet with which the
module is compatible.

Background:

Module authors must specify what versions of PE a module is compatible with
(for example, Puppet Enterprise >= 3.7.0 < 2015.4.0) to be approved or
increase quality scores. This makes it possible for module consumers to
search for modules on the Forge that are compatible with their version of
PE. This requires module authors to update metadata.json and re-release
each module after every new PE release.

What changes:

When searching for modules based on PE compatibility, the Forge will
determine what versions of PE a module is compatible with based on the
version of Puppet the author has specified for compatibility; the Forge
will ignore the deprecated "pe" requirements field. For example, if a
module author has specified that a module is compatible with Puppet 4.x,
the Forge will know which PE versions that module is compatible with and
will return those in search results.

Why:
With the advent of the new Puppet Enterprise version scheme, the major
number is no longer indicative of semver compatibility. Linking PE
compatibility to Puppet compatibility removes the burden of updating PE
compatibility specified in metadata.json after each new PE release.


-Hunter

-- 
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/CAJaQvGDJK5r1a0BoONkeU1A30ehEqgntDoyxME69vJX_imqcTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] firewall module to accept array of sources/dests

2016-02-11 Thread Hunter Haugen
The difficulty with allowing multiple sources is that it falls in line only
with a scripted workflow, not an idempotent workflow. This is from the
iptables manpage: "Multiple addresses can be specified, but this will
expand to multiple rules (when adding with -A), or will cause multiple
rules to be deleted (with -D)."

Converting the firewall type to manage multiple rules with a single
resource is surely the way to madness ;).




-Hunter

On Thu, Feb 11, 2016 at 2:33 PM, Felix Frank <
felix.fr...@alumni.tu-berlin.de> wrote:

> On 02/09/2016 06:41 AM, Alex Harvey wrote:
>
>> Can I get some feedback at this early stage that my PR would be accepted,
>> assuming I can come up with a clean, working solution?
>>
>
> Hi,
>
> I don't think that anyone will be able to answer this without at least
> looking at what you're building, or intend to.
>
> From experience, cool features like this have good chances, *unless* they
> come with some pitfalls or a catch that the maintainer (Puppet Labs?) is
> not willing to accept.
>
> As for the feature you're looking at: My gut tells me that you might not
> be able to come up with a clean model to support all that. Multiple
> destination ports should not be problematic, thanks to netfilter's
> multiport module.
>
> But multiple addresses get expanded into distinct rules, IIRC. This likely
> cannot be reconciled with Puppet's resource model, or not without
> introducing some bizarre semantic tricks.
>
> So my advice is to open a PR as soon as possible, even if the feature does
> not work yet, just to showcase your approach and gather the feedback you
> came seeking here.
>
> HTH,
> Felix
>
> --
> 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/56BD0C52.80307%40Alumni.TU-Berlin.de
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJaQvGCc-J-BDhVErMp%3DRrUSDMKP%2BFYjNchCpCZCLYzXEAukZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet 3 to 4 deprication error

2016-01-22 Thread Hunter Haugen
I don't see anything in that line that is incompatible with puppet 4's
parser. Perhaps previous lines that set the values of $enable_nfsd or
$local_nfsd are affected by the parser?



-Hunter

On Fri, Jan 22, 2016 at 11:30 AM,  wrote:

> The values are defined and this class is working with puppet3 but showing
> error when i use parser=future. Any syntax errors/pup4 compatibility issue
> with this code ?
>
> On Friday, January 22, 2016 at 12:53:57 PM UTC-6, Trevor Vaughan wrote:
>>
>> From the error, I would say that not all of those values are defined at
>> that point and that's why you're seeing issues.
>>
>> You'll need to rewrite the statement to check if the variables are
>> defined.
>>
>> Trevor
>>
>> On Fri, Jan 22, 2016 at 12:38 PM,  wrote:
>>
>>> I typed the code here. It's a typo here in the post. Still getting the
>>> error.
>>>
>>> On Friday, January 22, 2016 at 11:24:33 AM UTC-6, Trevor Vaughan wrote:

 If that's a copy/paste, then your second occurrence of enable_nfsd is
 misspelled.

 Trevor

 On Fri, Jan 22, 2016 at 11:51 AM,  wrote:

> I'm planning to migrate puppet3.8 to 4.x, so testing the compatibility
> of code by using parser=future in puppet.conf file and was stuck at the
> following error when i run puppet agent. The error is pointing at the
> regular expression. Any help is appreciated.
>
> Code:
> ---
> if ($::enable_nfsd !~ /^false$/) and (($:: enable_nfsd =~ /^true$/) or
> ($::local_nfsd == "true"))
>
> ---
>
>
> Error 400 on server: Evaluation Error: left match operand must result
> in a string value. Got an undef value at *.pp .
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/abda8229-0c5a-417e-bebd-eefc2b545b50%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



 --
 Trevor Vaughan
 Vice President, Onyx Point, Inc
 (410) 541-6699

 -- This account not approved for unencrypted proprietary information --

>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/36c5a2a3-42ec-4bad-922d-ab04401475f0%40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Trevor Vaughan
>> Vice President, Onyx Point, Inc
>> (410) 541-6699
>>
>> -- This account not approved for unencrypted proprietary information --
>>
> --
> 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/5d728aac-a11e-4698-8d5f-3e5ef30239f7%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJaQvGDPbbB0c8H8%2BsOb2kFsptVhMSbSS-sJ48K5_EVTXK1-GA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to manage half file.

2016-01-13 Thread Hunter Haugen
Does the application have an "include" syntax that would allow you do have
one file that is one line that the application manages, and the file that
puppet manages includes it where appropriate?

Or a stupid workaround would be to have a fact that is that one line, and a
puppet template that adds the line. So puppet would manage the whole file
but the line would not be affected by a puppet run.



-Hunter

On Wed, Jan 13, 2016 at 12:25 PM, Albert Shih  wrote:

> Hi everybody.
>
> I want to manage through puppet a config file for a php web application.
>
> But I just want manage all of it's content except one line, because this
> line is manage by the application himself.
>
> I can't change the application behavior.
>
> I don't think I can manage through augeas because this file is not in any
> « standard » format.
>
> I prefer not to manage it through file_line because this config file is
> large.
>
> What kind of solution do I have ?
>
> Regards.
>
> JAS
> --
> Albert SHIH
> DIO bâtiment 15
> Observatoire de Paris
> 5 Place Jules Janssen
> 92195 Meudon Cedex
> France
> Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
> xmpp: j...@obspm.fr
> Heure local/Local time:
> mer 13 jan 2016 21:17:48 CET
>
> --
> 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/20160113202546.GB83097%40pcjas.obspm.fr
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJaQvGBx527Ji8AAGf8Ldx9dnPNzX1fEEOUW6nx5%2Bxnr9e5-ig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] POC Update for PuppetForce Apache Module

2016-01-05 Thread Hunter Haugen
Hi AJ!

Ooo, this sounds like a desirable feature for the apache module.

On Tue, Jan 5, 2016 at 5:14 AM, A J  wrote:

> Hello,
>
> I am new to distributed development and Puppet.  The one thing that was
> bothering since I started learning this product is the lack of ability to
> run more than one instance of Apache per host.
>
> I actually like the PuppetForge Apache module for the most part, so I have
> made some changes to it as a Proof-of-Concept for RedHat that allows you to
> run multiple instances.
>
> My question is that I get confused by the documentation, etc. on how best
> to submit this for review to the community, without actually causing any
> problems.
>
> Could someone help direct me as to the correct way to make this submission?
>

Our docs on this are basically what is described in
https://github.com/puppetlabs/puppetlabs-apache/blob/master/CONTRIBUTING.md
though it is not very verbose. Github documentation on creating a pull
request is at https://help.github.com/articles/creating-a-pull-request/

If you have contributions to CONTRIBUTING.md (hah) then the master copy is
held at
https://github.com/puppetlabs/modulesync_configs/blob/master/moduleroot/CONTRIBUTING.md

It also helps speed up the process if you ping us on the #puppet-dev
freenode channel and get real-time feedback.

-- 
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/CAJaQvGDmeyH_D-D_MDjDO-0GGO7kvAWgNG4%2BUUD%2B6nxOaQ9DNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs apache and extra conf.d files

2015-11-05 Thread Hunter Haugen
The apache module contains many mod manifests [1] that use file
resources with templates [2] that you can pattern your code after. No
need to use apache::vhost at all.

[1] https://github.com/puppetlabs/puppetlabs-apache/tree/master/manifests/mod
[2] https://github.com/puppetlabs/puppetlabs-apache/tree/master/templates/mod

On 11/5/15, Arnau  wrote:
> Hi all,
>
> Puppetlab apache module [1] by default purges everything under
> /etc/httpd/conf.d . If you want to add an extra file, you must use
> apache::vhost.
> I'm writing a module for managin thruk. The trhuk rpm packge provides a
> apache conf file (/etc/httpd/conf.d/thruk.conf). At this point I'm
> wondering what is the best way for "translating" the conf file provided by
> the rpm into a apache:vhost.
>
> Is there any automatic way for writing the apache::vhost from a http conf
> file (something like puppet resource ... ? )
>
> How do other people deal with this?
>
> TIA,
> Arnau
>
>
>
> [1] https://forge.puppetlabs.com/puppetlabs/apache
>
> --
> 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/CAM69jx8aMtQoA80VpmVgvGGX2iLytbfB80%2BzURWq%3DiOCLKt-%2BQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 


-Hunter

-- 
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/CAJaQvGD3zs8CVdPxWhPka-krkXZDwh9DcpPsCCdSU%2BDQmMmxkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] validating array property in custom_type

2015-08-11 Thread Hunter Haugen
On Tue, Aug 11, 2015 at 12:57 PM jwilki...@gmail.com wrote:

 So, found another wrinkle in this:

 If the resource doesn't exist on the system yet, and I leave the servers
 attribute out, my validate doesn't catch it:

 mytype{'test type':
 # servers = ['server1','server2']
 }

 That should fail the catalog compile since servers is required and it
 isn't set.  My validate code looks like:

 validate do

  if(self[:servers])
fail(Servers must be an array with at least one member)
 unless self[:servers].is_a?(Array) and self[:servers].size  0
   end
 end

 I found out that isrequired in the newproperty block doesn't actually do
 anything, so I need some way to detect that the resource doesn't exist yet,
 but the catalog specified by the user is wrong.



Ah yes, the old no way to specify required attributes thing. This should
work for required properties:

fail('... is required') if ! self[:servers] and ! self.provider.servers

And this should work for required parameters or properties:

fail('... is required') if ! self[:servers] and self[:ensure] != :absent


 On Tuesday, August 11, 2015 at 3:35:13 PM UTC-4, jwil...@gmail.com wrote:

 Okay, so if I understand you right, validate gets called twice:  once
 without the self hash initialized and once with it initialized.   Seems
 weird, but I can follow that.So, I might want to do something like:


If memory serves me, in order of operation it gets called by the compiler
to validate resources being added to the catalog during compile (to catch
early validation failures), then it gets called during catalog application
to validate resources returned by self.prefetch (or self.instances if
running `puppet resource`) to make sure the system returned things that
make sense, and then finally called to validate each resource being
evaluated from the catalog during apply, because some things can only be
validated agent-side.


 if(self[:servers])
fail(Servers must be an array with at least one member) unless
 self[:servers].is_a?(Array) and self[:servers].size  0
 end

 Here's a follow-up then:  how can you tell the difference between self
 just not being initialized and the user failing to specify the value for a
 particular property?  I guess I'm mitigating it somewhat by doing:




 newproperty(:servers,:array_matching=:all) do
 desc List of database servers; first server in the list will be
 considered the primary server

* isrequired*
 def insync?(is)
   return false unless is == should
   true
 end

   end

 And properties that aren't required wouldn't need to differentiate
 between not being set and just not initialized yet.

 On Tuesday, August 11, 2015 at 2:27:06 PM UTC-4, Hunter Haugen wrote:



 On Fri, Aug 7, 2015 at 1:48 PM jwil...@gmail.com wrote:

 Hi all!

 I'm having trouble with a custom type's type-wide validate call.  I've
 done a lot of digging into the Puppet documentation and a lot of Googling
 and haven't found a lot of guidance.   My Puppet version is 3.7.5.

 Basically, I have a property defined like this in my type:

 newproperty(:servers,:array_matching=:all) do
 desc List of database servers; first server in the list will be
 considered the primary server

 isrequired
 def insync?(is)
   return false unless is == should
   true
 end

 end

 I want to check that the array is non-empty.   I figured out if I
 specify a validate block inside of the newproperty block then I'll just get
 each individual array member, one at a time, which isn't what I want.   So,
 instead, I implemented a type-wide validate call like this:

 Puppet::Type.newtype(:my_type) do

 validate do
fail(servers should have at least one member)  if
 self[:servers].size == 0
 done


 It's kind of awkward, but if your type uses self.instances, then in the
 validate block is run after self.instances runs and has
 resource.provider.servers but not self[:servers]. So I usually just do
 something like `if self[:servers] and self[:servers].size == 0` to avoid
 validating self.instances stuff.

 The validate block is then run again when each resource is evaluated,
 and that is when self's hash is populated with values from the catalog.



 When I try to run puppet resource my_type, I get:

 Error: Could not run: undefined method `size' for nil:NilClass

 When I do a pp on self, I get something that looks like (in part):

 #Puppet::Type::My_type:0x00035f7528
  @managed=false,
  @name_var_cache=:name,
  @original_parameters=
   {:provider=
 #Puppet::Type::My_type::ProviderMy_type:0x00035d1350
  @property_flush={},
  @property_hash=
   {
:servers=[db1],
},
  @resource=#Puppet::Type::My_type:0x00035f7528 ...},
  @parameters=
   {
*snip*
 },
  @provider=
   #Puppet::Type::My_type::ProviderMy_type:0x00035d1350
@property_flush={},
@property_hash=
 {
  :servers=[db1],
  },
@resource=#Puppet::Type::My_type

Re: [Puppet Users] validating array property in custom_type

2015-08-11 Thread Hunter Haugen
On Fri, Aug 7, 2015 at 1:48 PM jwilki...@gmail.com wrote:

 Hi all!

 I'm having trouble with a custom type's type-wide validate call.  I've
 done a lot of digging into the Puppet documentation and a lot of Googling
 and haven't found a lot of guidance.   My Puppet version is 3.7.5.

 Basically, I have a property defined like this in my type:

 newproperty(:servers,:array_matching=:all) do
 desc List of database servers; first server in the list will be
 considered the primary server

 isrequired
 def insync?(is)
   return false unless is == should
   true
 end

 end

 I want to check that the array is non-empty.   I figured out if I specify
 a validate block inside of the newproperty block then I'll just get each
 individual array member, one at a time, which isn't what I want.   So,
 instead, I implemented a type-wide validate call like this:

 Puppet::Type.newtype(:my_type) do

 validate do
fail(servers should have at least one member)  if
 self[:servers].size == 0
 done


It's kind of awkward, but if your type uses self.instances, then in the
validate block is run after self.instances runs and has
resource.provider.servers but not self[:servers]. So I usually just do
something like `if self[:servers] and self[:servers].size == 0` to avoid
validating self.instances stuff.

The validate block is then run again when each resource is evaluated, and
that is when self's hash is populated with values from the catalog.



 When I try to run puppet resource my_type, I get:

 Error: Could not run: undefined method `size' for nil:NilClass

 When I do a pp on self, I get something that looks like (in part):

 #Puppet::Type::My_type:0x00035f7528
  @managed=false,
  @name_var_cache=:name,
  @original_parameters=
   {:provider=
 #Puppet::Type::My_type::ProviderMy_type:0x00035d1350
  @property_flush={},
  @property_hash=
   {
:servers=[db1],
},
  @resource=#Puppet::Type::My_type:0x00035f7528 ...},
  @parameters=
   {
*snip*
 },
  @provider=
   #Puppet::Type::My_type::ProviderMy_type:0x00035d1350
@property_flush={},
@property_hash=
 {
  :servers=[db1],
  },
@resource=#Puppet::Type::My_type:0x00035f7528 ...,
  @tags=
   #Puppet::Util::TagSet: {my_type,
mytitle},
  @title=mytitle

 I poked around the types provided by Puppet and it looks like I should be
 able to do

 self[:servers]

 to access the property, but in practice that doesn't seem to work.  It
 looks like the data I want is buried in the object, but I'm not sure of the
 correct means to get at it.



 --
 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/5d8ea6d1-1afd-4983-a059-832d238eb6fa%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/5d8ea6d1-1afd-4983-a059-832d238eb6fa%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGBxm1Td3peaDfBzLsVD5feJn1_P-saP%2BN2qjHoCOmWm9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] is there any way to get rspec to tell you the contents of the catalog on a failure?

2015-07-22 Thread Hunter Haugen
When I get a vague failure, such as expect File[/whatever] to be in the
catalog and don't know why it's not, I put a pry in the `it` block before
the test failure and re-run. It will drop you into a pry prompt and you can
inspect the catalog manually by running `catalogue` and look for anything
that looks weird.

There is no great way to dump the catalog on failure automatically though.

On Mon, Jul 20, 2015 at 5:31 PM Johnson Earls darkfoxpr...@gmail.com
wrote:

 Another rspec question:

 Is there any way to get rspec to tell you, when a test fails, what the
 contents of the catalog was, at a high level at least, that generated the
 failure?

 I've got a code block that looks right to me, and an rspec test that looks
 right to me.  the test is failing and I have no idea why.  Maybe seeing the
 contents of the catalog would help me figure out what's going on.

 Thanks in advance,
 - Johnson

 --
 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/f60d5256-2333-4953-8228-5da675f8679d%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/f60d5256-2333-4953-8228-5da675f8679d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGBdyx%2BUNhLAzc0878V5bq--5N06ZAUm6PEzoUBhXsDi_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec question: how to test that no resource exists with certain parameters?

2015-07-20 Thread Hunter Haugen
There is no helper built in to rspec-puppet to do this, but you can do it
by using an rspec expect() around a catalogue.resources check:

it has no file resources with ensure = directory do
  expect(catalogue.resources.select { |r| r.type == File  r[:ensure] ==
directory }).to be_empty
end

On Mon, Jul 20, 2015 at 12:28 PM johnson.ea...@gmail.com wrote:

 RSpec question for all the helpful folks here:

 How do I test that there is no resource in the catalog that matches
 certain parameters?

 I know how to test that a specific resource does not exist, or a specific
 resource does not match certain parameters.

 I want to test that, for example, there are no file resources with :ensure
 = directory set.

 Is this possible?

 Thanks in advance,
 - Johnson

 --
 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/89c69357-d468-47ec-80ca-50f847a24a24%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/89c69357-d468-47ec-80ca-50f847a24a24%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGCJR%2BAGt2pi4rPBYsk3bhn7whw9grqwC-o31XQ07hqjaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Virtual resources, collectors, and overrides.

2015-07-17 Thread Hunter Haugen
Both of these methods seems to work on puppet 4, and you could try on
puppet 3:

@notify { 'one': before = Notify['two'], }
@notify { 'two': }
Notify | title == 'one' | {
  before = undef,
}

OR

@notify { 'one': before = Notify['two'], }
@notify { 'two': }
Notify | title == 'one' | {
  before = [],
}

On Fri, Jul 17, 2015 at 12:28 PM Robert Davidson 
robert.david...@nominum.com wrote:

 When collecting virtual resources, is there a way to override them to
 *remove* specific attributes?

 For example, I have a set of service definitions with requires, and I want
 to collect them without those. (It's rather more complicated than that, but
 illustrates what I want to do.) Is this even possible? I haven't found a
 way yet.

 --
 Robert Davidson

 --
 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/1EE73329D6577F44A3C2FB0F7D4ACAE98CF32299%40mbx-02
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGAb9PKPvup%2BSDLMVdSKkxibRUnNJ6Ktzr12_1Qy36er0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Modul postgresql cannot handle negative value when writing config files

2015-07-16 Thread Hunter Haugen
On Wed, Jul 15, 2015 at 11:36 PM rbrinkm...@nicos-ag.com wrote:

 Hi,

 thanks for your feedback. I provided some more information, unfortunately
 the suggested quoting did not work.


Oh, I wouldn't recommend quoting numbers; just strings.



 installed software
 ##
 facter 2.4.1-1
 hiera  1.3.4-1
 puppet 3.7.5-1
 puppet-common  3.7.5-1

 scenarios
 #

 1 - values in quotes
 
 postgresql::server::config_entry { 'max_standby_archive_delay':  value =
 '-1'}


 result
 --
 postgresql.conf contains value in quotes:
 ...
 max_standby_streaming_delay = '-1'
 ...


 2 - values without quotes
 =
 postgresql::server::config_entry { 'max_standby_archive_delay':  value =
 -1}


 result
 --
 puppet run fails:

 Error:
 /Stage[main]/Main/Node[puppet02-node1]/Postgresql::Server::Config_entry[max_standby_archive_delay]/Postgresql_conf[max_standby_archive_delay]:
 Could not evaluate: undefined method `match' for -1:Fixnum


Thanks for this. It's probably coming from this line
https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/lib/puppet/provider/postgresql_conf/parsed.rb#L26
but without --trace I can't be sure. Most likely that can just be moved
into the conditional logic when the provider checks for Fixnum and it could
work.




 3 - alternative quotes
 ==
 postgresql::server::config_entry { 'max_standby_archive_delay':  'value =
 -1'}

 result
 --
 puppet run fails:

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Could not parse for environment production: Syntax error at 'value = -1';
 expected '}' at
 /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on
 node puppet02-node1
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run

 4 - alternative quotes2
 ===
 postgresql::server::config_entry { 'max_standby_archive_delay':  `value =
 -1`}

 result
 --
 puppet run fails:

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
 Could not parse for environment production: Could not match `value at
 /etc/puppet/environments/production/manifests/nodes/puppet02-node1.pp:16 on
 node puppet02-node1
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run


  --
 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/af5f4724-a599-4151-a3c4-adb0488451a2%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/af5f4724-a599-4151-a3c4-adb0488451a2%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGAXduqsnCQUT3xriFr2JAwrh%3DHOeU0MTNwhTnqHhh1q-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error: undefined method `' for :undef:Symbol at line of one of my modules

2015-07-16 Thread Hunter Haugen
On Thu, Jul 16, 2015 at 11:21 AM Fabien Delpierre 
fabien.delpie...@gmail.com wrote:

 Hi folks,
 First off, let me underline that I'm completely new to Puppet. I'm an
 intermediate Chef user but just changed jobs, and the new place is a Puppet
 shop and I've never touched Puppet in my life. I have not had time to
 acclimatize to it at all, but today my coworker asked me to make some
 changes to running servers. Gotta start somewhere. My being a newbie also
 means I'm not sure what information to give you but I'll try my best.

 In addition, we use Vagrant for local testing before pushing to servers,
 this is where the trouble occurs -- during Vagrant provisioning.
 We're using this box:
 http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box
 (CentOS 6.4)
 As far as I can tell, it ships with Puppet 3.1.1.


Ooo, old.


 The host computer -- my laptop -- is OS X 10.10.4, if it matters, and I'm
 using VirtualBox 5.0.
 Also using the following Vagrant plugins: vagrant-cachier 1.2.1,
 vagrant-librarian-puppet 0.7.1 and vagrant-share 1.1.3.
 Right now I can't use a newer version of the librarian plugin because it
 causes another, completely unrelated error. 0.7.1 is the version my
 coworker uses.

 During the Puppet run, I get the following error:
 == centos6: Error: undefined method `' for :undef:Symbol at
 /tmp/vagrant-puppet/modules-0082ff7071bbf237d9411fcd54aae93c/profile/manifests/my_module.pp:29
 on node foo.bar.com

 This is the corresponding chunk of code:

 if $::operatingsystemmajrelease  7 {


A minimal use case shows that if $::operatingsystemmajrelease is undef
(puppet's idea of nil) then this will happen, because you can't compare
undef with comparators. (I include --trace just to show it really is the
puppet manifest `` and not a ruby method ``)

[root@q2xuk1zrzaqpy3f ~]# puppet --version
3.1.1
[root@q2xuk1zrzaqpy3f ~]# puppet apply -e 'if $whatever  5 {}' --trace
Error: undefined method `' for :undef:Symbol at line 1 on node
q2xuk1zrzaqpy3f.delivery.puppetlabs.net
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/comparison_operator.rb:28:in
`send'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/comparison_operator.rb:28:in
`evaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in
`safeevaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/ifstatement.rb:20:in
`evaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in
`safeevaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:25:in
`evaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:20:in
`each'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast/astarray.rb:20:in
`evaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/ast.rb:62:in
`safeevaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/resource/type.rb:136:in
`evaluate_code'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/resource.rb:81:in
`evaluate'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:282:in
`evaluate_main'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:96:in
`compile'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/parser/compiler.rb:29:in
`compile'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:83:in
`compile'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util.rb:184:in
`benchmark'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:81:in
`compile'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/catalog/compiler.rb:41:in
`find'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/indirector/indirection.rb:191:in
`find'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application/apply.rb:204:in
`main'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application/apply.rb:146:in
`run_command'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in
`run'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:456:in
`plugin_hook'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in
`run'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util.rb:504:in
`exit_on_fail'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/application.rb:364:in
`run'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:132:in
`run'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/lib/puppet/util/command_line.rb:86:in
`execute'
/usr/lib/ruby/gems/1.8/gems/puppet-3.1.1/bin/puppet:4

Simple workaround is to check that the variable has a value before
comparing it:

[root@q2xuk1zrzaqpy3f ~]# puppet apply -e 'if $whatever and $whatever  5
{}'
Notice: Finished catalog run in 0.20 seconds


But... $operatingsystemmajrelease is totally a valid fact on centos6 and
facter 1.7.6 that I get when gem installing puppet 3.1.1:

[root@q2xuk1zrzaqpy3f ~]# facter --version
1.7.6
[root@q2xuk1zrzaqpy3f 

Re: [Puppet Users] Modul postgresql cannot handle negative value when writing config files

2015-07-15 Thread Hunter Haugen
The provider does appear to try and handle fixnums to not be quoted
https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/lib/puppet/provider/postgresql_conf/parsed.rb#L20

What version of puppet is this? What errors are you getting with unquoted
-1 values? `value = -1` appears to be the intended way to do this.

On Wed, Jul 15, 2015 at 8:09 AM rbrinkm...@nicos-ag.com wrote:

 Hi,

 I try to setup streaming replication using puppet. I installed the
 official module postgresql and I succeed writing postgresql.conf and
 pg_hba.conf. My problem is I cannot put negtive values in the config files
 although it does make sense, e.g:

 example
 ==
 ...
 postgresql::server::config_entry { 'max_standby_streaming_delay':  value
 = '-1'}
 ...

 A value of -1 indicates to wait forever, but using the module does not
 allow this negative value. When it is in single quotes like above it will
 be in the config file as well. I did not figure out a way to obtain a plain
 -1 without quotes.

 Any idea is appreciated.

 Regards
 Ralf

  --
 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/d8481070-ed3d-4989-b0c9-733998432b17%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/d8481070-ed3d-4989-b0c9-733998432b17%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGAw-mDZRAJi5vH3zaJxZX635LZ_5pr3Jq1JmBTL3zXa8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetLabs Netscaler Module

2015-07-14 Thread Hunter Haugen
That error appears to still be the same thing (ruby barfing on the hash
argument `parent: Puppet::Provider::Netscaler` . I made
https://github.com/puppetlabs/puppetlabs-netscaler/pull/157 to change all
the 1.9 hashes to normal hashes, so you can give that a go and see if it
works.

On Tue, Jul 14, 2015 at 10:41 AM Matthew Ceroni matthewcer...@gmail.com
wrote:

 I upgraded to ruby 2 that is part of Redhat 7. Now upon running I get the
 following error

 http://pastebin.com/RveUf4ca

 Can't autoload puppet/type/netscaler_server.

 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/75cc9da0-cff7-43b8-8502-f2b90cadcee8%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGCrx9D3dW7_FSeGggQFCpPiA4%2B5CpKN8AJLEdSd%3DjDfjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetLabs Netscaler Module

2015-07-13 Thread Hunter Haugen
The module is apparently using ruby =1.9 hash syntax which is not
supported by 1.8
https://github.com/puppetlabs/puppetlabs-netscaler/blob/master/lib/puppet/util/network_device/transport/netscaler.rb#L12

Whoops. You are welcome to send a patch and change all the `url: url` to
`:url = url` etc, or just upgrade your ruby to a non-EOL'd version and it
should work.

On Mon, Jul 13, 2015 at 2:41 PM Matthew Ceroni matthewcer...@gmail.com
wrote:

 I am attempting to use the puppetlabs netscaler module to manage, well a
 Citrix Netscaler :)

 I setup my /etc/puppet/device.conf on the puppet agent that will act as
 the proxy:

 [usc1lb01]
   type netscaler
   url https://nsroot:XX@10.191.2.8/nitro/v1

 As a simple test I set my manifest as follows:

 node 'usc1lb01' {
 netscaler_server [ 'server1':
 ensure = present,
 address = '1.10.1.1',
 }
 }

 I then ran puppet device -v --user=root and received the following error:

 Info: starting applying configuration to usc1lb01 at
 https://10.191.2.8:443/nitro/v1
 Error: Could not run:
 /var/lib/puppet/lib/puppet/util/network_device/transport/netscaler.rb:12:
 syntax error, unexpected ':', expecting ')'
 ...@connection = Faraday.new(url: url, ssl: { verify: false }) ...
   ^
 /var/lib/puppet/lib/puppet/util/network_device/transport/netscaler.rb:12:
 syntax error, unexpected ':', expecting '='
 ...n = Faraday.new(url: url, ssl: { verify: false }) do |builde...
   ^
 /var/lib/puppet/lib/puppet/util/network_device/transport/netscaler.rb:12:
 odd number list for Hash
 ...y.new(url: url, ssl: { verify: false }) do |builder|
   ^
 /var/lib/puppet/lib/puppet/util/network_device/transport/netscaler.rb:13:
 syntax error, unexpected tSYMBEG, expecting kEND
   builder.request :retry, {
^
 /var/lib/puppet/lib/puppet/util/network_device/transport/netscaler.rb:127:
 syntax error, unexpected kEND, expecting $end


 Anyone have success with this module?


  --
 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/CA%2BNsY5icYrZrW4TbYefskUndwSgiZP-PoSiJw9tMH%2BT19t1uzA%40mail.gmail.com
 https://groups.google.com/d/msgid/puppet-users/CA%2BNsY5icYrZrW4TbYefskUndwSgiZP-PoSiJw9tMH%2BT19t1uzA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDGzhc8OwRAK6AqXCdkFMeRyHt64nqa5ZXRcoAwM9vzJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet firewall module and more esoteric rules

2015-07-07 Thread Hunter Haugen
Filed as a bug: https://tickets.puppetlabs.com/browse/MODULES-2197

On Fri, Jul 3, 2015 at 1:14 AM Tom Boland t...@t0mb.net wrote:

 Hi all,

 I've been looking at using the puppet firewall module to define the
 rules on a load balancer/proxy I'm working on.  Unfortunately, I don't
 think it's going to work, unless there's a workaround for the issue I've
 just found.

 I'm looking at implementing the SYNPROXY guidelines in this RedHat article:


 http://rhelblog.redhat.com/2014/04/11/mitigate-tcp-syn-flood-attacks-with-red-hat-enterprise-linux-7-beta/

 I've attempted to implement a rule in iptables, and then use puppet
 resource to reverse engineer it in to puppet, and this is the result:

 $ iptables -t raw -I PREROUTING -i eth0 -p tcp -m tcp --syn --dport 80
 -j CT --notrack
 $ puppet resource firewall
 firewall { '9001 7b01864cb3bb80b99a31bd1e24ec43e9':
ensure = 'present',
chain  = '80',
checksum_fill  = 'false',
clamp_mss_to_pmtu  = 'false',
dport  = ['CT'],
iniface= '--tcp-flags',
isfragment = 'false',
jump   = '--notrack',
kernel_timezone= 'false',
physdev_is_bridged = 'false',
proto  = 'FIN,SYN,RST,ACK SYN',
random = 'false',
rdest  = 'false',
reap   = 'false',
rsource= 'false',
rttl   = 'false',
socket = 'false',
table  = 'raw',
time_contiguous= 'false',
 }

 As you may see, the parameters are a bit jumbled.  The chain has the
 value for the port, and the dport has the value for the jump, the
 protocol has various TCP packet types rather than just 'tcp' etc etc.

 Would anyone be able to suggest a way around this?

 For the moment I'll look in to stopping the module purging existing
 rules and manage my SYNPROXY stuff outside of puppet.

 Many thanks.  Tom.

 --
 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/5596445F.406%40t0mb.net.
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDMhUQCNTAtZbcpvLkyj--HxeZMGjWBC%2BeXuuAPmiXp-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How do modules plan on dealing with Puppet 3.x incompatibilities?

2015-06-30 Thread Hunter Haugen
On Tue, Jun 30, 2015 at 7:51 AM Alessandro Franceschi a...@lab42.it wrote:

 This topic is quite actual and interesting also for me.
 I think PuppetLabs is following the first approach, and that's what I'm
 inclined to do.


Yep. The planned approach is to specify puppet 4.x (or whatever) in the
metadata.json puppet requirement and major bump for semver.

We obviously can't just put a case statement around puppet-4 parser
language, because the 3x parser will still barf on it even if the code
paths would not be executed.

I would like to note that for functions/types/providers, we CAN get away
with having conditionals on Puppet.version.to_f = 4.0 as Ruby is Ruby and
only the puppet APIs change between versions.

If it's well documented, metadata is correctly configured and SemVer has
 been explicitly followed, users should cope with it.

 my2c
 al

 On Tuesday, June 30, 2015 at 4:10:22 PM UTC+2, Tom Limoncelli wrote:

 Suppose I maintain a public module.  I'd like to start using some
 Puppet 4.x language features. This means that anyone that uses this
 module can't use the new version of the module until they also adopt
 Puppet 4.x.

 What is the best way to address this?

 Some ideas that have been tossed around internally on my team:

 -- Increment the major version number and declare that 3.x users
 shouldn't upgrade to the new major version.
 -- Restrict our usage of the new features to ones that are compatible
 with the future parser and assume that 3.x users will enable the
 future parser. (This means more testing for us, which is difficult
 since we don't want to maintain a Puppet 3.x master any in the
 future.)
 -- Change the name of the module and encourage Puppet 4.x users to
 switch to the module name when they want the more advanced features.
 (this seems like the worst option)

 I'm sure there are other options that we haven't thought of too.

 Is there a recommended process?

 Thanks,
 Tom

 --

 Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com

 Skype: YesThatTom
 Blog:  http://EverythingSysadmin.com

  --
 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/d53e9db1-1e11-49ba-88a1-f7e63fc4c73f%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/d53e9db1-1e11-49ba-88a1-f7e63fc4c73f%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDq0rM0y6Ps5hCYNve0s_T-G%3DH8pq5Z5LFWsyxD6VpFrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Upgrading from 0.25.1 to 3.7.4

2015-04-01 Thread Hunter Haugen
Wow, that's a pretty big jump :).

It's not super terribly helpful, but each node should have a classfile
that is often in the $vardir/classes.txt or $statedir/classes.txt that
contains all the classes a node has applied to it in the last puppet run. I
think `puppetd --configprint classfile` on a node will mention where it is.



-Hunter

On Wed, Apr 1, 2015 at 8:17 AM, James Perry jjperr...@gmail.com wrote:

 I have been tasked to upgrade puppet 0.25.1 to 3.7.4.  There has been a
 lot of past admins tweaking this puppet server and most of the existing
 modules are all ad-hoc creations. I want to ensure I do not miss any
 expected dependencies, but I also do not have months to manually traverse
 the entire Puppet site.pp file by hand.

 Is there some tool, script or puppet command that will show me a quick
 digestion for each node as to what modules it includes and inherits?

 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/1971bf52-6c44-4b96-80fb-72c9dc096355%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/1971bf52-6c44-4b96-80fb-72c9dc096355%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGA6KZJvGv0kaD-XN7W3bTFe1CdQC8SNHDj_sLegXyHgOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Installing hiera-eyaml-gpg in Puppetserver

2015-03-12 Thread Hunter Haugen
For those following along at home, 0.5.rc1 has been pushed to rubygems and
can be installed with `gem install hiera-eyaml-gpg --pre` or `puppetserver
gem install hiera-eyaml-gpg --pre` :D

Thanks raphink!



-Hunter

On Mon, Feb 16, 2015 at 1:54 AM, Raphink raph...@gmail.com wrote:

 For the record, I've decided to port the code to ruby_gpg when running
 inside the Puppetserver.

 The PR is at https://github.com/sihil/hiera-eyaml-gpg/pull/24




 On Thursday, February 12, 2015 at 3:22:48 PM UTC+1, Raphink wrote:

 https://github.com/puppetlabs/puppet-server/blob/master/
 documentation/gems.markdown#gems-with-native-c-extensions apparently
 answers my question, so I'm looking to port hiera-eyaml-gpg to a pure ruby
 module now.

 On Thursday, February 12, 2015 at 12:17:41 PM UTC+1, Raphink wrote:

 Hello,


 I'm trying to use hiera-eyaml-gpg with the puppetserver.

 I've tried installing it with:

 sudo -u puppet puppetserver gem install hiera-eyaml-gpg



 where puppet is the user running the puppetserver.


 However, it fails to compile the native gpgme gem:

 Building native extensions.  This could take a while...
 ERROR:  Error installing hiera-eyaml-gpg:
  ERROR: Failed to build gem native extension.


 java -jar /usr/share/puppetserver/puppet-server-release.jar extconf.
 rb
 Exception in thread main java.lang.IllegalStateException: Unable to
 find bootstrap.cfg file via --bootstrap-config command line argument,
 current working directory, or on classpath
  at puppetlabs.trapperkeeper.bootstrap$find_bootstrap_config.invoke(
 bootstrap.clj:141)
  at puppetlabs.trapperkeeper.core$boot_with_cli_data.invoke(core.clj:113
 )
  at puppetlabs.trapperkeeper.core$run.invoke(core.clj:144)
  at puppetlabs.trapperkeeper.core$main.doInvoke(core.clj:159)
  at clojure.lang.RestFn.invoke(RestFn.java:408)
  at clojure.lang.Var.invoke(Var.java:415)
  at clojure.lang.AFn.applyToHelper(AFn.java:161)
  at clojure.lang.Var.applyTo(Var.java:532)
  at clojure.core$apply.invoke(core.clj:617)
  at puppetlabs.trapperkeeper.main$_main.doInvoke(main.clj:7)
  at clojure.lang.RestFn.applyTo(RestFn.java:137)
  at puppetlabs.trapperkeeper.main.main(Unknown Source)




 Gem files will remain installed in /var/lib/puppet/jruby-gems/gems/gpgme
 -2.0.8 for inspection.
 Results logged to /var/lib/puppet/jruby-gems/gems/gpgme-2.0.8/ext/gpgme/
 gem_make.out


 Is there a way to install native gems inside the Puppetserver to use
 this functionality? What am I missing?


 Cheers,

 Raphaël

  --
 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/2fc439d9-1d47-427d-baa3-3faaed686554%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/2fc439d9-1d47-427d-baa3-3faaed686554%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


-- 
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/CAJaQvGD-zpZopRgQorTMV1dWuZu83Jr%3DsbKVs6_Ky_VwAHREvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] ntp keys - trusted, requestkeys

2015-03-12 Thread Hunter Haugen
It does not currently have a keys_file_content parameter or anything, so
looks like no. You could use an additional file resource to manage that. A
PR to the ntp module to manage the keys would be nice too :)



-Hunter

On Tue, Mar 10, 2015 at 7:44 AM, Robert Poulson robpo...@gmail.com wrote:




  So the ntp.conf should only contain the key identifiers pointing at the
 /etc/ntp.keys which won't be changed by Puppet.


 Okay, it works exactly like this. I misinterpreted the description, one
 has to specify the key identifiers - was misleading but probably it's just
 me.

 So I can't edit the ntp.keys directly from this module?

 Thanks
 Rob

 --
 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/CANwwCtzPPZdZuTUEyEi__Ge%3DUwcazNhXfAQ3VUfUxsVrNUdWfA%40mail.gmail.com
 https://groups.google.com/d/msgid/puppet-users/CANwwCtzPPZdZuTUEyEi__Ge%3DUwcazNhXfAQ3VUfUxsVrNUdWfA%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

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


-- 
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/CAJaQvGDMxjsrRgjj%2BOzRcGAtQTuYZLu1%3DVLf-MffiF7a8Y9LAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Does the Learning VM image actually work?

2015-02-10 Thread Hunter Haugen
A tip on OS X about getting inside folder-app-things (like .app,
.vmwarevm, etc).

You can right click (two finger click) on the object, and select Show
package contents to get into it with Finder. Then you'll be able to see
the PDF.

Or you can `cd` in a terminal into it, and `open .` to open it in finder.



-Hunter

On Tue, Feb 10, 2015 at 10:30 AM, Brad Knowles b...@shub-internet.org
wrote:

 On Feb 10, 2015, at 9:15 AM, Benito Mourelo bmour...@gmail.com wrote:

  Unzip it and rename the resulted directory to attach  the .vmwarevm
 extension and then open it.

 Ahh.  That was the thing I was missing from the instructions.

 BTW, I discovered that you probably want to pull the PDF file out of the
 extracted archive directory before you rename it, otherwise it will be a
 bit painful to refer back to the PDF if/when you want.  ;)

  It works for me on OS X 10.10 Yosemite.

 Working through it now.  Thanks again!

 --
 Brad Knowles b...@shub-internet.org
 LinkedIn Profile: http://tinyurl.com/y8kpxu

 --
 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/FB8B6B58-A786-4D16-A516-1E6A6CBA0E32%40shub-internet.org
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDk-fTnU9PZoiaXat7UAM9qCuk1jXBf1%2BPNTxVGyL66PQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Announce: Puppet Language Style Guide 2.0

2015-02-04 Thread Hunter Haugen

 == Section 10.7 Defines can't use inherits for parameter defaults
 Should this be reduced to only cover classes, or should the description
 be expanded to cover the style of setting defined resource defaults also?
 (Which happen to be the bad example; whoops.)



 The guide's preferred form works for defined types, too, provided the
 default values are static (but then why would you even consider the other
 style?).  On the other hand, the guide's preferred style does not work even
 for classes when a parameter's default value needs to be computed from the
 actual values of other parameters.   I think the guideline should be
 softened to a recommendation, its applicability narrowed to classes only,
 and the example labels changed from GOOD and BAD to something like
 Preferred and Discouraged.  The non-applicability to defined types
 should be explicitly called out, for clarity.


Okay.


 == Section 11.2 Recommendation against using include is unclear or
 harmful
 I think this was to describe how an over-zealous use of `include` may
 cause classes to be declared with the default parameters before a user may
 declare them with parameters. Or it could have been about cross-module
 class inclusion in public modules. What should we do with this section?



 I don't think there is any over-zealousness problem associated with using
 'include', unless it is with respect to declaring classes that are not
 directly required in the scope of the declaration.  Needed classes
 *should* be declared, and that generally should be done via an 'include',
 'require', or 'contain' call.  (And note, too, that 'contain' and 'require'
 have all the same declaration semantics as 'include', but the current text
 ignores them.)

 In fact, I think the guide is almost exactly backward on this matter.  The
 style points that should be recommended are:

- Classes and defined types should declare the classes on which they
rely
- Data should generally be bound to classes via Puppet's Hiera-based
automatic data-binding facility, instead of via resource-style class
declarations.  In particular,
- In modules, the resource style should *never* be be used to declare
   *public* classes of that or any other module.
   - Everywhere, the 'include', 'require', and / or 'contain'
   functions should be used instead of resource-style class declarations 
 if at
   all possible.

 All that can be well justified based on Puppet's design and
 implementation, though I grant that if at all possible is pretty
 wishy-washy.  I'd go further with a style guide for my own site, but the
 things I'd add would be a bit more controversial.


Well put :). Re-reading this section makes me think that it was
historically about the declare variables then include classes pattern
that parameterized classes were created to obviate, but got mashed together
with a design pattern for cross-module class inclusion like in a game of
telephone. The whole non-deterministic scoping thing is probably
irrelevant at this point.


 == Section 10.4 Chaining arrow syntax with only references, not
 declarations
 Agreed. And perhaps that if there are line breaks around arrow syntax,
 they must only happen to the right of the arrow and not the left so that
 arrows are not hidden at the end of previous lines.



 I'm missing it: how does allowing line breaks only to the *right* of a
 chain operator prevent it from being hidden at the end of a line?
 Shouldn't that be left?


Whoops yes, to the left of the arrow. Perhaps I was thinking with the
arrow to the right of the linebreak when I wrote that. IE,
https://github.com/puppetlabs/puppetlabs-mysql/blob/3.1.0/manifests/server.pp#L64-L72
is a bad example as the linebreaks are on the right of the arrow :).

But anyway... V



 Chaining resource declarations doesn't actually bother me, personally.  I
 won't particularly resist the style guide discouraging that, but I'd be at
 least as well satisfied by a softer guideline.  For example, a chain
 operator should appear on the same line as its right-hand operand.  Or the
 still-softer a chain operator should appear either on the same line as its
 right-hand operand or on a line by itself.


I like this more than talking about left/right linebreaks.

== Section 12.1 $unique_name = $name is unclear
 I believe this was to describe how the continued use of $name throughout
 a define can lead to confusion, as $name has no strong semantic meaning.
 Thus a good example would be https://github.com/puppetlabs/
 puppetlabs-apache/blob/1.2.0/manifests/listen.pp#L2 and a bad example
 would be... https://github.com/puppetlabs/puppetlabs-apache/blob/1.2.0/
 manifests/vhost.pp (because $name is scattered throughout the define and
 has no definite meaning).



 I don't think unique_name has any more or less clear of a meaning in
 such contexts than does name.  Any lack of clarity is about which entity
 the name belongs to, and describing it as unique doesn't really help 

Re: [Puppet Users] Re: Announce: Puppet Language Style Guide 2.0

2015-02-03 Thread Hunter Haugen
tl;dr Summarizing the feedback from Garrett, Trevor, and John (because
email is hard), and see if we have resolution on some points and which ones
we still need to clarify.



= Questions:
These need further discussion and clarification.

== Section 10.7 Defines can't use inherits for parameter defaults
Should this be reduced to only cover classes, or should the description be
expanded to cover the style of setting defined resource defaults also?
(Which happen to be the bad example; whoops.)

== Section 11.2 Recommendation against using include is unclear or harmful
I think this was to describe how an over-zealous use of `include` may cause
classes to be declared with the default parameters before a user may
declare them with parameters. Or it could have been about cross-module
class inclusion in public modules. What should we do with this section?



= Proposals:
If the below changes sound good, then we'll go with that.

== Section 5 line length is an issue
Managing line lengths in puppet is difficult. This point should change to
describe where to do syntax-wise linebreak rather than character-wise
breaks (ie, any hashes containing more than a single key/value pair, etc.).

== Section 9.6 symbolic modes
This was answered in that symbolic modes can perform operations that
numeric modes cannot. The style guide does not dictate which form to use,
so this should not be an issue.

== Section 10.6 No required class parameters
Some classes just MUST have required parameters and there is no way around
it. The style guide should be modified to include should minimize the
number of required parameters as a style recommendation.

== Section 10.2 item 7, resource ordering alphabetically
Remove the mention of ordering so that it is simply Should declare
resources. This also impacts section 9.4 and should be reconciled.

== Section 10.2 includes vs validation first
Validation cannot come at the end of the file due to parse order, but it is
possible to allow includes to come before validation, so we should just not
dictate this bit of ordering.

(This issue will go away entirely after the release of puppet 4, as
validation may happen inline with the parameters themselves due to the
typing system.)

== Section 10.2 Unclear description of items 7  8
I'm not exactly sure what this is describing either. Most likely
superfluous and will be removed.

== Section 10.4 Chaining arrow syntax with only references, not declarations
Agreed. And perhaps that if there are line breaks around arrow syntax, they
must only happen to the right of the arrow and not the left so that arrows
are not hidden at the end of previous lines.

== Section 12.1 $unique_name = $name is unclear
I believe this was to describe how the continued use of $name throughout a
define can lead to confusion, as $name has no strong semantic meaning. Thus
a good example would be
https://github.com/puppetlabs/puppetlabs-apache/blob/1.2.0/manifests/listen.pp#L2
and a bad example would be...
https://github.com/puppetlabs/puppetlabs-apache/blob/1.2.0/manifests/vhost.pp
(because $name is scattered throughout the define and has no definite
meaning).

== Section 18 Parameter ordering unclear
The paragraph about ordering should be moved to 10.6 or removed altogether.

== Section 19 should be moved to Section 2
Because if becoming a specification for puppet-lint is a purpose, then
section 2 is best.

== Style guide vs specification discussion from jcbollinger
To paraphrase, the 'language style guide' is written as a technical
specification covering more than the language; it covers module structure
and module contribution conduct. This is not 'style' and is beyond the
scope of this document.

In answer... we should change the title to something other than The Puppet
Language Style Guide :). I personally feel that Module Style Guide would
still encompass what is included here, when the above edits are taken into
account.

== JCB's issues with guide text
These seem fairly straightforward. Thanks.





-Hunter

On Tue, Feb 3, 2015 at 8:54 AM, jcbollinger john.bollin...@stjude.org
wrote:



 On Monday, February 2, 2015 at 12:21:40 PM UTC-6, Lauren R wrote:

 The Modules team and I are excited to finally announce the newest version
 of the Puppet Language Style Guide.

 We've reworked the guide to reflect the new features and capabilities of
 Puppet 3.7, and we've expanded it to cover more topics related to building
 manifests and modules. If you're interested in publishing a module to the
 Puppet Forge or are looking to get your module Puppet Approved, the
 updated guide is a great place to start.

 It was a massive, company-wide effort to update this style guide, but I'm
 sure we didn't catch everything. If you notice a mistake or would like more
 information on something that's not currently covered, please file a
 ticket. We plan to regularly update the guide from here on out, and we
 definitely anticipate another big release in the months after Puppet 4
 comes out.



 I'm 

Re: [Puppet Users] Re: Ordering dependencies and accessing state created earlier *in the same run*

2015-01-28 Thread Hunter Haugen
The way to think about getting commands to run during the apply phase is
either by using exec resource (which basically don't have a return value so
don't allow you to access the data you want) or with providers.

In your example, if you wrote a custom notify provider, then instead of
using the generate() method you could have the new provider run the `id`
command as part of its functionality, and that could be used in the output.
The user resource would be evaluated - the user resource provider would
create the user - the notify would be evaluated - the notify provider
would run `id` and print the id of the user.

The openstack world makes heavy use of custom types  providers for this
reason, and I can highly recommend O'Reilly's Puppet Types and Providers
book to get started.



-Hunter

On Tue, Jan 27, 2015 at 10:47 PM, Giovanni Torres git...@gmail.com wrote:



 On Monday, January 26, 2015 at 4:31:39 PM UTC+2, jcbollinger wrote:

  [snip]


 I see three main alternatives:

 1) Use custom facts to determine the chosen UIDs, and accept that it will
 take two runs for your configuration to converge.

 2) Use an Exec resource around a custom script to manage [the relevant
 part of] your auditd configuration.

 3) Pre-assign the needed UIDs.

 A few additional words about (3):
 o As a threshold issue, any ability to pre-assign UIDs depends on having
 a reserved range of UIDs on which you can draw.  It is conventional on
 Linux for the lowest-number UIDs (up to 99 or sometimes 499) to be reserved
 for system accounts, which is a reasonable characterization of the accounts
 in question, so perhaps you can choose UIDs there.
 o Having chosen UIDs, you would use Puppet to manage the corresponding
 users.  Ensure that each user is managed *before* the corresponding
 package, at least when you are ensuring the package present.  In all
 likelihood, the packages will not create a new account if a suitably-named
 one already exists.
 o Do test out this approach manually (i.e. that the packages are willing
 to use an existing account) before writing Puppet code around it, just to
 be sure.


 Thank you John. It is a master-less setup, I forgot to mention. This
 clarifies several misunderstandings I had.

 Giovanni

 --
 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/fb03058b-ec59-42d8-9d41-29046b91329b%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/fb03058b-ec59-42d8-9d41-29046b91329b%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


-- 
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/CAJaQvGBxtV_OdedNX4oku33gbv1pmpJeJgqhtoxfV3Pvek3a9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to solve $concat_basedir not defined error?

2014-12-12 Thread Hunter Haugen
The concat_basedir custom fact comes from the concat module
https://forge.puppetlabs.com/puppetlabs/concat so on the agent, if you can
run `facter concat_basedir` then puppet should be able to pick it up.

It looks like you do have the concat module installed at
/etc/puppet/modules/concat, and if you have pluginsync turned on (which is
on by default, fwiw) then I'm not really sure what could be the hang-up.

What does running `puppet plugin download` on the agent do? Does it fix the
issue?



-Hunter

On Fri, Dec 12, 2014 at 2:24 AM, Haani Niyaz haani.ni...@gmail.com wrote:

 Hi there,

 I'm fairly new to puppet I am attempting to setup a dashboard for
 puppetdb. I came across puppetexplorer and wanted to trial it out.

 I attempted to install puppetexplorer  by doing the following:

 puppet module install spotify-puppetexplorer


 #Added puppetexplorer to my puppet node declaration


 node 'puppet' {
   include 'puppetexplorer'
 }



 On running the agent on the master to install puppetexplorer I get the
 following error (running it as root):




 Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
 $concat_basedir not defined. Try running again with pluginsync=true on
 the [master] and/or [main] section of your node's '/etc/puppet/puppet.conf'.
 at /etc/puppet/modules/concat/manifests/setup.pp:20 on node
 puppet.example.com



 I already tried setting pluginsync=true and however it does not make a
 difference. Can someone hint at what might be the problem?

 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/30b064e2-c85b-42fe-b2e2-e0a2324cd3fd%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/30b064e2-c85b-42fe-b2e2-e0a2324cd3fd%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDnUcUZPCi9p6tc5RDqbAyZcSVbD1aFbCgDmE-xb3NXPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs/firewall and firewalld

2014-11-10 Thread Hunter Haugen
Unfortunately we (the puppetlabs module team) haven't yet started on the
initiative to make this happen, but it has definitely been on our minds for
a long while now.

I made https://tickets.puppetlabs.com/browse/MODULES-1498 really quickly to
begin tracking this work though; as of yet there is no estimation for
completion.

If you know any authors of an awesome firewalld module with whom we could
work, make sure to point them our way!



-Hunter

On Fri, Nov 7, 2014 at 6:06 AM, Gary Jackson bar...@gmail.com wrote:

 Are there any plans to support firewalld with puppetlabs/firewall? If so,
 when would we expect to see that materialize?

 --
 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/c76b2477-8ab3-4ab1-ac13-9c94a4a83f47%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/c76b2477-8ab3-4ab1-ac13-9c94a4a83f47%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGC6jjSLtxj78_uVH%2Bf8OKQbQUuwByDYRhKdTZCgXsJgeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Moving to Directory Environments

2014-10-04 Thread Hunter Haugen
On Saturday, October 4, 2014, Felix Frank felix.fr...@alumni.tu-berlin.de
wrote:

 Hi,

 On 10/04/2014 11:11 AM, Rachel Andrew wrote:
 
  I've created environments/production/modules and
  environments/production/manifests
 
  I believe I can just set default_manifest in my puppet.conf on the
  puppetmaster to /etc/puppet/manifests and then all environments will
  continue to use that (I want to have some dev nodes talking to this
  puppetmaster soon but I'll just get it all working first)


If you set default_manifest to /etc/puppet/manifests then it will ignore
/etc/puppet/environments/production/manifests. One or the other, but not
both.

If you set environmentpath = /etc/puppet/environments and don't set
default_manifest, the manifests directory from the environment directory
will be read.


 You mean manifest I assume - default_manifest is not an available
 option.


default_manifest is new in 3.7 and defaults to ./manifests for use with
directory environments.


 You should set it to '/path/to/environments/production/manifests'. And
 no, this is not used for each environment. It is used for production
 only. With directory environments, I suppose it's not used at all when
 there is a production tree among your environment directories.

 Before switching to directory environments, set

 manifest = /path/to/environments/production/manifests
 modulepath = /path/to/environments/production/modules

 and remove those settings once directory environments take effect.

  If I have done the above do I need anything in the
  production/manifests directory or will it simply default to using that
  specified as default_manifest?

 All manifest files that are not found by the autoloader through
 declaration of classes or defined types should be placed directly in
 your manifests directory (i.e., files that needed an import statement
 earlier).

  Having then set a default_manifest which is a directory can I just
  remove the import and these files will be compiled together? I can see
  best practice would be to use an ENC, which I may explore but as a
  small infrastructure I'd just like to make the transition in small steps.


Yep. Set default_manifest to a directory and it will read all manifests
from there. No need for imports.


 ENC is best practice? That would be news to me. It's perfectly valid to
 omit a node classifier.

 Just make sure all unmodularizable code is in the manifest directory, yes.

 HTH,
 Felix

 --
 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 javascript:;.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/54309C29.2080205%40Alumni.TU-Berlin.de
 .
 For more options, visit https://groups.google.com/d/optout.



-- 


-Hunter

-- 
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/CAJaQvGCcjaJ3HaKR-DE4kBUru20z8v3zD37ef70zo-KALSTAgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs-* forge modules and 'parser = future'

2014-09-29 Thread Hunter Haugen
On Thu, Sep 18, 2014 at 2:16 PM, Tim Skirvin tskir...@fnal.gov wrote:

 I decided to try out 'parser = future' today, and the first thing
 to fail was puppetlabs-apache, with errors along the lines of:

 Filepath:
 /srv/puppet/env/puppet/modules/apache/templates/httpd.conf.erb
 Line: 19
 Detail: comparison of Float with String failed

 There's already a bug report for this[1], but that's not really
 my point.  I'm curious as to the larger questions - when are the modules
 supported by PuppetLabs in the Forge going to be ready for use with the
 future parser?  And, when these modules are ready, how will we know?  Will
 it be listed as compatible with 4.0.0?


The feature for supporting unit testing with the future parser was added to
puppetlabs_spec_helper in 0.6.0
https://github.com/puppetlabs/puppetlabs_spec_helper/blob/master/CHANGELOG#L36
in preparation for this.

We actually have a load of tickets in our next sprint to enable future
parser testing on all of the supported modules and go through making them
compatible, starting Oct 1st. Good timing on your question, bad timing that
it's taken us this long to get to it :(.



 And until this is ready, is 'parser = future' doing much good?

 - Tim Skirvin (tskir...@fnal.gov)
 --
 HPC Systems Administrator / Developer
 http://www.linkedin.com/in/tskirvin
USCMS-T1 Collaboration   Fermilab Scientific Computing

 [1] https://tickets.puppetlabs.com/browse/MODULES-910


-- 
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/CAJaQvGBY2zNyc-NFL4rjd2mRHozTt5QBSwbDA59-hg7HJusqVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs-apache n00b question - docroot value for fully proxied virtual host?

2014-09-17 Thread Hunter Haugen
Yeah, basically `$docroot` is still a required parameter because
historically it was required (apache::vhost didn't do proxy stuff) and was
never updated. If you want to make a PR that makes it default to `undef`
and then raises helpful errors in cases when it is needed, then that would
be great :).



-Hunter

On Tue, Sep 16, 2014 at 4:49 AM, Antoine Cotten tonio.cot...@gmail.com
wrote:

 Unfortunately you can't. This is a restriction of Apache, which requires a
 docroot value for every vhost, and not of Puppet.

 --
 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/8c6a00ee-3cb6-4193-936a-6acc771142ba%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDqJ%2BLnPmcXcz5Uv5iFgK63RawwVo8sdTr%2BX%3DQcVguiBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] rspec-puppet and testing custom facts

2014-09-02 Thread Hunter Haugen
On Tue, Sep 2, 2014 at 10:48 AM, Brett Swift brettsw...@gmail.com wrote:


 rspec-puppet supports classes, functions, defined types, but not facts.


 spec
  |
   - classses
   - defines
   - facts? ?  ? ??  ?


 Is there a recommended way to test facts?


You don't actually need any of the helpers in rspec-puppet to test facts
with rspec.

In rspec, you would stub any facts that are required but not under test
with `allow(Facter.fact(:osfamily)).to
receive(:value).and_return(fakeosfamily)`, then stub any commands that
the fact that you're testing with `expect(Facter::Util::Resolution).to
receive(:exec).with(some command here).and_return(out that the command
would return)`

Then you can call `expect(Facter.fact(:myfact).value).to eq(factvalue)`

Eg, testing the root_home fact in stdlib:
https://github.com/puppetlabs/puppetlabs-stdlib/blob/master/spec/unit/facter/root_home_spec.rb#L34-L50



 I've seen a few examples, but they seem hacky, and I have a feeling this
 should be or is available from puppet modules.

 http://unethicalblogger.com/2014/03/01/testing-custom-facts-with-rspec.html

  -- requires re-writing every fact.  Not super keen on doing that if I
 don't have to.


 github.com/vStone/puppet-testing-example
 --  seems to work at first, but then when I change an expectation from
 false to true,  it still passes. This is 2 years old and the version of
 rspec isn't locked down in the gemfile, so it may not even be valid with
 the latest version.


 Does anyone have a working solution?  Maybe my google-fu isn't very good..
  there has to be something out there that works?





  --
 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/e55b7789-ea18-4440-933b-efa1e5bc3263%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/e55b7789-ea18-4440-933b-efa1e5bc3263%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDj3Vf0LaVR2Q9c6PtUeYDHgzAp6%2B9T5C8mh46sQF7fSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs-mysql

2014-07-23 Thread Hunter Haugen
The module is trying to read the cached password from /root/.my.cnf to
connect, and since it's empty it tries with no password. (See
https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/server/root_password.pp#L7-L19
for what puppet is doing with the root_password).

You could create the file /root/.my.cnf with the contents of
https://github.com/puppetlabs/puppetlabs-mysql/blob/master/templates/my.cnf.pass.erb
but just add your own info, then it should work and puppet should be able
to manage it from there :).



-Hunter


On Wed, Jul 23, 2014 at 10:07 AM, David Kindle david.m.kin...@gmail.com
wrote:

 based on the below script - My mysql instance has a password of foo
 already.   I want this script to use my root password to create a new db
 and assign a user with privileges to that db.

 What is wrong with this code?  Is this trying to SET the root pass vs just
 using it to execute the commands?

 the way this is it throws the error Access denied for user 'root'@'localhost'
 (using password: NO)

 any help greatly appreciated


 class {'mysql::server':
 root_password = 'foo',
 }

   #creates a sample db with user with correct permissions -spade
   mysql::db { $dbName:
   user = $dbUser,
   password = $dbPass,
   host = 'localhost',
   grant= ['SELECT', 'INSERT', 'UPDATE', 'CREATE', 'DELETE'],
 }

 --
 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/c11bfb37-2621-4662-9a1e-ece61c8023fe%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/c11bfb37-2621-4662-9a1e-ece61c8023fe%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGA6MsEojAdPMNSnGJAh6%3DVbp8esN6qETV36RHaCo-3teg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetlabs-corosync help using multiple primitive operations

2014-07-22 Thread Hunter Haugen
On Tue, Jul 22, 2014 at 9:16 AM, willi.feh...@home24.de wrote:

 Hi Trey,

 I'm using Hiera and changed now:

 p_drbd_jira:
   primitive_class:  ocf
   primitive_type:   drbd
   provided_by:  linbit
   parameters:
 drbd_resource:  jira
   operations:
 monitor:
   - {interval:  '10s', role:  'Master'}
   - {interval:  '20s', role:  'Slave'}

 puppet agent -t --debug:
 Error:
 /Stage[main]/H24-corosync::Config/H24-corosync::Resource[primitive]/Cs_primitive[p_drbd_jira]:
 Could not evaluate: undefined method `each_pair' for
 #Array:0x00037c9a68

 My class to get the data from Hiera:

 class h24-corosync::config {

 $config = hiera('h24-corosync::config',
 {
 property = {},
 primitive = {},
 colocation = {},
 order = {},
 group = {}
 })
 h24-corosync::resource { 'property':
 params = $config[property],
 defaults = {ensure = present}
 } -
 h24-corosync::resource { 'primitive':
 params = $config[primitive],
 #defaults = {operations = {monitor = { 'interval' = '30s' }}}
 } -
 h24-corosync::resource { 'group':
 params = $config[group]
 } -
 h24-corosync::resource { 'colocation':
 params = $config[colocation]
 } -
 h24-corosync::resource { 'order':
 params = $config[order]
 }

 }

 Which code do I have to change?


You will have to update the provider code at
https://github.com/puppetlabs/puppetlabs-corosync/tree/master/lib/puppet/provider/cs_primitive
to support array values of the cs_primitive operations hash. If you take
the time to do this and send a pull request on github, that would be great
:).



 Regards - Willi

 --
 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/00d52bf6-835d-47ca-9e71-6b569f78d89b%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/00d52bf6-835d-47ca-9e71-6b569f78d89b%40googlegroups.com?utm_medium=emailutm_source=footer
 .

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


-- 
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/CAJaQvGBfL_sSZXDNpp%3DRc33udax5ynh7AOShbdFoez%3DgetroYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: puppetlabs-corosync help using multiple primitive operations

2014-07-21 Thread Hunter Haugen
Reading through the type/provider code, it looks like it is not coded in a
way to deal with entries with duplicate keys, and I don't see any open pull
requests to deal with this either. The puppetlabs-corosync module is not
currently under active development from the PL module team yet, though we
are getting nearer to it as we work through our list. (And will be happy to
merge any quality PRs that you find necessary.)

Any pull requests to refactor it would be welcome! One potential
backwards-compatible way to implement this would be for the providers to
check for arrays of values of any operations hash entry, and create one
entry per hash in the array. Such as:

  operations  = {
'monitor' = [
  {
'interval'  = '29',
'role'  = 'Master',
  },
  {
'interval'  = '31',
'role'  = 'Slave',
  }
]
  },

It should continue to work as before if the value is not an array.

-Hunter


On Mon, Jul 21, 2014 at 8:41 AM, willi.feh...@home24.de wrote:

 I have the same problem.

 Am Sonntag, 24. Juni 2012 01:06:17 UTC+2 schrieb treydock:

 Setting up a HA iSCSI / NFS target using this document,
 http://www.linbit.com/fileadmin/tech-guides/ha-iscsi.pdf, and I am
 unable to find a way to use the puppetlabs-corosync module to emulate this
 command

 crm(live)configure# primitive p_drbd_coraid23 ocf:linbit:drbd \
  params drbd_resource=coraid23 \
  op monitor interval=29 role=Master \
  op monitor interval=31 role=Slave
 crm(live)configure# ms ms_drbd_coraid23 p_drbd_coraid23 \
  meta master-max=1 master-node-max=1 \
  clone-max=2 clone-node-max=1 notify=true

 I defined the cs_primitive type like this...


   cs_primitive {
 'p_drbd_coraid23':
   ensure= present,
   primitive_class = 'ocf',
   primitive_type  = 'drbd',
   provided_by = 'linbit',
   promotable  = true,
   parameters  = {
 'drbd_resource' = 'coraid23'
   },
   operations  = {
 'monitor' = {
   'interval'  = '29',
   'role'  = 'Master',
 },
 'monitor' = {
   'interval'  = '31',
   'role'  = 'Slave',
 }
   },
   metadata= {
 'master-max'  = '1',
 'master-node-max' = '1',
 'clone-max'   = '2',
 'clone-node-max'  = '1',
 'notify'  = 'true',
   };


 What results is only 1 of the 2 operations being defined, and my guess is
 that this is because of logic like this...

 operations = {}
 operations['monitor'] = a
 operations['monitor'] = b

 puts operations['monitor']
 = b

 Any suggestions?

 Thanks
 - Trey

  --
 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/8065d250-39f4-4ede-a3e9-4926fd738a2c%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/8065d250-39f4-4ede-a3e9-4926fd738a2c%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGCoHB%3D%3D-wjLe32rZF%2BJhnBWNx8skj8FFSYgyJz2NMex0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet-postgres error

2014-07-15 Thread Hunter Haugen
The validate_db_connection would come from
https://github.com/puppetlabs/puppetlabs-postgresql#resource-postgresqlvalidate_db_connection
which is declared by the postgresql::server - postgresql::server::service
class
https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/server/service.pp#L29
. The exec is
https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/validate_db_connection.pp#L51

So it appears that the service tries to start but isn't accepting
connections via the psql command? There isn't enough information in the
pasted errors to tell why though. One thing that is weird is the -h  -U
 -p   arguments with double spaces, indicating that a
hostname/user/password is blan, so that might be why (even though this code
is supposed to guard against it
https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/validate_db_connection.pp#L23-L34
).

What version of puppetlabs-postgresql is this?





-Hunter


On Tue, Jul 15, 2014 at 1:41 PM, Felix Frank 
felix.fr...@alumni.tu-berlin.de wrote:

  Hi,

 it would be helpful to see the manifest that declares the Exec[validate
 postgres connection for /postgres].

 For debugging, the easiest approach is pasting the failing commands to a
 shell.

 Regards,
 Felix


 On 07/14/2014 08:35 AM, Rajesh Taneja wrote:

 While running puppet agent, I am getting following error. Can someone help
 me understand what might be wrong.

  Warning: Exec[validate postgres connection for
 /postgres](provider=posix): Cannot understand environment setting
 PGPASSWORD=
 Warning: Exec[validate postgres connection for /postgres](provider=posix):
 Cannot understand environment setting PGPASSWORD=
 Notice:
 /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate
 postgres connection for /postgres]/returns: Unable to connect to defined
 database using: /usr/bin/psql --tuples-only --quiet -h  -U  -p  --dbname
 postgres
 Error: echo 'Unable to connect to defined database using: /usr/bin/psql
 --tuples-only --quiet -h  -U  -p  --dbname postgres '  false returned 1
 instead of one of [0]
 Error:
 /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate
 postgres connection for /postgres]/returns: change from notrun to 0 failed:
 echo 'Unable to connect to defined database using: /usr/bin/psql
 --tuples-only --quiet -h  -U  -p  --dbname postgres '  false returned 1
 instead of one of [0]
  --
 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/d4866842-9ae8-4ade-89c9-34aa9e82e074%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/d4866842-9ae8-4ade-89c9-34aa9e82e074%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 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/53C591E8.5060003%40Alumni.TU-Berlin.de
 https://groups.google.com/d/msgid/puppet-users/53C591E8.5060003%40Alumni.TU-Berlin.de?utm_medium=emailutm_source=footer
 .

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


-- 
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/CAJaQvGAU%3DE5Wr-iJ33VowKD5tvi37XwEZxn%3DYnfGDNCq16vV9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] The combined use of Ubuntu and CentOS

2014-07-14 Thread Hunter Haugen
Yep, totally possible. The puppet master daemon is platform-agnostic and
uses the information sent from the agent (via `facter`) to know how to
compile the catalog. So if your ubuntu agents check in, the master daemon
makes ubuntu catalogs. If your centos agents (including the master managing
itself) checks in, then it will have different facts and thus a different
catalog.

Modules are commonly written to handle the different package  service
names across platforms as well as different kinds of configuration defaults
(eg,
https://github.com/puppetlabs/puppetlabs-ntp/blob/master/manifests/params.pp#L42-L78)
and can be run from any master (even AIX masters serving windows agents if
a module is written to support windows :P).



-Hunter


On Mon, Jul 14, 2014 at 2:43 AM, Nevzat erçolak nvz...@gmail.com wrote:

 Hi, I am using puppetmaster on centos 6.5. I want to use puppet agent
 which is installed on ubuntu 12.04. I want to install and configure some
 package on ubuntu 12.04 via using puppet. Is it possible to use different
 operating system between puppetmaster and agents? If it is possible, how
 can I use and configure master and agent? Does anyone know how to use them
 both together?

 Nevzat

 --
 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/be27498f-d4cd-4ffe-b6fa-85f350404aee%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/be27498f-d4cd-4ffe-b6fa-85f350404aee%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGDS4G9qDdW-mQ%2BOW2hfDJobEDpTJ0GnNHAoSF4r1pL-eQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Unit testing reference modules and best practices

2014-07-11 Thread Hunter Haugen
We try hard to use rspec-puppet in effective ways, but you may still see
some over-testing in the supported modules nonetheless :).

We use rspec-puppet to test that:

1. Manifests compile and templates parse (catches a lot of problems)
2. Conditional logic in manifests follows the expected paths for given
inputs (various facts of operatingsystems [4], or various expected
parameter values)
3. Conditional logic in templates actually creates config files as expected
(make sure to have negative tests that throw false/undef in for
validation to avoid blank entries)
4. And recently started testing future parser and strict variables on
our modules (as of puppetlabs_spec_helper 0.6.0).

But what does rspec-puppet not do?

rspec-puppet will obviously NOT indicate when a configuration file's syntax
cannot be understood by the actual service (apache [2], haproxy, sudoers,
etc), that your package names are really correct (mongodb just changed all
of their upstream package names [3]), or when command output from the
system changes with versions (git 1.7 vs 1.9 in vcsrepo) but for those
cases a few beaker-rspec [1] tests should give you extra assurances after
you get rspec-puppet doing the most critical parts. (beaker-rspec is much
slower than rspec-puppet, so we try to limit its use).

[1] https://github.com/puppetlabs/beaker-rspec/
[2]
https://github.com/puppetlabs/puppetlabs-apache/blob/1.1.0/spec/acceptance/mod_php_spec.rb#L56-L96
Example of verifying that php actually works
[3]
https://github.com/puppetlabs/puppetlabs-mongodb/blob/0.8.0/spec/acceptance/server_spec.rb#L45-L58
Example of verifying that packages actually install
[4] https://github.com/apenney/pe_fixtures is an example of a collection of
facts to choose from



-Hunter


On Thu, Jul 10, 2014 at 5:29 PM, Ben Sullivan bensulli...@bensullivan.net
wrote:

 Hi

 I'm looking for some reference modules to share with my team to illustrate
 how to best use rspec-puppet to unit test Puppet DSL code.

 I'm going to go through the Puppet Enterprise supported modules as I
 figured that was a reasonable place to start:
 https://forge.puppetlabs.com/modules?supported=yes

 The team doesn't understand the value of rspec-puppet at present and I
 need to articulate arguments to get some buy-in.  At the moment we rely on
 long-running end to end tests which won't scale for us as our automation
 codebase grows.

 Any tips/recommendations would be appreciated.

 Many thanks

 Ben

 --
 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/36fe87b2-4430-4ab1-8f55-d4d93572942d%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/36fe87b2-4430-4ab1-8f55-d4d93572942d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGBEGedUcv2FZnih5HrdO7L-%2BGvPu4g3VW2ujHrQ2gNkGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error to install java7

2014-07-11 Thread Hunter Haugen
The path it is trying to download is
modulepath/java7/files/jdk-7us-linux-i586.tar.gz . Is this where the file
is located? Are all parent directories executable (and perhaps readable) by
the user which your puppet master runs as? (Usually that user is 'puppet'
or 'pe-puppet'.)



-Hunter


On Fri, Jul 11, 2014 at 2:41 AM, Joni Silaban joni.la...@gmail.com wrote:


 https://lh4.googleusercontent.com/-rytlgq-lXj4/U7-wgtJeP8I/ADs/IoUDhR3fY9Q/s1600/Capture.PNG






 Hello guys,, please help me to solve this error. What should I do?
 I have set the file mode is 777 [just for test] but the error was same.
 Thank you...

 --
 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/0628eb87-fdbe-46e0-84cc-1ffef8bc3744%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/0628eb87-fdbe-46e0-84cc-1ffef8bc3744%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGCzeMDqS2uZGGCLy%2Bna0%3D%3DJ0dRfWFnd%3D4E%3Dbk0yMXgMQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetlabs-apache prefork vs. worker

2014-07-10 Thread Hunter Haugen
I think the parameter you're looking for is
https://github.com/puppetlabs/puppetlabs-apache/#mpm_module

So:

class { 'apache':
  mpm_module = 'prefork',
}
class { 'apache::mod::php': }



or if you need to provide the prefork module custom parameters:

class { 'apache':
  mpm_module = false,
}
class { 'apache::mod::prefork':
  startservers = '12',
}
class { 'apache::mod::php': }




-Hunter


On Thu, Jul 10, 2014 at 10:00 AM, Peter Berghold salty.cowd...@gmail.com
wrote:

 Have a bit of frustration here:   I have a class I've written to install a
 vhost based Wordpress site on a server.  There will be serveral there.

 Since mod_php is needed I also need to install mod_prefork.

 I invoke the apache class thusly:

class {'apache':
 default_mods = false
 } -
 class { 'apache::mod::prefork': } -
 class { 'apache::mod::php': }

 which to me means don't load the worker mod but load apache2 then then
 load the next two modules.

 I get:

 Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
 May not include both apache::mod::prefork and apache::mod::worker on the
 same node at
 /etc/puppet/environments/production/modules/apache/manifests/mod/prefork.pp:20
 on node mcadprod2.mca.sharkrivertech.com
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run

 which is not the result I expected.  What am I missing here?

 --

 Peter L. Berghold   salty.cowd...@gmail.com

 http://blog.berghold.net

 --
 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/CAArvnv2Xox6CpNoz0uuQiThT9YNE9mGa-Qr1Bww%2Bs4XjbTgoiw%40mail.gmail.com
 https://groups.google.com/d/msgid/puppet-users/CAArvnv2Xox6CpNoz0uuQiThT9YNE9mGa-Qr1Bww%2Bs4XjbTgoiw%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
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/CAJaQvGBsiT-7%3DFfN%2Bs16gDuP2K6n8%3DFvJRfdhRtJiQtyhL8-BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Breaking changes in Puppetlabs_spec_helper v0.5.0

2014-06-09 Thread Hunter Haugen
Sorry about that; I was thinking of mocha as more of an extraneous
dependency rather than a feature. Turns out that the mock_with :mocha line
was a feature of puppetlabs_spec_helper and removing it changed the
behavior of projects which depend on PSH. That's what I get for releasing
on friday...

I have released 0.5.1 which adds back the mocha dependency and mock_with
:mocha.

Eventually I would like to see puppetlabs_spec_helper's helpful features
(like the puppet indirection initialization adapter pattern code and
fixtures) move into rspec-puppet, and its muddled/questionable aspects
resolved as to whether they should be removed or migrated into another more
appropriate place. At least the module team now owns this code and it can
start moving again.



-Hunter


On Mon, Jun 9, 2014 at 10:06 AM, Garrett Honeycutt g...@garretthoneycutt.com
wrote:
On 6/9/14, 12:49 PM, Clayton O'Neill wrote:
 On Mon, Jun 9, 2014 at 11:23 AM, fatmcgav fatmc...@gmail.com
 mailto:fatmc...@gmail.com wrote:

 Afternoon all,

 Just thought I'd make the lists aware of an issue I hit with
 puppetlabs_spec_helper v0.5.0 today.

 It would appear that changes committed in [1] results in the
 dropping of mocha as a dependency, and therefore any tests depending
 on mocha failing.
 The error I was seeing was:


Failure/Error:Puppet::Type.type(:application).stubs(:defaultprovider).returns
 described_class

 NoMethodError:

 undefined method `stubs' for Puppet::Type::Application:Class

 # ./spec/unit/puppet/provider/application/asadmin_spec.rb:6

 A work-around for me was to pin puppetlabs_spec_helper to v0.4.x. [2]


 I just ran into the same problem.  Is this a bug, or a change in API?  I
 also worked around it via '~ 0.4.1'.


Hi,

Created a ticket[1] asking Puppet Labs to release this as 1.0.0, so that
each release cannot break the API as so many of us depend on this.

[1] - https://tickets.puppetlabs.com/browse/PUP-2743

Br,
-g

--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

--
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/5395E97A.9050005%40garretthoneycutt.com
.
For more options, visit https://groups.google.com/d/optout.

-- 
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/CAJaQvGASwqWN1_daKjteeHx2kK4skXARKzT9Qxrhmu%3DGtTtW3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet module install output is missing files for puppetlabs/firewall

2014-03-04 Thread Hunter Haugen
Thanks for pointing this out!

The problem is that one of the spec files
(spec/acceptance/nodesets/default.yml) is a symlink to another .yml file in
that directory (usually centos-64-x64.yml). The `puppet module install`
command downloads the tarball to a cache directory in /var, extracts, then
moves it to the modules directory. My best guess is that when /var is a
different filesystem then some versions of tar will bork on the symlink and
kill the extraction.

We will get new releases out and remove those symlinks (also found in 4
other modules). A temporary workaround is to either `puppet module install`
the module on a host that doesn't have /var as a separate filesystem, or
wget and extract the tarball yourself.

It will not affect the functionality of the module.

Cheers



-Hunter


On Tue, Mar 4, 2014 at 6:29 AM, David Goldsmith noc.in.a@gmail.comwrote:

 On a CentOS 6.5 64-bit systems with Puppet 3.4.3 from the PuppetLabs repo:

 # puppet module install puppetlabs/firewall
 Notice: Preparing to install into /etc/puppet/modules ...
 Notice: Downloading from https://forge.puppetlabs.com ...
 Notice: Installing -- do not interrupt ...
 Error: No such file or directory -
 /etc/puppet/modules/firewall/spec/acceptance/nodesets/default.yml

 All I see in firewall/spec/acceptance/nodesets is a broken symlink for
 default.yml that points to centos-64-x64.yml, but that file is not there.

 If I grab the puppet labs-firewall-1.0.1.tar.gz tar ball and unpack it,
 the nodesets directory has the missing centos yml file and 10 others as
 well.

 Other files that appear to be missing from the puppet module install
 results are:

 firewall/CONTRIBUTING.md
 firewall/LICENSE
 firewall/metadata.json
 firewall/Modulefile
 firewal/spec/acceptance/nodesets/ ( 11 files )
 firewall/spec/fixtures
 firewall/spec/spec_help_acceptance.rb
 firewall/spec/spec_helper.rb
 firewall/spec/unit

 Is this an indication of a problem with the puppet module install
 command on this platform, with the contents of puppet labs/firewall up on
 the Forge site or of something else?

 Thanks,
 Dave

 --
 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/CAL3nWrX7CFRBxLUzU8LiwseF5aKR1g5%3DXrVGUFosKFs5JNru9g%40mail.gmail.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/CAJaQvGDB3ay0cwTioZ9f4UQ5hhdX43Q_4FY4xhJh2n%3D17SXy9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] puppetlabs-apache please help me to understand ssl_key allow-ovverride

2013-07-01 Thread Hunter Haugen
Hello!

Sorry for the confusion. It appears that the parameters you're referencing
are from the master branch of the github repo, but are installing the older
version from the forge (which has far less attention). The documentation on
https://github.com/puppetlabs/puppetlabs-apache is only in reference to the
master branch, so you will have to either clone from there using `git
clone` or reference the documentation on the forge (
http://forge.puppetlabs.com/puppetlabs/apache) for the forge version.

We plan to push a puppetlabs-apache release to the forge next week so that
the version on the forge and the version on github will line up more
closely.

One final note; remember to `include apache` before declaring any
apache::vhost resources so that the module can set everything up for them
:).



-Hunter


On Sun, Jun 30, 2013 at 4:33 PM, WesseldR j.w.dero...@gmail.com wrote:

 Thank you for giving my question a look,
 I'm starting up working with puppet and so far its great, however the
 apache module is driving me crazy :-/
 The manual on the website 
 https://github.com/puppetlabs/puppetlabs-apachegives tons of options, only a 
 view work for me.
 I have installed the 0.6.0

 I've installed it on debian 7.1:

 *wget -q http://apt.puppetlabs.com/puppetlabs-release-wheezy.deb*
 *dpkg -i puppetlabs-release-wheezy.deb /dev/null*
 *apt-get update /dev/null
 *
 *apt-get install -y puppet-common /dev/null
 *
 *puppet module install puppetlabs/apache*

 I'm trying to setup an webserver with AllowOverride All

 I created a file called ini.pp and run:
 *puppet apply init.pp*
 To apply it.

 # init.pp
 group { puppet:
ensure = present,
  }

 apache::vhost { 'www.test.local':
   port= '80',
   docroot = '/vagrant/web/',
   directory = [ { path = '/vagrant/web/', allow_override = ['All']  }],
 *#Error: Invalid parameter directory*
   docroot_group = 'vagrant',
   docroot_owner = 'vagrant',
 }

 How to correctly set this allowed_override ? puppet seems to not
 recognise the directory keyword. But installed is the latest version 0.6.0
 of puppetlabs/apache?

 In another attempt i tried to get SSL working and some keywords that are
 described in the manual i some how misuse..

 apache::vhost { 'default-ssl':
   port = 443,
   ssl  = true,
   ssl_key  = '/etc/ssl/private/ssl-cert-snakeoil.key', *#Error:
 Invalid parameter ssl_key*
   ssl_cert = '/etc/ssl/certs/ssl-cert-snakeoil.pem',   *#Error:
 Invalid parameter ssl_cert*
   docroot  = '/vagrant/web/',
 }

 Hope some one can help me out how to correctly use these to get my
 webserver configured with puppet.

 Many thanks in advance,

  Wessel


 --
 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 post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users.
 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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Re: Redmine upgrade beginning

2013-03-18 Thread Hunter Haugen
Looks like the upvote/downvote buttons are missing. (/red(dit|mine)/
anyone?)



-Hunter


On Thu, Mar 14, 2013 at 5:41 PM, Eric Sorenson eric.soren...@puppetlabs.com
 wrote:

 On Mar 14, 2013, at 5:12 PM, Eric Sorenson eric.soren...@puppetlabs.com
 wrote:

  Hi, we're starting the upgrade to projects.puppetlabs.com now. There
 will be a brief downtime as the old host's database is dumped and imported
 on the new box, then your requests should hit newprojects.puppetlabs.comuntil 
 DNS propagates.


 This is done; please let me know if you run into any trouble using the new
 Redmine site.

 Eric Sorenson - eric.soren...@puppetlabs.com
 #puppet irc: eric0

 --
 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 post to this group, send email to puppet-users@googlegroups.com.
 Visit this group at http://groups.google.com/group/puppet-users?hl=en.
 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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[Puppet Users] Re: hiera_array() default value not taken

2012-04-06 Thread Hunter Haugen
Looks like a default of [] 
triggers 
https://github.com/puppetlabs/hiera-puppet/blob/master/lib/puppet/parser/functions/hiera_array.rb#L32
 
to think that the `.lookup` function did not get an answer.

Hiera and Hiera-puppet have to distinguish between empty/false/nil answers 
sent by the backend due to missing data, or empty/false/nil answers 
explicitly returned as the default value or found value. Having hiera just 
return an empty answer when an answer is not found would probably not be 
preferable, so nil could possibly be the not found value?

-Hunter

On Monday, April 2, 2012 5:03:37 AM UTC-7, pablo.f...@cscs.ch wrote:

 Hi,

 There is probably something stupid I am missing, but I just can't see 
 it. I do:

 $iptables_open_ports_public = hiera_array ('iptables_open_ports_public', 
 [])

 And I have not defined that in the hiera tree, so the default (an empty 
 array) should be returned. But I get, instead:

 Error 400 on SERVER: Could not find data item 
 iptables_open_ports_public in any Hiera data file and no default supplied

 Is there any special way to define an empty array as a parameter?

 Thanks!
 Pablo



-- 
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/-/qiLhtq9pEX8J.
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] is anyone using a tool to diagram their manifests?

2010-12-03 Thread Hunter Haugen
Have you seen the --graph option that generates .dot files of your
generated catalogs? It's not global to all of your manifests, but it's
a start.

http://docs.puppetlabs.com/guides/faq.html#how-do-i-use-puppets-graphing-support

-Hunter



On Fri, Dec 3, 2010 at 14:50, psyber psyb...@gmail.com wrote:
 bump?

 On 5/22/2010 9:03 AM, Trevor Vaughan wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Well, it turns out that 0.25 completely broke my code (no big surprise).

 I was using the 'classes' method off of the parser, but I'll have to
 re-write it all now since the parser appears to have been heavily
 modified..

 Basically, it just used the puppet parser to dig through the manifest
 path on your system and create a dot diagram using the RGL library of
 all classes, inheritance trees, defines, and arguments to the defines.

 It worked reasonably well, but has gotten crufty without use.

 When I have time (not this weekend), I'll try to polish it back up for
 0.25 and actually stick it out for the world to use/break/whatever.

 Trevor

 On 05/21/2010 12:24 PM, Trevor Vaughan wrote:

 I've got some code at home that I think does what you want.

 I'll try to find time to dust it off over the weekend and post it to
 the list (no promises though).

 Trevor

 On Thu, May 20, 2010 at 10:34 PM, windowsrefundwindowsref...@gmail.com
  wrote:

 Despite taking great care to keep my manifests clean and logical, my
 code is growing both in size and complexity. That said, I'm starting
 to wonder if there are any tools I can use that would run through my
 entire tree and display some user friendly map showing the
 relationships between all the classes, and definitions. Any leads
 would be appreciated.

 Best,
 Adam

 --
 You received this message because you are subscribed to the Google
 Groups Puppet Users group.
 To post to this group, send email to puppet-us...@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.




 - -- Trevor Vaughan
  Vice President, Onyx Point, Inc.
  email: tvaug...@onyxpoint.com
  phone: 410-541-ONYX (6699)
  pgp: 0x6C701E94

 - -- This account not approved for unencrypted sensitive information --
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)

 iEUEARECAAYFAkv4AEsACgkQyWMIJmxwHpTCIgCXXFMGhbOXG531iVDqpkdzTO4H
 2ACeN//hghZnex+GGGnl0jqoz9mAPBc=
 =OIjC
 -END PGP SIGNATURE-


 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-us...@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-us...@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] iteration question

2010-12-03 Thread Hunter Haugen
The catalog that is shipped to the client is immediately applied
without reevaluating the state of the client (that evaluation is done
during catalog compilation on the master with the provided facts).

I think what you're looking for is for puppet to download a catalog,
revise the resources that should be managed, then apply the catalog,
which isn't currently possible.

You could create a custom fact that returns the list of files in the
directory, but that fact is only evaluated at the start of the puppet
run.

-Hunter



On Fri, Dec 3, 2010 at 14:15, Don Jackson
puppet-us...@clark-communications.com wrote:

 On Dec 3, 2010, at 12:56 PM, Patrick wrote:

 Why not sync the files directly to that directory?

 There are other files in the parent directory that are not managed by
 puppet.
 And the names of the files are dynamic enough that it would be painful to
 explicity manage each file in the puppet manifest.
 So, what I prefer to do, is tell puppet:
 Create a directory, and fill it with all contents of a comparable directory
 on the puppet file server.
 And then create links from the parent directory into this managed
 subdirectory.




 On Dec 3, 2010, at 12:48 PM, Don Jackson wrote:


 So here is a scenario:

 I have a directory:

 ./foo

 ./foo/file1

 ./foo/file2

 ./foo/file3

 …

 ./foo/fileN

 I populate this directory on a configured machine via a recursive file
 resource.

 What I would like to do is create a symlink from the parent directory to
 each filen in the foo subdirectory?

 Is there some easy way to get puppet to do that?

 Basically I would like to iterate thru

 ln -s ./foo/filen ./filen

 Short of writing a shell script, downloading it, and Exec'ing it?


 --

 You received this message because you are subscribed to the Google Groups
 Puppet Users group.

 To post to this group, send email to puppet-us...@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-us...@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-us...@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-us...@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] stages examples/advices

2010-10-18 Thread Hunter Haugen
 3.-) Stage order.

 but when applying new syntax:

 class orden {
        Stage['repos'] - Stage['os'] - Stage['main'] - Stage['gLite'] - 
 Stage['post']
 }

In your working example you define the classes and then enforce
ordering at the same time. The new syntax references the stages but
doesn't actually define them, so you could do this:

class orden {
  stage { [ 'repos', 'os', 'gLite', 'post' ]: }
  Stage['repos'] - Stage['os'] - Stage['main'] - Stage['gLite'] -
Stage['post']
}

-Hunter Haugen

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-us...@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: Duplicating web servers

2010-10-01 Thread Hunter Haugen
Also of note, if you're using Puppet 2.6.x then the command `ralsh`
from 0.25.x has been superseded by the `puppet resource` command.

-Hunter



On Fri, Oct 1, 2010 at 08:34, Matt Wallace li...@truthisfreedom.org.uk wrote:
 On Friday 01 Oct 2010 15:01:25 Kikanny wrote:
 Thank you all for taking your time to explain it to me. I guess I'll
 give it a whirl and see how it goes. Another question I have is what
 if the person managing a web server does not have full knowledge of
 whatever is installed in a server or there was some other
 configuration management in place. How would I bring that under
 puppet's control? I'm asking this because we do have servers like
 that. Thanks!

 1) Get a list of running services/open ports
 2) Get all the relevant configuration files for those services/ports
 3) Get a list of all the cronjobs on that system and the commands that are run
 4) Get a copy of all the scripts that are run by Cron
 5) Create your puppet manifests using the crontab entries, scripts and config
 files as a reference
 6) Put all your puppet manifests into git/svn/mercurial/etc.
 7) Create a staging platform to test your manifests (just because puppet
 parses them correctly doesn't mean that they work!)
 8) Test your manifests
 9) Test your manifests
 10) Test your manifests
 .
 102) Test Your manifests
 103) Checkout your manifests to your puppet master (provided they have passed
 the tests!)
 104) run puppet on a single server and check that your manifests give the
 required results
 105) Compare the server with one that is already working (but was not built by
 puppet) and try to discover why your puppet manifests aren't working in
 production when they worked in staging
 106) Fix the issues
 107) Run puppet again and check that everything now works
 108) Lock down access to all your servers so the only way a change can be made
 is via GIT/SVN/Mercurial etc
 109) Force commit messages for any changes to the config files
 110) Use a web interface to git to track any changes
 111) Go down the pub and by your entire team a beer for helping you achieve
 the impossible.

 If it's of any help, after approx nine months, I'm at various stages of this
 process between 1 and 110 for the different services that we have here... 
 we've
 still not made it down the pub yet... :(

 Cheers,

 M.

 --
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-us...@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-us...@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.