Re: [Puppet Users] Re: Which version of Puppet am I using?

2017-05-04 Thread fatmcgav
You should be able to roll Puppetboard back to an earlier version that
supports PuppetDB 2.x...

Glad I could help though...

Gav

On 4 May 2017 13:35, "Sans"  wrote:

Thanks Gav! I see that now.
PuppetDB v3 is only compatible with Puppet v4, which I cannot upgrade to it
yet.

Some issue with newer version of puppetboard module, I suppose, which seems
require puppetDB v3

-San


On Thursday, May 4, 2017 at 11:11:38 AM UTC+1, Gavin Williams wrote:
>
> Sans
>
> I wouldn't be surprised if that version of the 'puppetdb' pkg has a
> dependency on 'puppetagent', which will install Puppet 4.x.
> See https://docs.puppet.com/puppetdb/#versions for more info on PuppetDB
> + Puppet support...
>
> So if you *really *want to use Puppet 3.x, you could try and install
> 'puppetdb' < 3...
>
> However the recommendation everywhere now is to use Puppet 4.x, as Puppet
> 3 has been EOL'd...
>
> HTH
>
> Gav
>
-- 
You received this message because you are subscribed to a topic in the
Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/puppet-users/K9VGn6tjbmQ/unsubscribe.
To unsubscribe from this group and all its topics, 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/efc48051-e8c8-49dc-b5ca-95e6706b486b%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/CAGJCw3i6Pq7QPOKEuPBsfHQxFRU-0EeFAT%2BDB9yp_y80TR7VwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet first run issue: Error 400 on SERVER: Failed when searching for node

2016-11-13 Thread fatmcgav
Afraid I can't help on that one, as haven't used AWS.

There might be some additional features in a more recent version of Foreman
that will assist...

Cheers
Gav

On 13 Nov 2016 2:37 p.m., "A.K."  wrote:

> Hi Gavin,
>
> It's an AWS environment, so the same IP address of the machine and a
> hostname is reincarnated very often. Is there is some "auto cleaning"
> mechanism in Foreman 1.7.4? Or should I upgrade to some latest version?
>
> On Friday, November 11, 2016 at 12:03:16 PM UTC+2, Gavin Williams wrote:
>>
>> Our current process is that we create the host entry in Foreman as part
>> of our VM provision process.
>>
>> Couple of options for interfacing with Foreman:
>>
>>- cloud-init-foreman [1] - Not currently using this, but will be
>>evaluating in near future
>>- python-foreman [2] - We use this in conjunction with a python
>>bootstrap script that gets run when the VM boots, which installs Puppet
>>agent, gathers host data and creates host in Foreman, then triggers a
>>Puppet run.
>>- Provision the host *using* Foreman - Foreman can provision hosts on
>>most common platforms, including VMWare, Openstack, AWS, GCE etc...
>>
>> So largely depends on what your current provisioning process is and what
>> the best way of integrating Foreman is in that process...
>>
>> With regards to "why it is happening sometimes", are you rebuilding VM's
>> with the same hostname? As to Foreman, that would be the 'same' host, even
>> though it's been rebuilt.
>>
>> HTH
>>
>> Gav
>>
>> [1] https://github.com/cernops/cloud-init-foreman
>> [2] https://github.com/david-caro/python-foreman
>>
>> On Friday, 11 November 2016 08:29:46 UTC, A.K. wrote:
>>>
>>> Gavin,
>>>
>>> Yes, Foreman it is (v.1.7.4).
>>>
>>> > not creating the node in Foreman before the first Puppet run.
>>> Any idea how to work around this?
>>> And why it is happening sometimes, not every first run?
>>>
>>> Thank you!
>>>
>>>
>>> On Thursday, November 10, 2016 at 9:30:51 PM UTC+2, Gavin Williams wrote:

 What Rob said...

 This error is fairly typical if you're using something like Foreman as
 an ENC, and not creating the node in Foreman before the first Puppet run.

 Basically, whatever your ENC is needs to "know" about the node before
 it first dials in...

 HTH

 Gav

 On Thursday, 10 November 2016 16:50:16 UTC, Rob Nelson wrote:
>
> This looks like your external node classifier /etc/puppet/node.rb is
> having some issues on first run.
>
> On Thursday, November 10, 2016, A.K.  wrote:
>
>> Hi there,
>>
>> Puppet client version 3.8.7
>> Every first puppet run I've got this error:
>>
>> Nov 10 12:01:30 myinstance-172 puppet-agent[935]: (
>> /File[/var/lib/puppet/lib/puppet/type/rabbitmq_vhost.rb]/ensure)
>> defined content as '{md5}ff6fc35bb9c22b1c493b84adf6bb3167'
>> Nov 10 12:01:31 myinstance-172 puppet-agent[935]: (
>> /File[/var/lib/puppet/lib/puppet/provider/rabbitmq_user/rab
>> bitmqctl.rb]/ensure) defined content as
>> '{md5}eeddc61ef6c57e7225c818e494fc6e47'
>> Nov 10 12:01:31 myinstance-172 puppet-agent[935]: (
>> /File[/var/lib/puppet/lib/puppet/parser/functions/nslookup.rb]/ensure
>> ) defined content as '{md5}976cfe36eec535d97a17139c7408f0bd'
>> Nov 10 12:02:34 myinstance-172 puppet-agent[935]: Could not retrieve
>> catalog from remote server: Error 400 on SERVER: Failed when
>> searching for node myinstance-9p23t0xkmtu6vxv: Failed to find
>> myinstance-9p23t0xkmtu6vxv via exec: Execution of '/etc/puppet/node.rb
>> myinstance-9p23t0xkmtu6vxv' returned 1:
>> Nov 10 12:02:34 myinstance-172 puppet-agent[935]: Using cached
>> catalog
>> Nov 10 12:02:34 myinstance-172 puppet-agent[935]: Could not retrieve
>> catalog; skipping run
>> Nov 10 12:02:48 myinstance-172 puppet: /usr/share/ruby/vendor_ruby/pu
>> ppet/agent.rb:87:in `exit': no implicit conversion from nil to
>> integer (TypeError)
>> Nov 10 12:02:48 myinstance-172 puppet: from
>> /usr/share/ruby/vendor_ruby/puppet/agent.rb:87:in `block in
>> run_in_fork'
>> Nov 10 12:02:48 myinstance-172 puppet: from
>> /usr/share/ruby/vendor_ruby/puppet/agent.rb:84:in `fork'
>> Nov 10 12:02:48 myinstance-172 puppet: from /usr/share/ruby/
>> vendor_ruby/puppet/agent.rb:84:in `run_in_fork'
>> Nov 10 12:02:48 myinstance-172 puppet: from
>> /usr/share/ruby/vendor_ruby/puppet/agent.rb:43:in `block in run'
>> Nov 10 12:02:48 myinstance-172 puppet: from
>> /usr/share/ruby/vendor_ruby/puppet/application.rb:179:in `call'
>> Nov 10 12:02:48 myinstance-172 puppet: from /usr/share/ruby/
>> vendor_ruby/puppet/application.rb:179:in `controlled_run'
>> Nov 10 12:02:48 myinstance-172 puppet: from
>> /usr/share/ruby/vendor_ruby/puppet/agent.rb:41:in `run'
>> Nov 10 12:02:48 myinstance-172 puppet: 

Re: [Puppet Users] Managing config files...

2014-07-15 Thread fatmcgav
Felik

Cheers for taking the time to reply...

I've been trying to work up a Augeas lense to support jre.properties, but
dont seem to be having much luck... Seems like there's a bit of a black art
to writing them...

I'm in two minds about wrapper.conf. I've got it templates currently, but
like you say I'm not sure how to best handle the existing default values
plus any new values that might be needed... Or perhaps I just don't support
overriding existing values.. Though that feels like a bit of a short cut to
me...

Anyone else?

Cheers
Gavin
On 15 Jul 2014 21:52, Felix Frank felix.fr...@alumni.tu-berlin.de wrote:

  On 07/14/2014 02:49 PM, Gavin Williams wrote:

 I think the 2 provided examples give different challenges.
 *jre.properties*[3] strikes me as the most troublesome initially, due to
 the nature of the contents and the format reqs...
 My initial thought is to provide a type that can manage the file, and
 possibly use Augeas to manage the file. Happy for other suggestions though
 :)


 If I'd need Puppet to manage that, I'd likely want to be able to manage
 each LeftHandSide/ListElement pair via ensure. I.e., I don't want to
 enumerate the full lists in manifest or hiera, but just want to make sure
 distinct elements are there ore not.

 *wrapper.conf*[4] looks like it should be fairly easy to template. The
 only thing I'm not sure on is how to handle the incrementing nature of the
 param lines...
 I'd like to keep the number of resource params as light as possible, as
 there's no way I can expose all the possible config lines, so I'm thinking
 maybe use an array for each 'set' of config lines, e.g.
 'wrapper.java.classpath' and 'wrapper.java.additional'... But then how do I
 handle over-riding pre-existing config values? Is there a better way to
 handle this file?


 I think you rather mean - how to *keep* existing values and only manage
 certain entries of the array.
 I fear that won't work. And I concur that arrays would be a good choice
 here. Perhaps an alternative API that takes an index/value hash instead
 would be useful to some, but seems like abysimal mileage to me.

 I haven't dabbled in augeasproviders yet (which is a shame), but imagine
 that it would be a good approach for both files (unless of course the
 latter can just be templated).

 Cheers,
 Felix

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/9aFzgCU0GCo/unsubscribe.
 To unsubscribe from this group and all its topics, 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/53C5948A.3080707%40Alumni.TU-Berlin.de
 https://groups.google.com/d/msgid/puppet-users/53C5948A.3080707%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/CAGJCw3gjO1hkvb3y%2BHvs-_nc34rvQJ36SSkYQHgmd-HgYBcK2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Breaking changes in Puppetlabs_spec_helper v0.5.0

2014-06-09 Thread fatmcgav
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]

Hopefully this will prevent un-necessary time-wastage for anyone else :)

Also, as a general comment to PL - Is it possible to get some advance
notice of breaking changes such as this?
As this could potentially have been prevented by a release email stating
the breaking nature of the changes, and prompting users to ensure they are
pinning versions as appropriate.

Thanks for the assistance of igalic and _rc on #puppet-dev.

Cheers
Gavin

[1]
https://github.com/puppetlabs/puppetlabs_spec_helper/commit/1c23917f60f64e4fbf7b9effdb212f907656826f
[2]
https://github.com/fatmcgav/fatmcgav-glassfish/commit/ae4bbc94d611acb6c037cb9e3cc852d28a162f9b

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


Re: [Puppet Users] File.exists? validation failure when trying to create file in same catalogue

2014-02-05 Thread fatmcgav
Line 41 is the end of the domain resource in the create_domain defined
type. [1]

Cheers
Gav

[1]
https://github.com/fatmcgav/puppet-glassfish/blob/master/manifests/create_domain.pp#L41
On 6 Feb 2014 04:50, Denmat tu2bg...@gmail.com wrote:

 Hi,

 What's the code on that line?

  On 6 Feb 2014, at 4:04, Gavin Williams fatmc...@gmail.com wrote:
 
  /home/vagrant/modules/glassfish/manifests/create_domain.pp:41

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/YQQAo9CK9As/unsubscribe.
 To unsubscribe from this group and all its topics, 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/523AB043-FAB6-4A2D-9D88-BEEACB790B8C%40gmail.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/CAGJCw3hUvpST37fEPrn_4C3LDy1Tmvyiay%3D%2B62nSguKjUO-s0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Rspec-puppet and testing for expected failures...

2014-01-16 Thread fatmcgav
Quick update...

Many thanks to @superseb for working up a PR[1] that fixes the expect
errors. Trick was to use 'subject' within the expect, rather than a
resource title...

@superseb also highlighted an old Puppet bug[2] which I've migrated across
to Jira[3] for review/decision.
However as per the notes on Redmine, I should be able to work around said
bug by using a case statement rather then the tenary operator...

Onwards and upwards.

Cheers
Gav

[1] https://github.com/fatmcgav/puppet-glassfish/pull/8
[2] http://projects.puppetlabs.com/issues/4598
[3] https://tickets.puppetlabs.com/browse/PUP-1457
On 16 Jan 2014 17:27, Gavin Williams fatmc...@gmail.com wrote:

 Afternoon all,

 I'm trying to add some rspec-puppet testing to my Glassfish module[1], in
 preparation for releasing it to the forge.

 I've got some stuff working fine, however I'm trying to test expected
 failure scenarios without much luck.

 Travis CI[2] highlights the issues I'm seeing.
 An example error message is:

 Failure/Error: expect {

 expected Puppet::Error with message matching /OSFamily Suse not
 supported/ but nothing was raised

 This is as a result of a test[3] which is testing some validation logic in
 my create_service[4] defined type.

 Any pointers on where I could be going wrong?

 Thanks in advance for any responses.

 Regards
 Gavin

 [1] https://github.com/fatmcgav/puppet-glassfish
 [2] https://travis-ci.org/fatmcgav/puppet-glassfish/jobs/17072897#
 [3]
 https://github.com/fatmcgav/puppet-glassfish/blob/master/spec/defines/create_service_spec.rb#L127-149
 [4]
 https://github.com/fatmcgav/puppet-glassfish/blob/master/manifests/create_service.pp#L14-19

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/Ek0ckKfPGYw/unsubscribe.
 To unsubscribe from this group and all its topics, 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/f04c1f56-60c0-4fa9-be03-f5fbe1129ce5%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAGJCw3j1fKUp1AajMoR6H5yH18zGBxD%3DzAwd%2B2X7%2Bjbv8p_afw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] New release of fatmcgav-netapp module.

2013-09-30 Thread fatmcgav
Evening all,

Thought I'd drop a quick line through to say that I have just released
v0.4.0 of my Netapp network device module.

A full changelog can be found on the Forge [1] or Git [2], however the
highlights are:
 * Removed the need for a special config file to define username/password.
Now pulled from connect string.
N.B: This will not work with existing configuration, so will require config
tweaks before usage.
 * Support for NetApp Quotas
 * Re-factored a lot of code to use helper functions
 * Loads of new tests

Massive thanks to Stefan Schulte for a lot of the code changes that have
made it into this release.

As always, feel free to drop me a line or respond to this message with any
questions/issues.

Cheers again.
Gavin

[1] http://forge.puppetlabs.com/fatmcgav/netapp/0.4.0
[2] https://github.com/fatmcgav/fatmcgav-netapp/blob/v0.4-fixes/CHANGELOG

-- 
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: New Module - NetApp Storage support

2013-05-01 Thread fatmcgav
Brett

Which version are you trying to use?

Did have an issue with some earlier versions when exporting the module from
Gepetto... It would remove an empty dependencies list... However have been
using a different method for latest versions.

But to confirm, there are no dependencies for this module.

Regards
Gavin
On 30 Apr 2013 23:12, Brett Edelen brett.ede...@gmail.com wrote:

 having some trouble getting this module installed. do you know the
 dependency list?
 ---
 Preparing to install into /etc/puppetlabs/puppet/modules ...
 Error: No dependencies module metadata provided for netapp
 Error: Try 'puppet help module install' for usage
 ---

 On Tuesday, January 29, 2013 4:00:08 AM UTC-8, Gavin Williams wrote:

 Afternoon all

 Thought I'd drop a quick message through to highlight a new module that
 I've just released to the Forge...

 The module is 
 fatmcgav/netapphttps://forge.puppetlabs.com/fatmcgav/netapp/0.1.0,
 and its purpose is to allow Puppet to manage NetApp storage devices using
 Puppet's Network Device functionality...

 As some of you may be aware, I've been working on this module on and off
 for a couple of months now, and a lot of assistance has been given from
 members of the Puppet-users and Puppet-dev lists, so many thanks again for
 that assistance.

 Please feel free to ask any questions, raise any issues etc, either in
 response to this post, though twitter (@fatmcgav), email (fatmcgav[at]
 gmail.com) or can raise issues directly on 
 Githttps://github.com/fatmcgav/fatmcgav-netapp/issues?state=open
 .

 And lastly, I hope that people find this module useful.

 Regards
 Gavin W

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/WIlC3dzpY4E/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, 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.




Re: [Puppet Users] Re: How to optimize puppet class/module code ?

2013-04-09 Thread fatmcgav
http://soimasysadmin.com/2012/02/29/puppet-inheritance-revisited/ is one
I've got bookmarked...

HTH

Gav


On 9 April 2013 10:54, ForumUser p@cmcmarkets.com wrote:

 Hi Gavin,

 Can you suggest any URL where I could read about ::params classes (and
 examples of course ;-) ) ?

 On Tuesday, 9 April 2013 10:47:40 UTC+1, Gavin Williams wrote:

 Hi there,

 I think you're quickest win for making the code cleaner and easier would
 be to create a ::params class, which sets the correct values for package,
 file and service based on your distro.

 Can then inherit this class on your ::install, ::config and ::service
 classes.

 I'm sure other people will chime in with some other ideas aswell :)

 HTH

 Gav

 On Tuesday, 9 April 2013 10:36:51 UTC+1, ForumUser wrote:

 Hello all,

 I am trying to write a syslog module for our small puppet installation.
 Since I'd like to learn how to write puppet classes/modules I would avoid
 modules from puppet labs forge (at least for now).

 This module is going to be deployed on RH 5 _and_ 6.
 In our infrastructure each RH line (5 or 6) is configured differently:
 RH 5 uses sysklogd, RH 6 uses rsyslog.

 I have written a class but as you can see it has a lot of redundant code.
 Can I use any puppet syntax to make it more elegant (and easier to
 maintain :-) ) ?
 Can you suggest anything ?

 class syslog::install {
 case $lsbmajdistrelease {
 '5':{
   **  package { sysklogd:
   **  ensure = present,
   **  }
 }

 '6':{
   **  package { rsyslog:
   **  ensure = present,
   **  }
 }
 }
 }

 class syslog::config {
 case $lsbmajdistrelease {
 '5':{
   **  file{ /etc/syslog.conf:
   **  ensure = present,
   **  owner = 'root',
   **  group = 'root',
   **  mode = 0644,
   **  source =
 puppet:///modules/syslog/**syslog.conf,
   **  require =
 Class[syslog::install],
   **  notify =
 Class[syslog::service],
   **  }
 }

 '6':{
   **  file{ /etc/rsyslog.conf:
   **  ensure = present,
   **  owner = 'root',
   **  group = 'root',
   **  mode = 0644,
   **  source =
 puppet:///modules/syslog/**rsyslog.conf,
   **  require =
 Class[syslog::install],
   **  notify =
 Class[syslog::service],
   **  }
 }
 }
 }

 class syslog::service {
 case $lsbmajdistrelease {
 '5':{
   **  service { syslog:
   **  ensure = runing,
   **  enable = true,
   **  require =
 Class[syslog::config],
   **  }
 }

 '6':{
   **  service { rsyslog:
   **  ensure = runing,
   **  enable = true,
   **  require =
 Class[syslog::config],
   **  }
 }
 }
 }


 class syslog {
 include syslog::install, syslog::config, syslog::service
 }


 Thanks in advance :-)
 Przemek

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/puppet-users/vJeR5M2-TS0/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, 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 

Re: [Puppet Users] Puppet with Passenger - 403 Forbidden errors???

2013-02-14 Thread fatmcgav
There was/is nothing in the error_log...

Cheers
Gav


On 14 February 2013 12:20, Felix Frank felix.fr...@alumni.tu-berlin.dewrote:

 Hi,

 what does apache commit to the error log when an agent tries to connect?

 Thanks,
 Felix

 On 02/12/2013 10:22 PM, Gavin Williams wrote:
  Hi all
 
  I'm trying to migrate our existing Puppet env from WeBrick to Passenger
  with Apache.
 
  I followed the following tutorials
 
 http://wiki.unixcraft.com/display/MainPage/Puppet+3.0+Installation+on+Centos+6.3
  
 
 http://aricgardner.com/deployment/puppet-2/puppet-master-on-centos-5-7-with-passenger-and-foreman/
  However whenever I try and communicate with the puppet master, I'm
  getting a 403 forbidden error.
 
  ENC Classifier:
  $ ./node.rb puppet-test.card.co.uk
  Error retrieving node puppet-test.card.co.uk: Net::HTTPForbidden
 
  Puppet Agent:
  $ sudo puppet agent -t
  Warning: Unable to fetch my node definition, but the agent run will
  continue:
  Warning: Error 403 on SERVER: Forbidden request:
  puppet-os.card.co.uk(192.168.150.118) access to
  /node/puppet-os.card.co.uk [find] at :99
  Info: Retrieving plugin
  Error: /File[/var/lib/puppet/lib]: Failed to generate additional
  resources using 'eval_generate: Error 403 on SERVER: Forbidden request:
  puppet-os.card.co.uk(192.168.150.118) access to /file_metadata/plugins
  [search] at :99
  Error: /File[/var/lib/puppet/lib]: Could not evaluate: Error 403 on
  SERVER: Forbidden request: puppet-os.card.co.uk(192.168.150.118) access
  to /file_metadata/plugins [find] at :99 Could not retrieve file metadata
  for puppet://puppet.card.co.uk/plugins: Error 403 on SERVER: Forbidden
  request: puppet-os.card.co.uk(192.168.150.118) access to
  /file_metadata/plugins [find] at :99
  Info: Loading facts in
  /etc/puppet/modules/puppet/lib/facter/etckepper_puppet.rb
  Info: Loading facts in
  /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
  Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
  Info: Loading facts in
 /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
  Info: Loading facts in
  /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
  Info: Loading facts in /etc/puppet/modules/act/lib/facter/oracle_sids.rb
  Info: Loading facts in /etc/puppet/modules/act/lib/facter/smo_version.rb
  Info: Loading facts in
 /etc/puppet/modules/firewall/lib/facter/iptables.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/oracle_sids.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/iptables.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/smo_version.rb
  Info: Loading facts in /var/lib/puppet/lib/facter/etckepper_puppet.rb
  Error: Could not retrieve catalog from remote server: Error 403 on
  SERVER: Forbidden request: puppet-os.card.co.uk(192.168.150.118) access
  to /catalog/puppet-os.card.co.uk [find] at :99
  Warning: Not using cache on failed catalog
  Error: Could not retrieve catalog; skipping run
  Error: Could not send report: Error 403 on SERVER: Forbidden request:
  puppet-os.card.co.uk(192.168.150.118) access to
  /report/puppet-os.card.co.uk [save] at :99
 
  Any ideas on what could be the cause?
 
  I've checked file permissions etc, and from what I can gather they are
  correct.
 
  Cheers in advance for any responses.
 
  Regards
  Gavin

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




Re: [Puppet Users] Re: Defined type and cyclic dependencies :(

2013-02-08 Thread fatmcgav
John

Cheers again, very helpful...

Will look at simplifying the relationships as much as possible, and also
switch to before/requires...

And yes, do regularly see multiple 'removing_xxx' before any of the
'removed_xxx' notifications...

Cheers
Gav
On Feb 8, 2013 10:28 PM, jcbollinger john.bollin...@stjude.org wrote:



 On Friday, February 8, 2013 12:35:38 PM UTC-6, Gavin Williams wrote:

 John

 Cheers for the response.

 I've added another file to the gist - https://gist.github.com/**
 fatmcgav/4722199#file-oracle-**pphttps://gist.github.com/fatmcgav/4722199#file-oracle-pp.
 This is a snippet from the top-level manifest that is responsible for
 calling the *'remove' *define using *'create_resources'*.


 Well, you certainly do have more relationships than you need, and
 generally speaking, more than you need is more than you want.  It is not
 immediately evident to me why some of the dependencies are being generated,
 but you should start by removing all unnecessary relationships.

 In particular, there is no need to have relationships among the 
 variousact::util::linux::nfs_mount instances, because it doesn't matter in 
 what
 relative order these are applied.  Furthermore, not all of them even depend
 on the $tier1_prefix directory, because some of the mount points are
 elsewhere.

 I don't know about File[${oracle_sid}_profile], Oranfstab[$oracle_sid],
 and Oratab[$oracle_sid], but surely each of these depends on AT MOST one
 of the *::nfs_mount resources.  Where there is such a dependency, declare
 that and only that.  Alternatively move all the *::nfs_mount mount
 resources to a separate defined type, 
 maybeact::env::oracle::instance::netapp::mount, and declare dependencies to 
 that.

 Consider also declaring your relationships via the 'before' and / or
 'require' resource metaparameters instead of via the chain operator.  It *
 shouldn't* make a difference, but perhaps you have stumbled on a bug.

 You do have some needed relationships in there, but it looks like you've
 spent a lot of effort mostly to bracket the operations with Preparing to
 remove ... and Removed ... messages.  That's your prerogative, of
 course, but do you realize that nothing you've written prevents other
 resources from elsewhere being applied between the ones in your chain?  If
 you have a large catalog then that's in fact likely to happen, so your
 notification messages have the potential to be deceptive.


 John

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




Re: [Puppet Users] Re: New Type/Provider... How to handle cli input???

2013-02-07 Thread fatmcgav
John

Cheers for the response...

Unfortunately SnapDrive is not my program - It's a NetApp program, so I'm
not going to be able to change it :(
Also doesn't look like it's designed to support command line args... :( :(

But in principle, it looks like it's possible, but a bit hacky...

Cheers
Gavin


On 7 February 2013 14:42, jcbollinger john.bollin...@stjude.org wrote:



 On Thursday, February 7, 2013 5:12:41 AM UTC-6, Gavin Williams wrote:

 Morning all

 I'm looking at writing a set of types/providers to handle NetApp
 SnapDrive configuration and usage...

 There's quite a lot to SnapDrive, so initially, I'm just trying to get it
 to manage credentials.

 The challenge I can immediately see is that for me to set a credential,
 the command prompts for a password input twice... Example command run is:
 # snapdrive config set sd-act-star-db05 act-star-nactl01
 Password for sd-act-star-db05:
 Retype password:
 -957 Warning: Optionally, Please set -mgmtpath interface for
 act-star-nactl01 to be used as data interface i.e
 snapdrive config set -mgmtpath mgmtpath act-star-nactl01

 Is it possible to cater for this in a provider?



 In principle, you can redirect appropriate canned responses into the
 command's standard input. I don't recall offhand whether Puppet's built-in
 executor facilities support that directly, but you can always wrap up
 something like that in a 'bash -c' command.

 It would be far better, however, if the configuration program were built
 to be scriptable (i.e. to not require interactive I/O).  For one thing,
 does your installer prompt for a password even when it is run by root
 (which is what the agent will do in the usual configuration)?  Does it
 support command-line options by which you can bypass any other QA?


 John

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




Re: [Puppet Users] Re: New Type/Provider... How to handle cli input???

2013-02-07 Thread fatmcgav
Justin

Cheers for that. Will have a read and see what I can come up with :)

Cheers
Gav


On 7 February 2013 17:32, Justin Stoller jus...@puppetlabs.com wrote:

 There's a completely undocumented (outside of the Pickaxe book) Ruby
 STDLIB module called 'expect' that you could use in 1.8.7, open up irb and
 give it a whirl. You can find other expect like gems (or at least crib how
 they're using the pty)[1]. I think you'll want something like expect4r[2]
 extended for NetApp.


 HTH,
 Justin

 1. https://rubygems.org/search?utf8=%E2%9C%93query=expect
 2. https://github.com/jesnault/expect4r


 On Thu, Feb 7, 2013 at 7:18 AM, fatmcgav fatmc...@gmail.com wrote:

 John

 Cheers for the response...

 Unfortunately SnapDrive is not my program - It's a NetApp program, so I'm
 not going to be able to change it :(
 Also doesn't look like it's designed to support command line args... :(
 :(

 But in principle, it looks like it's possible, but a bit hacky...

 Cheers
 Gavin


 On 7 February 2013 14:42, jcbollinger john.bollin...@stjude.org wrote:



 On Thursday, February 7, 2013 5:12:41 AM UTC-6, Gavin Williams wrote:

 Morning all

 I'm looking at writing a set of types/providers to handle NetApp
 SnapDrive configuration and usage...

 There's quite a lot to SnapDrive, so initially, I'm just trying to get
 it to manage credentials.

 The challenge I can immediately see is that for me to set a credential,
 the command prompts for a password input twice... Example command run is:
 # snapdrive config set sd-act-star-db05 act-star-nactl01
 Password for sd-act-star-db05:
 Retype password:
 -957 Warning: Optionally, Please set -mgmtpath interface for
 act-star-nactl01 to be used as data interface i.e
 snapdrive config set -mgmtpath mgmtpath act-star-nactl01

 Is it possible to cater for this in a provider?



 In principle, you can redirect appropriate canned responses into the
 command's standard input. I don't recall offhand whether Puppet's built-in
 executor facilities support that directly, but you can always wrap up
 something like that in a 'bash -c' command.

 It would be far better, however, if the configuration program were built
 to be scriptable (i.e. to not require interactive I/O).  For one thing,
 does your installer prompt for a password even when it is run by root
 (which is what the agent will do in the usual configuration)?  Does it
 support command-line options by which you can bypass any other QA?


 John

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




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




Re: [Puppet Users] Resource ordering problem...

2013-01-31 Thread fatmcgav
Matt

Yeh, the function is defined within this module...

I'll give moving the loadyaml into parse_databases a go when back in the
office in the morning...

Any other ideas welcome though...

Cheers
Gavin
On Jan 31, 2013 8:43 PM, Matthew Burgess matthew.2.burg...@gmail.com
wrote:

 On Thu, Jan 31, 2013 at 5:52 PM, Gavin Williams fatmc...@gmail.com
 wrote:
  Afternoon all
 
  I'm sure this is probably a nice n easy one, but I can't work it out for
 the
  life of me...
 
  Anyhow, I've got the following code:
# Load db yaml data
$db_details = loadyaml('/etc/puppet/data/databases.yaml')
 
notify{DB Details loaded... About to parse.:}
-
notify{DB Details = ${db_details}.:}
 
#$hostname = lookupvar('{hostname}')
# Parse data and filter to only primary databses for this server
$databases = parse_databases($db_details, 'database_primay_server',
  $::hostname)
 
notify{Parsed db details, creating resources.:}
-
notify{Databases = ${databases}:}
 
# Create required resources...
if $::oracle_netapp {
  notify{\$::oracle_netapp is true.:}
  create_resources( act::env::oracle::instance::netapp, $databases)
}
 
  Parse_databases() is a custom function within one of my modules..

 And I assume that the module that defines/declares parse_databases()
 is 'include'd just above this snippet?  Not that I'm sure it will
 change things.  If not...

 As $db_details is only used by the parse_databases() function (in this
 snippet), is it possible to move the call to loadyaml() within the
 function itself?  I've assumed you need $db_details further on outside
 of the code you showed here, but thought I'd suggest the bleeding
 obvious, just in case :-)

 Thanks,

 Matt.

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




Re: [Puppet Users] Re: ParsedFile Multi-line...

2013-01-25 Thread fatmcgav
Peter

That would be great, cheers...

Enjoy ure holiday first though... ;)

Cheers
Gavin


On 25 January 2013 04:31, Peter Brown rendhal...@gmail.com wrote:

 On 10 January 2013 02:41, Gavin Williams fatmc...@gmail.com wrote:

 Anyone got any ideas???

 My next thought is to use something like puppet-concat with an ERB
 template... However not sure how effective that's going to be...


 That would probably be pretty easy to setup.
 I use concat and templates for a few of my modules, namely my firewall
 module.
 Each rule calls a define i setup to create the rule from a template.

 I am on holidays till Wednesday next week and most of my code is at work.
 I can send you some examples then.


 Cheers
 Gavin

 On Friday, 4 January 2013 16:33:17 UTC, Gavin Williams wrote:

 Afternoon all,

 I'm currently working on adding oranfstab support to Puppet-Oracle (
 https://github.com/stschulte/**puppet-oraclehttps://github.com/stschulte/puppet-oracle).


 However I'm struggling to get my head around how I can get Puppet
 parsedfile to work with multi-line configurations...

 An example oranfstab configuration block is:
 server: stgasm === NFS server Host name
 path: 10.177.52.158 --- First path to NFS server ie NFS server NIC
 local: 10.177.52.151 --- First client-side NIC
 path: 10.177.52.159 --- Second path to NFS server ie NFS server NIC
 (For load balance purpose)
 local: 10.177.52.151 --- Second client-side NIC (For load balance
 purpose)
 export: /oraclenfs mount: /oradata1

 'path' and 'local' are optional, but can be specified multiple times
 aswell...
 The final 'export' line is required, and can be provided multiple times
 for multiple mount points..

 So as you can see, there's a fair amount of variability in the file
 format...

 It's also then possible to have multiple 'server/path/local/export'
 blocks, for example with different filers...

 Any ideas on where I could begin? Is parsedfile right for the job, or am
 I better looking elsewhere?

 Thank you in advance for any responses.

 Regards
 Gavin

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

 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 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 post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@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.




Re: [Puppet Users] Remote Network Device management...

2012-12-21 Thread fatmcgav
Peter

Cheers for the response.

Network device management is being achieved using Puppet's new 'Network
Device' support as part of 3.0...

Site to site connectivity isn't an issue, as we've got a 100Mbps MPLS link
between all 3... However it was more about security and the practicality of
allowing the Puppet master effectively unlimited access to all sites...

Cheers
Gavin


On 21 December 2012 01:07, Peter Brown rendhal...@gmail.com wrote:

 On 21 December 2012 02:40, Gavin Williams fatmc...@gmail.com wrote:

 Afternoon all

 We are starting to look at using Puppet Network device support in anger,
 and one of the potential issues that has been raised is around cross-site
 access...

 Currently, we have one Puppet master server, which is hosted in location
 C.
 This server is able to access and manage the appropriate network devices
 in location C.

 However there are other devices in locations A and B which we want to be
 able to manage through Puppet. However some potential concerns have been
 raised around allowing the puppet master server blanket access to locations
 A  B...

 Is it possible therefore to run the network devices in effectively a
 'proxy' mode. That is, we create/nominate a suitable node in locations A
 and B which would be able to manage network devices in their respective
 locations, and these nodes then talk back to the Puppet master.

 Does this sound sensible?

 Any other considerations/ideas as to how the above can achieve?


 I have no idea how you are achieving the network device configuration but
 a setting up a VPN between the master and locations b and c seems like the
 best way to do it.
 That would give you centralised management and security as well.
 I would suggest using some kind of ssl wrapped vpn like openvpn or ipsec
 or something like that.

 I did find this module on puppet forge for managing openvpn
 https://forge.puppetlabs.com/luxflux/openvpn

 Hope that helps.

 Pete.


 Cheers in advance for any responses.

 Regards
 Gavin

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


  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Puppet NetApp Network device management...

2012-12-20 Thread fatmcgav
Jakov

Thank you for the positive feedback.

The NetApp puppet stuff is on the back burner atm, hopefully should be able
to get back to buy in the new year :-)

Cheers
Gav
On Dec 19, 2012 2:34 AM, Jakov Sosic jso...@srce.hr wrote:

 On 11/12/2012 12:59 PM, Gavin Williams wrote:

 Monday update from me...

 Implemented support for Export creation on Friday, after making some
 further good progress...

 Now I'm looking at fine-tuning stuff, such as volume settings, export
 options, etc...


 Great work! When I get some spare time I will continue to work on my
 cobbler custom types, so I will take a peek into your code aswell. My
 providers are good for our internal use so I pushed on with other stuff
 although they still need some optimizations. Just keep on the good work :)

 --
 Jakov Sosic
 www.srce.unizg.hr

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to puppet-users+unsubscribe@**
 googlegroups.com puppet-users%2bunsubscr...@googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/puppet-users?hl=enhttp://groups.google.com/group/puppet-users?hl=en
 .



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet Nagios/NRPE with Plugins...

2012-12-03 Thread fatmcgav
Pete

Sounds good to me... N be easier than me re-inventing the wheel...

Would be happy to guinea pig... :)

Cheers
Gav


On 3 December 2012 23:56, Peter Brown rendhal...@gmail.com wrote:

 Hi Gavin,

 I have a module i wrote that seems like it will do what you need.
 I also have a nagios module that uses it to setup nrpe services on each
 node and exports nagios checks to be imported into a nagios instance.

 I basically setup nrpe on each node to use a config directory and have a
 define that uses templates to generate each nrpe service that need to be
 setup.
 My nagios module needs some rewriting before I will be happy releasing it.
 The nrpe module is pretty much good to go though.
 It can also use sudo, also managed by another module I have (Yeah I have a
 lot olf modules and most of them talk to other modules I wrote)

 I am going start putting my stuff on github and puppet forge as soon as I
 have them ready.

 Are you interested in being a guinea pig?

 :)

 Pete.


 On 3 December 2012 21:47, Gavin Williams fatmc...@gmail.com wrote:

 Morning all

 I've had a quick google, but couldn't find anything useful for our
 scenario...

 Basically, we use Nagios  NRPE in our environment, along with a
 hand-full of in-house written plugins specific to our applications etc...
 These scripts change on a fairly regular basis, so hand rolling a RPM
 each time is too much work as far as i'm concerned...

 So I can easily get NRPE installed on a node using Puppet... However what
 I'm struggling with is getting all the plugins synced over aswell...

 One suggestion I read was to use a file resource, however I've also read
 about severe performance issues when working with tens of files...
 I dont really want to have to create some kind of NFS file share to
 distribute the files...

 So, any other ideas?

 Cheers
 Gavin

 P.S. Env consists of a single 3.0 Puppet Master, currently with about a
 dozen nodes connected, but this will rapidly increase once we start full
 roll-out...

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

 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-26 Thread fatmcgav
John

Cheers again, that could be a good alternative way of doing it... Use
insync? just to trigger options=, and then work out what actually needs
setting there...

Cheers
Gav
On Nov 26, 2012 5:42 PM, jcbollinger john.bollin...@stjude.org wrote:



 On Friday, November 16, 2012 5:44:09 AM UTC-6, Gavin Williams wrote:

 However still looks like if one of the *:options *doesn't match, then
 the whole lot gets set again... I guess that's a reasonable logic in that
 if one doesn't match, it's quite possible other's don't match, so set them
 all to be safe... Unless I missed something?


 What you continue to miss is that you are treating all the options as a
 single property.  That's ok, but it means that at the level of the resource
 / provider interface, Puppet cannot set individual options, only all of
 them as a group.  You can't have it both ways.

 Inside your provider, however, you can implement the interface to the
 underlying tool any way you want.  In particular, in your options=
 function, you can look at the current value and the value being set,
 extract the changes, and apply only those.  I guess you were trying to do
 something like that in your insync? function, but if you're doing something
 like that then options= is probably where it should go.


 John

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/uFOu3gp_0kQJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-26 Thread fatmcgav
John,

Again, very helpful...
My knowledge of puppet is growing every day thanks to posts like this :-)

Cheers
Gavin
On Nov 26, 2012 7:30 PM, jcbollinger john.bollin...@stjude.org wrote:



 On Monday, November 26, 2012 12:19:09 PM UTC-6, Gavin Williams wrote:

 John

 Cheers again, that could be a good alternative way of doing it... Use
 insync? just to trigger options=, and then work out what actually needs
 setting there...


 That's not just a good alternative, it's the right way to do it.  The job
 of insync? is simply to determine whether all of the resource's properties
 have the expected target values.  No more, no less.  The job of property
 setter methods such as options= is to update the underlying resource(*) so
 that the affected property has the assigned value.  It is there, at the
 interface between Puppet and the system, that you have flexibility.

 (*) The property setters of providers that implement flush() work a bit
 differently, but I don't think that's relevant here.  I mention it for
 completeness.


 John

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/OEk9ZWDBvWUJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-14 Thread fatmcgav
Nan

Cheers again for the info...

Now I think more about it, you may well be right in that it should be part
of the netapp_volume provider...

However I'm not sure that having individual params/properties for each
volume option is the right way - The list of possible volume options
currently stands at 36.. I don't really fancy having to implement a
param/property for each of those... However I could see a single 'options'
hash param/prop working for that... Although then I'm back to the same
challenge of making sure each volume option is set  maintained
correctly...

The other challenge is that to set volume options is a different webservice
call to the volume-list/volume-create method, but I'm guessing I can just
get that handled with another def in the provider...

Thoughts?

Cheers
Gav


On 14 November 2012 17:29, Nan Liu n...@puppetlabs.com wrote:

 On Wed, Nov 14, 2012 at 8:56 AM, Gavin Williams fatmc...@gmail.comwrote:

 Cheers for the response... Looks like I've got some more reading to do to
 get my head around some of the more complex stuff...


 I'm not sure why netapp_volume_options is a separate resource. You are
 already managing the volume state in netapp_volume, and all netapp volume
 options should be properties in netapp_volume instead.

 Think you're right in that I'm trying to treat the options as a whole,
 rather than individual items...


 The resource seems to make more sense modeled as:

 netapp_volume { 'example':
   ensure = present,
   initsize = '2GB',
   convert_ucode = 'on',
   no_atime_update = 'on',
 }

 The provider exists? method should simply return true if the volume is
 present and it should not compare the property values (that's what Puppet
 does for you). One key difference is volume options should be newproperty.
 So far you implemented all attributes as parameters, and puppet will not
 retrieve and compare parameter values (i.e. it will not call
 initsize/initsize= method).

 The convert_ucode method return the option value. and convert_ucode=
 method updates the setting.


 Am I better off moving to a prefetch/flush style provider, rather than
 the getter/setting method?


 I would avoid prefetch/flush until you have the provider working with
 individual get/set first.

 Thanks,

 Nan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-13 Thread fatmcgav
John

Cheers for the response.

As per my other threads, I'm writing a NetApp Network device module for
Puppet.

One of the functions required is the ability to set 'options' against a
given volume.
What I want to do is create a provider that accepts a volume name and a
list of volume options with their corresponding settings, and then iterate
through the provided list making a webservice call for each option.

So to give a better example of the provider in pastebin:
netapp_volume_options { 'v_puppet_test12111508':
options = ['convert_ucode=on', 'no_atime_update=on'],
}

Have just pushed my latest code to Github here:
https://github.com/fatmcgav/fatmcgav-netapp/tree/master/lib/puppet/provider/netapp_volume_options

I did manage to get it working after a bit of googling... However am happy
to take suggestions if there is a better method :)

Cheers
Gavin



On 13 November 2012 15:12, jcbollinger john.bollin...@stjude.org wrote:



 On Tuesday, November 13, 2012 8:47:00 AM UTC-6, Gavin Williams wrote:

 Afternoon all

 Is it possible to pass an array of key=value pairs to a provider param,
 and have the provider split and handle each key=value pair?

 Basically, I've defined a new provider and type as follows:
 http://pastebin.com/WdekYPAh



 I can't see your code because pastebin is blocked to me, but I may be able
 to give you some advice anyway:

1. You can pass an array of key=value pairs as a parameter to a
provider, and the provider can parse it any way you like.
2. BUT you should not try to populate *other* parameters' values that
way.  If you define a parameter that accepts a complex, structured value,
then the entire value belongs to the parameter to which it is assigned.
3. Wouldn't a hash be a better fit to the data than an array of
key/value pairs anyway?

 What are you trying to achieve by this approach?  There is likely a better
 way.


 John

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/yDOmbdqEY_sJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-13 Thread fatmcgav
Nan

Cheers for the response.

Yes this is just a parameter...

What's the easiest way to work with them in the provider?

Cheers
Gavin
On Nov 13, 2012 7:00 PM, Nan Liu n...@puppetlabs.com wrote:

 On Tue, Nov 13, 2012 at 7:33 AM, fatmcgav fatmc...@gmail.com wrote:

 One of the functions required is the ability to set 'options' against a
 given volume.
 What I want to do is create a provider that accepts a volume name and a
 list of volume options with their corresponding settings, and then iterate
 through the provided list making a webservice call for each option.

 So to give a better example of the provider in pastebin:
 netapp_volume_options { 'v_puppet_test12111508':
 options = ['convert_ucode=on', 'no_atime_update=on'],
 }


 Yeah this seems to make more sense as a hash:

 options = { 'convert_ucode' = 'on', 'no_atime_update' = 'on' }

 I'm assuming this is just parameter, if it's a property add the following
 method to the type and you should get a reasonable output:

 def should_to_s(v)
   v.inspect
 end

 def is_to_s(v)
   v.inspect
 end

 Thanks,

 Nan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Pass Array as param to custom provider...

2012-11-13 Thread fatmcgav
Nan

Cheers again...

Looks like overriding the 'insync?' method is the way to go, as I'm only
interested in checking/setting property values that are being passed
through...

Any insync? examples that I could refer to?

Cheers
Gavin


On 13 November 2012 19:50, Nan Liu n...@puppetlabs.com wrote:

 On Tue, Nov 13, 2012 at 11:19 AM, Gavin Williams fatmc...@gmail.comwrote:

 After a quick google, came up with:

 #!/usr/bin/env ruby

 grades = { Bob = 82,
Jim = 94,
Billy = 58
  }

 grades.each do|name,grade|
   puts #{name}: #{grade}
 end


 So now all I need to do is pull the existing options values and compile a
 hash to compare in the exists?, and use the above in the create...



 Quick question on the create - how will it handle one property that
 matches, but one property that doesn't?


 You need a hash diff between current values and desired values and iterate
 through the difference. Hash properties are a bit more work, because the
 retrieve method may return more options than you care to set. You have the
 option to either munge and include default value to the user supplied
 value, or override insync? method so the comparison operation does not
 invoke option= method if the user specified value is a subset of the return
 hash from the option method.

 Alternatively if you only have a short number of options, you can just
 implement them as properties instead.

 Thanks,

 Nan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: err: Could not request certificate when I run puppet device

2012-11-05 Thread fatmcgav
Try changing the file owner/group to match what you're running puppet as...

Gav

On 5 November 2012 20:51, meiji wang wangme...@gmail.com wrote:

 Although I change the mode to 0777, Puppet forces the mode to 0750

 debug: /File[/var/opt/lib/pe-puppet/devices/certname/state]: Autorequiring
 File[/var/opt/lib/pe-puppet/devices/certname]
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/clientbucket]/mode:
 mode changed '0777' to '0750'
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/ssl]/mode: mode
 changed '0777' to '0771'
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/ssl/private]/mode:
 mode changed '0777' to '0750'
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/state]/mode: mode
 changed '0777' to '1755'
 debug:
 /File[/var/opt/lib/pe-puppet/devices/certname/ssl/private_keys]/mode: mode
 changed '0777' to '0750'
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/client_yaml]/mode:
 mode changed '0777' to '0750'
 debug: /File[/var/opt/lib/pe-puppet/devices/certname/client_data]/mode:
 mode changed '0777' to '0750'
 info: Creating a new SSL key for certname
 ..
 err: Could not request certificate: Could not write
 /var/opt/lib/pe-puppet/devices/certname/ssl/private_keys/certname.pem to
 privatekeydir: Permission denied -
 /var/opt/lib/pe-puppet/devices/certname/ssl/private_keys/certname.pem


 then Puppet throws error message..

 Meiji


 On Monday, November 5, 2012 8:18:03 AM UTC-8, meiji wang wrote:

 1.   I get the following error when I run “puppet device’

 err: Could not request certificate: Could not write
 /var/opt/lib/pe-puppet/**devices/certname/ssl/private_**keys/certname.pem
 to privatekeydir: Permission denied - /var/opt/lib/pe-puppet/**
 devices/certname/ssl/private_**keys/certname.pem

 Any thought?


 Thanks,

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/CEDQ4q9o5uEJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet Network Devices...

2012-11-01 Thread fatmcgav
Afternoon all,

in the hunt to find a mechanism to manage our new NetApp filer
configuration using puppet, I've stumbled across the 'Puppet Network
Devices' functionality introduced in 2. 7. The idea looks perfect in
principle, however it looks like no-ones implemented support for NetApp
filers as yet...

So before I embark on writing the a module to support the NetApp, I thought
I'd ask the people more versed in puppet than myself if there are any known
issues, challenges gotchas, tips or tricks etc to guide me on my way...

So, what's the verdict?

Any help/advice greatly received, and thanks in advance for any responses.

Regards
Gavin

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Puppet Oracle Database config management

2012-10-25 Thread fatmcgav
Tim

Cool, Cheers for that.
Some good food for thought there...

Cheers again.
Gav
On Oct 25, 2012 6:20 PM, Tim Mooney tim.moo...@ndsu.edu wrote:

 In regard to: Re: [Puppet Users] Puppet  Oracle Database config...:

  Have you got any examples of the hiera config you're using?


 As I said, it's pretty rough.

 class oracledb::sysctl(
   $use_amm = false,
   $large_mem_pages = '0',
   $hugetlb_gid = '1001',
 ) {

   validate_bool($use_amm)
   validate_string($large_mem_**pages)
   validate_string($hugetlb_gid)

   if ( $use_amm and ($large_mem_pages != '0')) {
 fail(\$use_amm must be false when \$large_mem_pages is not 0\n)
   }

   #
   # The basic settings that should always be present.  Can be overridden
   # via hiera().
   #

   # sem, default is '250 32000 100 128'
   sysctl::set{'kernel.sem':
 value = hiera('oracle_sysctl_sem', '250 32000 100 128')
   }

   # shmmni
   sysctl::set{'kernel.shmmni':
 value   = hiera('oracle_sysctl_shmmni', '4096'),
 require = Sysctl::Set['kernel.sem'],
   }

   # file_max
   sysctl::set{'fs.file-max':
 value   = hiera('oracle_sysctl_file_max'**, '6815744'),
 require = Sysctl::Set['kernel.shmmni'],
   }

   sysctl::set{'fs.aio-max-nr':
 value   = hiera('oracle_sysclt_aio_max_**nr', '1048576'),
 require = Sysctl::Set['fs.file-max'],
   }


   # ip local port range.
   sysctl::set{'net.ipv4.ip_**local_port_range':
 value   = hiera('oracle_sysctl_ip_local_**port_range', '9000 65500'),
 require = Sysctl::Set['fs.aio-max-nr'],
   }

   # network buffer defaults
   sysctl::set{'net.core.rmem_**default':
 value   = hiera('oracle_sysctl_rmem_**default', '262144'),
 require = Sysctl::Set['net.ipv4.ip_**local_port_range'],
   }

   sysctl::set{'net.core.rmem_**max':
 value   = hiera('oracle_sysctl_rmem_max'**, '4194304'),
 require = Sysctl::Set['net.core.rmem_**default'],
   }

   sysctl::set{'net.core.wmem_**default':
 value   = hiera('oracle_sysctl_wmem_**default', '262144'),
 require = Sysctl::Set['net.core.rmem_**max'],
   }

   sysctl::set{'net.core.wmem_**max':
 value   = hiera('oracle_sysctl_wmem_max'**, '1048576'),
 require = Sysctl::Set['net.core.wmem_**default'],
   }

   sysctl::set{'vm.swappiness':
 value   = hiera('oracle_sysctl_**swappiness', '0'),
 require = Sysctl::Set['net.core.wmem_**max'],
   }

   #
   # Only if AMM is false and $large_mem_pages  0 do we set these
   #
   if (!$use_amm and ($large_mem_pages  0)) {
 sysctl::set{'vm.nr_hugepages':  value = $large_mem_pages }
 #1001 is the dba group which the oracle user belongs to
 sysctl::set{'vm.hugetlb_shm_**group': value = $hugetlb_gid }
   }
 }


 We've talked about having the sysctl class also make certain that
 /dev/shm is mounted and of the appropriate size if $use_amm is true, but
 that hasn't been done yet.

 All of the other setup (limits.conf, paths, user, groups) happens in
 oracledb::serverbase, which doesn't use hiera and is more or less specific
 to our environment.

 Tim

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to puppet-users+unsubscribe@**
 googlegroups.com puppet-users%2bunsubscr...@googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/puppet-users?hl=enhttp://groups.google.com/group/puppet-users?hl=en
 .



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Puppet Oracle Database config management

2012-10-24 Thread fatmcgav
Afternoon all.

I've been reading around on Puppet and Oracle, and have come up with a few
links that suggest how to get Oracle installed and base configured, which
has got me started in the right direction on that.

My next challenge is maintaining Oracle database specific configuration on
the relevant hosts. This contains various elements, such as /etc/oratab,
/etc/oranfstab (as we're using dNFS), various NFS mounts required for a
given database, and a few other bits and pieces...
Ideally, it would be a 1-to-1 relationship between a given host and a given
DB. However that's unlikely in our env - We're more likely to have 1 or
multiple databases on a given host, which all need to be maintained.

My initial thoughts are to use something like hiera to maintain this
configuration data.
Is this my best approach? Any other suggestions? Anyone doing this for
real?

Basically, any info/pointers you give me is greatly appreciated.

Regards
Gavin

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Re: Glassfish custom provider and 'file does not exist'

2012-10-24 Thread fatmcgav
Stefan

Cheers for the feedback.

Understood on the exists element.

Yes, what I'm trying to achieve is a working provider without asadmin being
in the path. That's what I've worked towards by using a full path to the
relevant asadmin file, as it's possible a given node could have one or more
versions of glassfish installed.

Currently, the asadmin path gets calculated using several parameter values,
which allows a user calling the class to override any given parameter.

The actual command execution appears to work as expected currently, though
will take another look at the execute command.

Cheers
Gavin
On Oct 24, 2012 6:15 PM, Stefan Schulte stefan.schu...@taunusstein.net
wrote:

 On Wed, Oct 24, 2012 at 03:38:20AM -0700, Gavin Williams wrote:
  Ok, I've gone about it a slightly different way now, and have stripped
 the
  'commands' argument from the domain function provider, and am trying to
  validate the presence of asadmin at the main asadmin.rb level.
 
  I've created an 'exists?' definition, but it doesn't appear to be getting
  called. Any ideas how I can force it to be called prior to attempting to
  execute asadmin?
 
  Latest code commit has been pushed to github, available here:
 
 https://github.com/fatmcgav/puppet-glassfish/commit/429f9e8e1d08e99c69d8ffdcb3043648af5fa18a
 
  Any comments welcome.
 
  Regards
  Gavin

 Your exists? method in puppet/provider/domain/el.rb overwrites the
 exists? method in puppet/provider/asadmin.rb. I don't know if you get
 problems when you have an el.rb file but you define an asadmin provider
 here. This may create classname clashes with the asadmin provider defined
 in
 provider/asadmin.rb

 The exists? method in asadmin.rb is not going to work because `commands`
 is a class method while `exists` is an instance method. It does make no
 sense to call `commands` inside an instance method.

 What exactly are you trying to archive anyhow? If the excutable is not in
 PATH how should your provider work? The best approach in my opinion
 is to always specify the full path to the executable. If you want your
 provider considered suitable even if commands are missing, you can use

   optional_commands :asadmin = 'binary_that_may_be_absent'

 If you want the user to supply the path to the binary via a resource
 parameter then you cannot realize this at a class level but at an
 instance level. That beeing said, you cannot define your executables
 with use the `commands` method.

 To execute something you can use the execute method. You then have to
 do something like.

   output = execute([resource[:asadmin_binary], arg1, arg2])

 -Stefan

 
  On Wednesday, 26 September 2012 17:01:47 UTC+1, Gavin Williams wrote:
  
   Hi there,
  
   I'm trying to setup Glassfish config management using puppet.
   I've found larstobi's module here
   https://github.com/larstobi/puppet-glassfish/which I've cloned and
 am
   starting to tweak, as it would appear that the mentioned module is
 based on
   Solaris, therefore I'm starting to add support for EL. My code tree is
   here https://github.com/fatmcgav/puppet-glassfish.
  
   The challenge I'm hitting currently is that upon executing, it's
 failing
   with
  
   *err: Could not find a suitable provider for domain*
  
  
   When running at debug level, I can see the following:
  
   *debug: Puppet::Type::Domain::ProviderAsadmin: file asadmin does not
   exist
   debug: Class[Glassfish::Domain]: The container Stage[main] will
 propagate
   my refresh event
   err: Could not find a suitable provider for domain
   *
  
  
   I've verified that the asadmin file exists, as follows:
  
   *notice: /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message:
   defined 'message' as 'Creating Glassfish domain cms using portbase
 9000.
Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'*
  
  
   *# file /usr/local/glassfish-3.1.2/bin/asadmin
   /usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text
 executable
   *
  
  
   So the file definitely exists, and is a valid 'asadmin' file.
  
   Any ideas?
  
   Cheers
   Gavin
  
 
  --
  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/-/_pJvxmzaEmUJ.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.
 

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



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

Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-10-21 Thread fatmcgav
Josh

Cheers for the info.
Are there any references on how to set the path when executing child
processes?

Cheers
Gavin
On Oct 19, 2012 6:03 PM, Josh Cooper j...@puppetlabs.com wrote:

 Hi Gavin,

 On Fri, Oct 19, 2012 at 9:35 AM, Gavin Williams fatmc...@gmail.com
 wrote:
  Ok, I've found what was causing the provider to fail...
 
  Changed as follows:
 
  diff --git a/lib/puppet/provider/domain/asadmin.rb
  b/lib/puppet/provider/domain/asadmin.rb
  index 940c051..384f6ab 100644
  --- a/lib/puppet/provider/domain/asadmin.rb
  +++ b/lib/puppet/provider/domain/asadmin.rb
  @@ -2,7 +2,7 @@
   Puppet::Type.type(:domain).provide(:asadmin,
  :parent =
 Puppet::Provider::Asadmin) do
 desc Glassfish support.
  -  commands :asadmin = asadmin
  +  commands :asadmin = /usr/local/glassfish-3.1.2/bin/asadmin
 
 def create
   args = []
 
  Any ideas how I can make commands use a variable?
 
  Cheers
  Gavin
 
  On Monday, 15 October 2012 11:40:16 UTC+1, Gavin Williams wrote:
 
  Just got back from holiday, and need to get this one going...
 
  Any ideas on how I can proceed?
 
  Cheers
  Gavin
 
  On 29 September 2012 08:21, fatmcgav fatmc...@gmail.com wrote:
 
  Stefan
 
  Yes, the code is all in github.
  https://github.com/fatmcgav/puppet-glassfish
 
  Cheers
  Gav
 
  On Sep 29, 2012 1:28 AM, Stefan Schulte
  stefan.schu...@taunusstein.net wrote:
 
  On Fri, Sep 28, 2012 at 10:39:11AM +0100, fatmcgav wrote:
   Ok, so I thought I'd take another look, and try and get some debug
   logging
   out of the provider to make sure it's constructing things
 correctly...
  
   I've applied the following patch to asadmin.rb, however I'm not
 seeing
   anything on the client trace...
  
   diff --git a/lib/puppet/provider/asadmin.rb
   b/lib/puppet/provider/asadmin.rb
index f95d6ab..c8bd4a7 100644
--- a/lib/puppet/provider/asadmin.rb
+++ b/lib/puppet/provider/asadmin.rb
@@ -8,6 +8,7 @@
 passed_args.each { |arg| args  arg }
 exec_args = args.join  
 command = #{@resource[:asadminpath]} #{exec_args}
+Puppet.debug(Command = #{command})
 command = su - #{@resource[:user]} -c \#{command}\ if
@resource[:user] and
   not command.match /create-service/
 self.debug command
   
  
   Any ideas how I can get the provider logging???
  
   Cheers
   Gavin
  
 
  do you have the code somewhere? If you dropped the debug call in the
  create method or something it will never be executed if puppet thinks
  the provider is not valid at all.
 
  So having the actual provider code may make is more obvious why it is
  failing for you.
 
  -Stefan
 
  --
  You received this message because you are subscribed to the Google
  Groups Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.
 
 
  --
  You received this message because you are subscribed to the Google Groups
  Puppet Users group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/puppet-users/-/hGGzpUwCUxsJ.
 
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.

 Puppet uses its `path` setting to resolve unqualified executables in
 commands[1]. You can specify this on a per-agent basis, or you can
 provide an environment or I've recently filed a ticket to add a
 per-resource path metaparameter[2]. If you're writing your own
 provider, you can also specify an environment that puppet will use to
 execute the child process.

 Josh

 [1] http://docs.puppetlabs.com/references/latest/configuration.html#path
 [2] http://projects.puppetlabs.com/issues/16997
 --
 Josh Cooper
 Developer, Puppet Labs

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-10-15 Thread fatmcgav
Just got back from holiday, and need to get this one going...

Any ideas on how I can proceed?

Cheers
Gavin

On 29 September 2012 08:21, fatmcgav fatmc...@gmail.com wrote:

 Stefan

 Yes, the code is all in github.
 https://github.com/fatmcgav/puppet-glassfish

 Cheers
 Gav
 On Sep 29, 2012 1:28 AM, Stefan Schulte stefan.schu...@taunusstein.net
 wrote:

 On Fri, Sep 28, 2012 at 10:39:11AM +0100, fatmcgav wrote:
  Ok, so I thought I'd take another look, and try and get some debug
 logging
  out of the provider to make sure it's constructing things correctly...
 
  I've applied the following patch to asadmin.rb, however I'm not seeing
  anything on the client trace...
 
  diff --git a/lib/puppet/provider/asadmin.rb
 b/lib/puppet/provider/asadmin.rb
   index f95d6ab..c8bd4a7 100644
   --- a/lib/puppet/provider/asadmin.rb
   +++ b/lib/puppet/provider/asadmin.rb
   @@ -8,6 +8,7 @@
passed_args.each { |arg| args  arg }
exec_args = args.join  
command = #{@resource[:asadminpath]} #{exec_args}
   +Puppet.debug(Command = #{command})
command = su - #{@resource[:user]} -c \#{command}\ if
   @resource[:user] and
  not command.match /create-service/
self.debug command
  
 
  Any ideas how I can get the provider logging???
 
  Cheers
  Gavin
 

 do you have the code somewhere? If you dropped the debug call in the
 create method or something it will never be executed if puppet thinks
 the provider is not valid at all.

 So having the actual provider code may make is more obvious why it is
 failing for you.

 -Stefan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-09-29 Thread fatmcgav
Stefan

Yes, the code is all in github. https://github.com/fatmcgav/puppet-glassfish

Cheers
Gav
On Sep 29, 2012 1:28 AM, Stefan Schulte stefan.schu...@taunusstein.net
wrote:

 On Fri, Sep 28, 2012 at 10:39:11AM +0100, fatmcgav wrote:
  Ok, so I thought I'd take another look, and try and get some debug
 logging
  out of the provider to make sure it's constructing things correctly...
 
  I've applied the following patch to asadmin.rb, however I'm not seeing
  anything on the client trace...
 
  diff --git a/lib/puppet/provider/asadmin.rb
 b/lib/puppet/provider/asadmin.rb
   index f95d6ab..c8bd4a7 100644
   --- a/lib/puppet/provider/asadmin.rb
   +++ b/lib/puppet/provider/asadmin.rb
   @@ -8,6 +8,7 @@
passed_args.each { |arg| args  arg }
exec_args = args.join  
command = #{@resource[:asadminpath]} #{exec_args}
   +Puppet.debug(Command = #{command})
command = su - #{@resource[:user]} -c \#{command}\ if
   @resource[:user] and
  not command.match /create-service/
self.debug command
  
 
  Any ideas how I can get the provider logging???
 
  Cheers
  Gavin
 

 do you have the code somewhere? If you dropped the debug call in the
 create method or something it will never be executed if puppet thinks
 the provider is not valid at all.

 So having the actual provider code may make is more obvious why it is
 failing for you.

 -Stefan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-09-28 Thread fatmcgav
Stefan

Was running puppet agent using 'sudo'...

However just tried using root and no difference...

Asadmin definitely exists and has got the right permissions, as shown below:

# file /usr/local/glassfish-3.1.2/bin/asadmin
 /usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text executable
 # ls -l /usr/local/glassfish-3.1.2/bin/asadmin
 -rwxr-xr-x. 1 nobody glassfish 2262 Sep 18 16:23
 /usr/local/glassfish-3.1.2/bin/asadmin


Thoughts?

Cheers
Gavin

On 28 September 2012 06:14, Stefan Schulte
stefan.schu...@taunusstein.netwrote:

 On Thu, Sep 27, 2012 at 12:57:01PM +0100, fatmcgav wrote:
  Hi there
 
  I thought that initially as well, so I modified the provider to use a
 full
  path rather than assume it was on the path.
 
  The log files below are prints of the variables which are being passed
  around...
 
  Cheers
  Gav
  On Sep 27, 2012 12:53 PM, Dick Davies rasput...@hellooperator.net
 wrote:
 
 [...]
notice: /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message:
 defined
'message' as 'Creating Glassfish domain cms using portbase 9000.
 Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'
# file /usr/local/glassfish-3.1.2/bin/asadmin
/usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text
   executable
 [...]

 Has the file the executable bit set for the user that is running the
 script (probably root)?

 -Stefan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-09-28 Thread fatmcgav
Ok, so I thought I'd take another look, and try and get some debug logging
out of the provider to make sure it's constructing things correctly...

I've applied the following patch to asadmin.rb, however I'm not seeing
anything on the client trace...

diff --git a/lib/puppet/provider/asadmin.rb b/lib/puppet/provider/asadmin.rb
 index f95d6ab..c8bd4a7 100644
 --- a/lib/puppet/provider/asadmin.rb
 +++ b/lib/puppet/provider/asadmin.rb
 @@ -8,6 +8,7 @@
  passed_args.each { |arg| args  arg }
  exec_args = args.join  
  command = #{@resource[:asadminpath]} #{exec_args}
 +Puppet.debug(Command = #{command})
  command = su - #{@resource[:user]} -c \#{command}\ if
 @resource[:user] and
not command.match /create-service/
  self.debug command


Any ideas how I can get the provider logging???

Cheers
Gavin

On 28 September 2012 08:58, fatmcgav fatmc...@gmail.com wrote:

 Stefan

 Was running puppet agent using 'sudo'...

 However just tried using root and no difference...

 Asadmin definitely exists and has got the right permissions, as shown
 below:

 # file /usr/local/glassfish-3.1.2/bin/asadmin
 /usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text executable
 # ls -l /usr/local/glassfish-3.1.2/bin/asadmin
 -rwxr-xr-x. 1 nobody glassfish 2262 Sep 18 16:23
 /usr/local/glassfish-3.1.2/bin/asadmin


 Thoughts?

 Cheers
 Gavin

 On 28 September 2012 06:14, Stefan Schulte stefan.schu...@taunusstein.net
  wrote:

 On Thu, Sep 27, 2012 at 12:57:01PM +0100, fatmcgav wrote:
  Hi there
 
  I thought that initially as well, so I modified the provider to use a
 full
  path rather than assume it was on the path.
 
  The log files below are prints of the variables which are being passed
  around...
 
  Cheers
  Gav
  On Sep 27, 2012 12:53 PM, Dick Davies rasput...@hellooperator.net
 wrote:
 
 [...]
notice: /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message:
 defined
'message' as 'Creating Glassfish domain cms using portbase 9000.
 Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'
# file /usr/local/glassfish-3.1.2/bin/asadmin
/usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text
   executable
 [...]

 Has the file the executable bit set for the user that is running the
 script (probably root)?

 -Stefan

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Glassfish custom provider and 'file does not exist'

2012-09-27 Thread fatmcgav
Hi there

I thought that initially as well, so I modified the provider to use a full
path rather than assume it was on the path.

The log files below are prints of the variables which are being passed
around...

Cheers
Gav
On Sep 27, 2012 12:53 PM, Dick Davies rasput...@hellooperator.net wrote:

 At a guess the asadmin command isn't in puppetd's $PATH.
 Maybe try a full path to the executable to confirm?

 On 26 September 2012 17:01, Gavin Williams fatmc...@gmail.com wrote:
  Hi there,
 
  I'm trying to setup Glassfish config management using puppet.
  I've found larstobi's module here which I've cloned and am starting to
  tweak, as it would appear that the mentioned module is based on Solaris,
  therefore I'm starting to add support for EL. My code tree is here.
 
  The challenge I'm hitting currently is that upon executing, it's failing
  with
 
  err: Could not find a suitable provider for domain
 
 
  When running at debug level, I can see the following:
 
  debug: Puppet::Type::Domain::ProviderAsadmin: file asadmin does not
 exist
  debug: Class[Glassfish::Domain]: The container Stage[main] will
 propagate
  my refresh event
  err: Could not find a suitable provider for domain
 
 
  I've verified that the asadmin file exists, as follows:
 
  notice: /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message: defined
  'message' as 'Creating Glassfish domain cms using portbase 9000.
   Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'
 
 
  # file /usr/local/glassfish-3.1.2/bin/asadmin
  /usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text
 executable
 
 
  So the file definitely exists, and is a valid 'asadmin' file.
 
  Any ideas?
 
  Cheers
  Gavin
 
  --
  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/-/A_85G-eU3TwJ.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/puppet-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.