[Puppet Users] Re: augeas to setm enabled=0 in yum repos?

2015-04-16 Thread Guy Matz
OK!  This seems to work:
setm /files/etc/yum.repos.d/CentOS-Base.repo/*[label() != '#comment']
enabled 0"

But for a set of stanzas like this:
[base]
name=CentOS-$releasever - Base
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
blah, blah blah

the 'enabled=0' line gets added after the comment, e.g.
[base]
name=CentOS-$releasever - Base
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
*enabled=0*
[updates]
blah, blah blah

When it would be so much better if the line got added above the comment
under the gpgkey line . . .

I'm nitpicking here, I know!!  Any suggestions?

Thanks so much for all of the help up to this point!  ;-)

On Thu, Apr 16, 2015 at 12:15 PM, Guy Matz  wrote:

> No, I was wrong . .  that doesn't work with augtool.  It seems to, but
> won't save . . .
>
> On Thu, Apr 16, 2015 at 12:00 PM, Guy Matz  wrote:
>
>> This works with augtool but not in puppet:
>>
>>   augeas { 'disable all other repos in CentOS Base':
>> context => '/files/etc/yum.repos.d/CentOS-Base.repo',
>> changes => [
>>   'setm /files/etc/yum.repos.d/CentOS-Base.repo/* enabled 0'
>> ]
>>   }
>>
>> Any thoughts would be appreciated!
>>
>> On Thu, Apr 16, 2015 at 9:21 AM, Guy Matz  wrote:
>>
>>> Hi!  I'm trying to disable yum repos using augeas and can't quite figure
>>> out how to set enabled=0 for all repos in a yum file.  I've got this:
>>>
>>>   augeas { 'disable all repos in CentOS Base':
>>> context => '/files/etc/yum.repos.d/CentOS-Base.repo',
>>> changes => [
>>>   'setm */enabled . 0'
>>> ]
>>>   }
>>>
>>> Which works if a repo has an enabled line.  The problem is that it
>>> doesn't *add* an enabled line to a repo that does not.  For example, the
>>> enabled line here will get set to enabled=0:
>>> [centosplus]
>>> name=CentOS-$releasever - Plus
>>> mirrorlist=
>>> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
>>> #baseurl=
>>> http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
>>> gpgcheck=1
>>> enabled=1
>>> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>>>
>>> but an enabled=0 will not get added to this:
>>> [base]
>>> name=CentOS-$releasever - Base
>>> mirrorlist=
>>> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
>>> #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
>>> gpgcheck=1
>>> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>>>
>>>
>>> Anyone know how/if I can hit these two birds with one stone?
>>>
>>> Thanks!!
>>>
>>
>>
>

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


[Puppet Users] Re: augeas to setm enabled=0 in yum repos?

2015-04-16 Thread Guy Matz
No, I was wrong . .  that doesn't work with augtool.  It seems to, but
won't save . . .

On Thu, Apr 16, 2015 at 12:00 PM, Guy Matz  wrote:

> This works with augtool but not in puppet:
>
>   augeas { 'disable all other repos in CentOS Base':
> context => '/files/etc/yum.repos.d/CentOS-Base.repo',
> changes => [
>   'setm /files/etc/yum.repos.d/CentOS-Base.repo/* enabled 0'
> ]
>   }
>
> Any thoughts would be appreciated!
>
> On Thu, Apr 16, 2015 at 9:21 AM, Guy Matz  wrote:
>
>> Hi!  I'm trying to disable yum repos using augeas and can't quite figure
>> out how to set enabled=0 for all repos in a yum file.  I've got this:
>>
>>   augeas { 'disable all repos in CentOS Base':
>> context => '/files/etc/yum.repos.d/CentOS-Base.repo',
>> changes => [
>>   'setm */enabled . 0'
>> ]
>>   }
>>
>> Which works if a repo has an enabled line.  The problem is that it
>> doesn't *add* an enabled line to a repo that does not.  For example, the
>> enabled line here will get set to enabled=0:
>> [centosplus]
>> name=CentOS-$releasever - Plus
>> mirrorlist=
>> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
>> #baseurl=
>> http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
>> gpgcheck=1
>> enabled=1
>> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>>
>> but an enabled=0 will not get added to this:
>> [base]
>> name=CentOS-$releasever - Base
>> mirrorlist=
>> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
>> #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
>> gpgcheck=1
>> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>>
>>
>> Anyone know how/if I can hit these two birds with one stone?
>>
>> Thanks!!
>>
>
>

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


[Puppet Users] Re: augeas to setm enabled=0 in yum repos?

2015-04-16 Thread Guy Matz
This works with augtool but not in puppet:

  augeas { 'disable all other repos in CentOS Base':
context => '/files/etc/yum.repos.d/CentOS-Base.repo',
changes => [
  'setm /files/etc/yum.repos.d/CentOS-Base.repo/* enabled 0'
]
  }

Any thoughts would be appreciated!

On Thu, Apr 16, 2015 at 9:21 AM, Guy Matz  wrote:

> Hi!  I'm trying to disable yum repos using augeas and can't quite figure
> out how to set enabled=0 for all repos in a yum file.  I've got this:
>
>   augeas { 'disable all repos in CentOS Base':
> context => '/files/etc/yum.repos.d/CentOS-Base.repo',
> changes => [
>   'setm */enabled . 0'
> ]
>   }
>
> Which works if a repo has an enabled line.  The problem is that it doesn't
> *add* an enabled line to a repo that does not.  For example, the enabled
> line here will get set to enabled=0:
> [centosplus]
> name=CentOS-$releasever - Plus
> mirrorlist=
> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
> #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
> gpgcheck=1
> enabled=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>
> but an enabled=0 will not get added to this:
> [base]
> name=CentOS-$releasever - Base
> mirrorlist=
> http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
> #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
> gpgcheck=1
> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
>
>
> Anyone know how/if I can hit these two birds with one stone?
>
> Thanks!!
>

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


[Puppet Users] augeas to setm enabled=0 in yum repos?

2015-04-16 Thread Guy Matz
Hi!  I'm trying to disable yum repos using augeas and can't quite figure
out how to set enabled=0 for all repos in a yum file.  I've got this:

  augeas { 'disable all repos in CentOS Base':
context => '/files/etc/yum.repos.d/CentOS-Base.repo',
changes => [
  'setm */enabled . 0'
]
  }

Which works if a repo has an enabled line.  The problem is that it doesn't
*add* an enabled line to a repo that does not.  For example, the enabled
line here will get set to enabled=0:
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

but an enabled=0 will not get added to this:
[base]
name=CentOS-$releasever - Base
mirrorlist=
http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


Anyone know how/if I can hit these two birds with one stone?

Thanks!!

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


[Puppet Users] Re: Precedence Q: repos -> packages

2015-04-13 Thread Guy Matz
Anything?

Appreciated!
Guy

On Wed, Apr 8, 2015 at 5:58 PM, Guy Matz  wrote:

> Hi!  I first used this sort of thing:
> stage { 'yum' : before => Stage['main'] }
>
> and tagged ll of my yumrepos with a stage of yum.  This doesn't work so
> well for downloaded modules, so I'm thinking of using:
> Yumrepo <| |> -> Package <| |>
>
> Is there a downside?  Any recommendations?
>
> Thanks,
> Guy
>
> P.S. - Sorry for asking; I'm sure this has been asked a zillion times, but
> I haven't been able to find a good answer.
>

-- 
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/CABnTgtUR1yUSA%2BXJGKOyTJXSA%2BeoUEuJwm6b%3D%3Dg%2BYRojhEUSHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Precedence Q: repos -> packages

2015-04-08 Thread Guy Matz
Hi!  I first used this sort of thing:
stage { 'yum' : before => Stage['main'] }

and tagged ll of my yumrepos with a stage of yum.  This doesn't work so
well for downloaded modules, so I'm thinking of using:
Yumrepo <| |> -> Package <| |>

Is there a downside?  Any recommendations?

Thanks,
Guy

P.S. - Sorry for asking; I'm sure this has been asked a zillion times, but
I haven't been able to find a good answer.

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


Re: [Puppet Users] facter: unordered hashes lead to changes

2015-04-08 Thread Guy Matz
I *did* misunderstand!  Thanks for pointing that out!  Much better now!

On Wed, Apr 8, 2015 at 8:57 AM, jcbollinger 
wrote:

>
>
> On Tuesday, April 7, 2015 at 2:53:38 PM UTC-5, Guy Matz wrote:
>>
>> Ahhh!!   The version of facter on my new servers is 2.4 . .   old servers
>> have 1.7 . . .anyone know how to get facter 2.x to stringify facts?
>> I've tried adding 'stringify_facts = true' to my puppet.conf, but that did
>> not change behaviour . .
>>
>
>
> You have misunderstood.  The stringify_facts parameter (of Puppet)
> *defaults* to true, so if you were not configuring it explicitly then it
> was already true.  Christopher was suggesting that you set it to *false*.
> This is an eminently reasonable thing to do even if you were not otherwise
> having any trouble, because this configuration parameter will be removed in
> Puppet 4 (the new behavior being to never stringify facts).
>
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/37c61433-cea1-49b1-92d4-e4a45709dcb1%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/37c61433-cea1-49b1-92d4-e4a45709dcb1%40googlegroups.com?utm_medium=email&utm_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/CABnTgtW3T%3DD264rvOwnkqe3ezmok_7u9buM6gr6mm__NqwLk6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] facter: unordered hashes lead to changes

2015-04-07 Thread Guy Matz
Ahhh!!   The version of facter on my new servers is 2.4 . .   old servers
have 1.7 . . .anyone know how to get facter 2.x to stringify facts?
I've tried adding 'stringify_facts = true' to my puppet.conf, but that did
not change behaviour . . .

On Tue, Apr 7, 2015 at 2:08 PM, Christopher Wood  wrote:

> Sounds like this is set to true (over here I set it to false everywhere to
> take advantage of the non-string facts):
>
>
> https://docs.puppetlabs.com/references/latest/configuration.html#stringifyfacts
>
> On Tue, Apr 07, 2015 at 01:56:43PM -0400, Guy Matz wrote:
> >Hi!  I'm seeing the following at the end of my puppet run:
> >Notice:
> >
> /Stage[main]/Mcollective::Server::Config::Factsource::Yaml/File[/etc/mcollective/facts.yaml]/content:
> >--- /etc/mcollective/facts.yaml 2015-04-07 15:51:25.243758139 +
> >+++ /tmp/puppet-file20150407-6557-wl0qx7-0  2015-04-07
> >17:51:34.770285890 +
> >@@ -57,15 +57,15 @@
> >   operatingsystem: CentOS
> >   operatingsystemmajrelease: "6"
> >   operatingsystemrelease: "6.6"
> >-  os: familyRedHatreleasemajor6full6.6minor6nameCentOS
> >+  os: familyRedHatnameCentOSreleasefull6.6major6minor6
> >   osfamily: RedHat
> >-  partitions:
> >
> sda1uuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4mount/bootsda2size66082816filesystemLVM2_member
> >+  partitions:
> >
> sda1mount/bootuuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4sda2size66082816filesystemLVM2_member
> >os, partitions and a few others change each run . . .  checking a
> single
> >fact shows that facter is returning an unordered has which changes on
> each
> >invocation:
> >$ facter os
> >{"name"=>"CentOS", "family"=>"RedHat", "release"=>{"full"=>"6.6",
> >"minor"=>"6", "major"=>"6"}}
> >$ facter os
> >{"family"=>"RedHat", "name"=>"CentOS", "release"=>{"full"=>"6.6",
> >"major"=>"6", "minor"=>"6"}}
> >I don't remember this ever happening before . . .  what's up with
> that!?
> >Anyone know, off the top of their head, what might be causing this?
> >Thanks!
> >Guy
> >
> >--
> >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 [1]puppet-users+unsubscr...@googlegroups.com.
> >To view this discussion on the web visit
> >[2]
> https://groups.google.com/d/msgid/puppet-users/CABnTgtXOGN4tM-DNYoVK5zSwGWBgZFLC48Y%3Dw6HjA2KViKm49A%40mail.gmail.com
> .
> >For more options, visit [3]https://groups.google.com/d/optout.
> >
> > References
> >
> >Visible links
> >1. mailto:puppet-users+unsubscr...@googlegroups.com
> >2.
> https://groups.google.com/d/msgid/puppet-users/CABnTgtXOGN4tM-DNYoVK5zSwGWBgZFLC48Y%3Dw6HjA2KViKm49A%40mail.gmail.com?utm_medium=email&utm_source=footer
> >3. 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/20150407180816.GA9555%40iniquitous.heresiarch.ca
> .
> 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/CABnTgtXH7u5kEfc9AhaARC0KwBYiY_4n1der6hax7oknxKgymA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] facter: unordered hashes lead to changes

2015-04-07 Thread Guy Matz
Hi!  I'm seeing the following at the end of my puppet run:

Notice:
/Stage[main]/Mcollective::Server::Config::Factsource::Yaml/File[/etc/mcollective/facts.yaml]/content:
--- /etc/mcollective/facts.yaml 2015-04-07 15:51:25.243758139 +
+++ /tmp/puppet-file20150407-6557-wl0qx7-0  2015-04-07
17:51:34.770285890 +
@@ -57,15 +57,15 @@
   operatingsystem: CentOS
   operatingsystemmajrelease: "6"
   operatingsystemrelease: "6.6"
-  os: familyRedHatreleasemajor6full6.6minor6nameCentOS
+  os: familyRedHatnameCentOSreleasefull6.6major6minor6
   osfamily: RedHat
-  partitions:
sda1uuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4mount/bootsda2size66082816filesystemLVM2_member
+  partitions:
sda1mount/bootuuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4sda2size66082816filesystemLVM2_member

os, partitions and a few others change each run . . .  checking a single
fact shows that facter is returning an unordered has which changes on each
invocation:
$ facter os
{"name"=>"CentOS", "family"=>"RedHat", "release"=>{"full"=>"6.6",
"minor"=>"6", "major"=>"6"}}
$ facter os
{"family"=>"RedHat", "name"=>"CentOS", "release"=>{"full"=>"6.6",
"major"=>"6", "minor"=>"6"}}

I don't remember this ever happening before . . .  what's up with that!?
Anyone know, off the top of their head, what might be causing this?

Thanks!
Guy

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


Re: [Puppet Users] Re: How to check if a class is being used?

2015-04-02 Thread Guy Matz
Thanks!!  I'm not sure that solves my problem, though  .. . .and maybe
I'm using "defined" incorrectly . . .  what I really want is a way to check
to see if a class has been included or assigned . . . .  then I would like
to make a decision based on that info.  Does defined tell me if the class
is being used in that run?  Or just if it is defined in puppet at all?
It's beginning to appear that it's the latter.

So, is there any way to tell if a class/subclass is being applied to a
server?

Thanks!

On Thu, Apr 2, 2015 at 7:52 AM, paul.gomersbach 
wrote:

> This is working for me:
>
>   if ! defined(Class['ops_logging']) {
> class { 'ops_logging':
>   collectives   => $collectives,
>   middleware=> $rabbithost,
>   metrics   => $metrics,
>   configuration => $configuration,
>   monitor   => $monitor,
> }
>   }
>
>
> Op woensdag 1 april 2015 20:35:06 UTC+2 schreef guymatz:
>>
>> I've seen some folks say this should work:
>>
>> if defined(::class::subclass)
>>
>> but it doesn't seem to work for me.  Again, any thoughts would be greatly
>> appreciated!
>>
>> Regards,
>> Guy
>>
>> On Wed, Apr 1, 2015 at 11:26 AM, Guy Matz  wrote:
>>
>>> Hi!  I have a process that is controlled by daemontools on some servers,
>>> and by init on other (i know, i know) and I need a way to have a Service
>>> definition when daemontools is not in the run.
>>>
>>> I've tried this:
>>>   unless defined(Class['daemontools']) {
>>> notify { 'I Do not see daemontools': }
>>> service { $dw_service:
>>>   ensure=> 'running'
>>> }
>>>   }
>>>
>>> but that didn't work.  I've also tried Class['Daemontools'].
>>>
>>> Daemontools is the module being used, but it's a actually a subclass,
>>> daemontools::service, that's being called . . .
>>> So I've also tried Class['daemontools::service'] as well as
>>> Class['Daemontools::Service'].  I've tried
>>> Class['::Daemontools::Service'], which didn't work either.
>>>
>>> I added a notify in daemontools::service which gave me this:
>>> Notice: /Stage[main]/Profiles::Dropwizard::Booker-
>>> integration/Daemontools::Service[booker-integration]/Notify[Here I
>>> am!!]/message: defined 'message' as 'Here I am!!'
>>>
>>> So I also tried "unless defined(Class['Daemontools::
>>> Service[booker-integration]']), which, of course, did not work.
>>>
>>> Anyone know what I need to get the "unless" to catch whether I am using
>>> daemontools::service?  And even better, doers anyone know how I could have
>>> debugged this to find this out for myself?
>>>
>>> Thanks so much!
>>> Guy
>>>
>>>
>>  --
> 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/99788530-31bd-455f-b2e4-8801982cd09b%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/99788530-31bd-455f-b2e4-8801982cd09b%40googlegroups.com?utm_medium=email&utm_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/CABnTgtU2zOhdN9kh3T1ACCpdC-AA_Qbsy4qz7%2BgEJq89dm%3DfKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: How to check if a class is being used?

2015-04-02 Thread Guy Matz
Thanks!!  I'm not sure that solves my problem, though  .. . .and maybe
I'm using "defined" incorrectly . . .  what I really want is a way to check
to see if a class has been included or assigned . . . .  then I would like
to make a decision based on that info.  Does defined tell me if the class
is being used in that run?  Or just if it is defined in puppet at all?
It's beginning to appear that it's the latter.

So, is there any way to tell if a class/subclass is being applied to a
server?

Thanks!
Guy

On Thu, Apr 2, 2015 at 7:52 AM, paul.gomersbach 
wrote:

> This is working for me:
>
>   if ! defined(Class['ops_logging']) {
> class { 'ops_logging':
>   collectives   => $collectives,
>   middleware=> $rabbithost,
>   metrics   => $metrics,
>   configuration => $configuration,
>   monitor   => $monitor,
> }
>   }
>
>
> Op woensdag 1 april 2015 20:35:06 UTC+2 schreef guymatz:
>>
>> I've seen some folks say this should work:
>>
>> if defined(::class::subclass)
>>
>> but it doesn't seem to work for me.  Again, any thoughts would be greatly
>> appreciated!
>>
>> Regards,
>> Guy
>>
>> On Wed, Apr 1, 2015 at 11:26 AM, Guy Matz  wrote:
>>
>>> Hi!  I have a process that is controlled by daemontools on some servers,
>>> and by init on other (i know, i know) and I need a way to have a Service
>>> definition when daemontools is not in the run.
>>>
>>> I've tried this:
>>>   unless defined(Class['daemontools']) {
>>> notify { 'I Do not see daemontools': }
>>> service { $dw_service:
>>>   ensure=> 'running'
>>> }
>>>   }
>>>
>>> but that didn't work.  I've also tried Class['Daemontools'].
>>>
>>> Daemontools is the module being used, but it's a actually a subclass,
>>> daemontools::service, that's being called . . .
>>> So I've also tried Class['daemontools::service'] as well as
>>> Class['Daemontools::Service'].  I've tried
>>> Class['::Daemontools::Service'], which didn't work either.
>>>
>>> I added a notify in daemontools::service which gave me this:
>>> Notice: /Stage[main]/Profiles::Dropwizard::Booker-
>>> integration/Daemontools::Service[booker-integration]/Notify[Here I
>>> am!!]/message: defined 'message' as 'Here I am!!'
>>>
>>> So I also tried "unless defined(Class['Daemontools::
>>> Service[booker-integration]']), which, of course, did not work.
>>>
>>> Anyone know what I need to get the "unless" to catch whether I am using
>>> daemontools::service?  And even better, doers anyone know how I could have
>>> debugged this to find this out for myself?
>>>
>>> Thanks so much!
>>> Guy
>>>
>>>
>>  --
> 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/99788530-31bd-455f-b2e4-8801982cd09b%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/99788530-31bd-455f-b2e4-8801982cd09b%40googlegroups.com?utm_medium=email&utm_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/CABnTgtXJLbxE8zCRYq5SHnufdV5eZ5ijRHo27fFxbdrqg_gOig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to check if a class is being used?

2015-04-01 Thread Guy Matz
I've seen some folks say this should work:

if defined(::class::subclass)

but it doesn't seem to work for me.  Again, any thoughts would be greatly
appreciated!

Regards,
Guy

On Wed, Apr 1, 2015 at 11:26 AM, Guy Matz  wrote:

> Hi!  I have a process that is controlled by daemontools on some servers,
> and by init on other (i know, i know) and I need a way to have a Service
> definition when daemontools is not in the run.
>
> I've tried this:
>   unless defined(Class['daemontools']) {
> notify { 'I Do not see daemontools': }
> service { $dw_service:
>   ensure=> 'running'
> }
>   }
>
> but that didn't work.  I've also tried Class['Daemontools'].
>
> Daemontools is the module being used, but it's a actually a subclass,
> daemontools::service, that's being called . . .
> So I've also tried Class['daemontools::service'] as well as
> Class['Daemontools::Service'].  I've tried Class['::Daemontools::Service'],
> which didn't work either.
>
> I added a notify in daemontools::service which gave me this:
> Notice:
> /Stage[main]/Profiles::Dropwizard::Booker-integration/Daemontools::Service[booker-integration]/Notify[Here
> I am!!]/message: defined 'message' as 'Here I am!!'
>
> So I also tried "unless
> defined(Class['Daemontools::Service[booker-integration]']), which, of
> course, did not work.
>
> Anyone know what I need to get the "unless" to catch whether I am using
> daemontools::service?  And even better, doers anyone know how I could have
> debugged this to find this out for myself?
>
> Thanks so much!
> Guy
>
>

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


[Puppet Users] Fwd: How to check if a class is being used?

2015-04-01 Thread Guy Matz
Hi!  I have a process that is controlled by daemontools on some servers,
and by init on other (i know, i know) and I need a way to have a Service
definition when daemontools is not in the run.

I've tried this:
  unless defined(Class['daemontools']) {
notify { 'I Do not see daemontools': }
service { $dw_service:
  ensure=> 'running'
}
  }

but that didn't work.  I've also tried Class['Daemontools'].

Daemontools is the module being used, but it's a actually a subclass,
daemontools::service, that's being called . . .
So I've also tried Class['daemontools::service'] as well as
Class['Daemontools::Service'].  I've tried Class['::Daemontools::Service'],
which didn't work either.

I added a notify in daemontools::service which gave me this:
Notice:
/Stage[main]/Profiles::Dropwizard::Booker-integration/Daemontools::Service[booker-integration]/Notify[Here
I am!!]/message: defined 'message' as 'Here I am!!'

So I also tried "unless
defined(Class['Daemontools::Service[booker-integration]']), which, of
course, did not work.

Anyone know what I need to get the "unless" to catch whether I am using
daemontools::service?  And even better, doers anyone know how I could have
debugged this to find this out for myself?

Thanks so much!
Guy

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


[Puppet Users] How to check if a class is being used?

2015-04-01 Thread Guy Matz
Hi!  I have a process that is controlled by daemontools on some servers,
and by init on other (i know, i know) and I need a way to have a Service
definition when daemontools is not in the run.

I've tried this:
  unless defined(Class['daemontools']) {
notify { 'I Do not see daemontools': }
service { $dw_service:
  ensure=> 'running'
}
  }

but that didn't work.  I've also tried Class['Daemontools'].

Daemontools is the module being used, but it's a actually a subclass,
daemontools::service, that's being called . . .
So I've also tried Class['daemontools::service'] as well as
Class['Daemontools::Service'].  I've tried Class['::Daemontools::Service'],
which didn't work either.

I added a notify in daemontools::service which gave me this:
Notice:
/Stage[main]/Profiles::Dropwizard::Booker-integration/Daemontools::Service[booker-integration]/Notify[Here
I am!!]/message: defined 'message' as 'Here I am!!'

So I also tried "unless
defined(Class['Daemontools::Service[booker-integration]']), which, of
course, did not work.

Anyone know what I need to get the "unless" to catch whether I am using
daemontools::service?  And even better, doers anyone know how I could have
debugged this to find this out for myself?

Thanks so much!
Guy

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


Re: [Puppet Users] Re: Requiring a subclass?

2015-02-09 Thread Guy Matz
Sorry!  Yes, accounts::account is a defined type!  :-(  Sorry . . .

Working now!!  Thanks!!

On Mon, Feb 9, 2015 at 9:01 AM, jcbollinger 
wrote:

>
>
> On Friday, February 6, 2015 at 3:45:30 PM UTC-6, guymatz wrote:
>>
>> Hello!  Is there a way to set the dependency for a resource that is a
>> subclass?  I have an accounts module, and "within" that is
>> accounts::account which contains declarations to create user, group, etc. .
>> . .  I would like to do something like:
>>
>> file {'sdfdsf':
>>  contents => 'sdkfjdsf',
>>  owner=> 'username',
>>  *requires Accounts::account['username'] *
>> }
>>
>> But that doesn't work.  (Error 400 on SERVER: Syntax error at
>> '::account'; expected ']')
>>
>
>
> It doesn't make sense.
>
>1. If accounts::account is a (sub)*class* then its name is
>"accounts::account", and no 'username' has anything to do with it.  In that
>case, a reference to it would be spelled Class['accounts::account'],
>as Thomas said.
>2. Whether it is a subclass (of another class) or not has nothing to
>do with it, but anyway, nothing in what you presented is related to whether
>or not it actually is a subclass.
>3. Except, if the 'username' part is in fact relevant in any way, it
>can only be because accounts::account is a defined type, not a class
>at all (sub- or otherwise).  If it is a defined type, then a reference to
>an instance of it would be spelled "Accounts::Account['username']"
>(every name segment capitalized).
>
>
>
>>
>> I also thought I should be able to say:
>>
>> file {'sdfdsf':
>>  contents => 'sdkfjdsf',
>>  owner=> 'username',
>>  *requires User['username'] *
>> }
>>
>> since it's really the user resource that's at the heart of the matter,
>> but that didn't work either!  Puppet still complains that it "Could not
>> find dependency User[username]"
>>
>
>
> If Puppet even gets to the point of determining whether it can find the
> dependency, then what you in fact tried was different from what you wrote
> above, as the declaration above misspells the 'require' metaparameter and
> omits the association arrow (=>) between that parameter name and its
> value.  We can help you better when you post the code that you are actually
> using, so cut&paste is your friend.
>
> Anyway, if you use a syntactically correct variation on the above, and
> Puppet complains that it could not find the dependency, then the problem is
> that you did not declare the dependency.  The 'require' metaparameter does
> not (indeed cannot) do that for you.  Puppet doesn't need to have
> *already* processed the declaration of User['username'] (or
> Account::Accounts['username']) when it processes the File declaration, but
> it needs to see such a declaration somewhere among the resources declared
> for the target node before it finishes building the catalog.
>
>
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/73a1d4ec-6ad0-481a-b6ab-2381c3308a18%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/CABnTgtUqpcafCrX8q%3DHqtiy0buYbpyez5bQ-fmbOhwcLpQGYvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Requiring a subclass?

2015-02-06 Thread Guy Matz
Hello!  Is there a way to set the dependency for a resource that is a
subclass?  I have an accounts module, and "within" that is
accounts::account which contains declarations to create user, group, etc. .
. .  I would like to do something like:

file {'sdfdsf':
 contents => 'sdkfjdsf',
 owner=> 'username',
 *requires Accounts::account['username'] *
}

But that doesn't work.  (Error 400 on SERVER: Syntax error at '::account';
expected ']')

I also thought I should be able to say:

file {'sdfdsf':
 contents => 'sdkfjdsf',
 owner=> 'username',
 *requires User['username'] *
}

since it's really the user resource that's at the heart of the matter, but
that didn't work either!  Puppet still complains that it "Could not find
dependency User[username]"

Any thoughts would be appreciated.

Thanks,
Guy

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


Re: [Puppet Users] Re: camptocamp/grundics accounts module

2015-01-19 Thread Guy Matz
Mickaël,
Thanks for the reply!!  Is there an updated version of the module that you
recommend I use?

One other thing . . .  where do you put the class block that pulls in the
hiera data?

Thanks a lot!
Guy

On Sun, Jan 18, 2015 at 1:23 AM, Mickaël Canévet 
wrote:

> If you still want to use *ssh_authorized_key_title*, you have some
> examples in unit tests.
>
> Le vendredi 16 janvier 2015 18:40:06 UTC+1, guymatz a écrit :
>>
>> Is anyone using camptocamp or grundic's accounts module?  I can't it
>> working and am at my wit's end!
>>
>> my problem is with the ssh_authorized_key_title . . .  I'm getting the
>> error:
>> Error 400 on SERVER: stack level too deep at /etc/puppet/modules/accounts/
>> manifests/authorized_key.pp:35
>>
>> But I think I have everything set up correctly:
>> In my modules/profiles/manifests/base.pp I have:
>>   class { 'accounts':
>> groups   => hiera_hash('accounts::groups', {}),
>> ssh_keys => hiera_hash('accounts::ssh_keys', {}),
>> users=> hiera_hash('accounts::users', {}),
>> usergroups   => hiera_hash('accounts::usergroups', {}),
>> accounts => hiera_hash('accounts::accounts', {}),
>> *ssh_authorized_key_title =>
>> '%{ssh_keys[\'%{ssh_key}\'][\'comment\'] on %{user}',*
>> dotfiles => hiera_hash('accounts::dotfiles', {}),
>>   }
>>
>> So that should put all of that info into my run, yes?  Is there a better
>> place to put that?
>>
>> Then in hiera I have:
>> $ more hieradata/common_users.eyaml
>> accounts::ssh_keys:
>>   iambot:
>> comment: iambot@somewhere
>> type: ssh-dss
>> public: public_key
>>
>> accounts::users:
>>   iambot:
>> uid: 10079
>> gid: 10022
>> comment: I am a Bot
>>
>> accounts::groups:
>>   Staff:
>> gid: 10022
>>
>> It seems that with camptocamp's implementation you then need to call
>> accounts::account like this to get the user created:
>> accounts::account { 'iambot': }
>>
>> But with Grundic's it seems you have to add an accounts::account block to
>> the yaml above:
>> accounts::account:
>>   iambot:
>> groups:
>>   - Staff
>> authorized_keys:
>>   - iambot
>>
>> Is that right?
>>
>> Anyway, I can get around the stack level error by replacing the contents
>> of the *ssh_authorized_key_title* with something "static", but would
>> prefer to have it as is.
>>
>> Any ideas?  ;-/
>>
>> Thanks a lot,
>> Guy
>>
>  --
> 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/47654e48-2065-4788-a4eb-213711c2fdb4%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/CABnTgtVk7nbi7TTMrB5un-eu%2Bz%3DVHcLAjRsUquvH3EqTZkB-Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] camptocamp/grundics accounts module

2015-01-16 Thread Guy Matz
Is anyone using camptocamp or grundic's accounts module?  I can't it
working and am at my wit's end!

my problem is with the ssh_authorized_key_title . . .  I'm getting the
error:
Error 400 on SERVER: stack level too deep at
/etc/puppet/modules/accounts/manifests/authorized_key.pp:35

But I think I have everything set up correctly:
In my modules/profiles/manifests/base.pp I have:
  class { 'accounts':
groups   => hiera_hash('accounts::groups', {}),
ssh_keys => hiera_hash('accounts::ssh_keys', {}),
users=> hiera_hash('accounts::users', {}),
usergroups   => hiera_hash('accounts::usergroups', {}),
accounts => hiera_hash('accounts::accounts', {}),
*ssh_authorized_key_title => '%{ssh_keys[\'%{ssh_key}\'][\'comment\']
on %{user}',*
dotfiles => hiera_hash('accounts::dotfiles', {}),
  }

So that should put all of that info into my run, yes?  Is there a better
place to put that?

Then in hiera I have:
$ more hieradata/common_users.eyaml
accounts::ssh_keys:
  iambot:
comment: iambot@somewhere
type: ssh-dss
public: public_key

accounts::users:
  iambot:
uid: 10079
gid: 10022
comment: I am a Bot

accounts::groups:
  Staff:
gid: 10022

It seems that with camptocamp's implementation you then need to call
accounts::account like this to get the user created:
accounts::account { 'iambot': }

But with Grundic's it seems you have to add an accounts::account block to
the yaml above:
accounts::account:
  iambot:
groups:
  - Staff
authorized_keys:
  - iambot

Is that right?

Anyway, I can get around the stack level error by replacing the contents of
the *ssh_authorized_key_title* with something "static", but would prefer to
have it as is.

Any ideas?  ;-/

Thanks a lot,
Guy

-- 
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/CABnTgtU-5ju7dD6foU4M-pEaZ1_dtSEVZg9XWfv3%3DzFDSyswRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: facter & external-dir

2014-12-24 Thread Guy Matz
I guess if the answer had been more of a puppet answer, my question would
have been more of a puppet question.  :-)

Sorry to bother.

Thanks,
Guy

On Wed, Dec 24, 2014 at 12:42 PM, Craig White  wrote:

> Not really a puppet question or a puppet answer
>
> man alias (bash command)
>
> You should be able to alias the command and put into bash_profile for all
> users when they login.
>
> On Wednesday, December 24, 2014 10:28:09 AM UTC-7, guymatz wrote:
>>
>> Is there any way to get facter to return facts from /etc/facter/facts.d
>> when not run as root?  I would like to centralize my facts and not have to
>> remember to add --external-dir when checking facts.
>>
>> Thank you all!!  And Happy Holidays!
>>
>  --
> 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/5be7866d-8c64-4e14-b03d-3bfff1bb83cc%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/CABnTgtVEOcsYUTukUbTGxMNowtCSHGUHd%2BJOZoSRfDqV-dcmTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] facter & external-dir

2014-12-24 Thread Guy Matz
Is there any way to get facter to return facts from /etc/facter/facts.d
when not run as root?  I would like to centralize my facts and not have to
remember to add --external-dir when checking facts.

Thank you all!!  And Happy Holidays!

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


Re: [Puppet Users] Re: modern data pattern?

2014-12-17 Thread Guy Matz
Working now!  If I quote the hiera call I can get dynamic lookups:
class profiles::dropwizard (
  $dw_service = 'dw_service_UNDEFINED',
  $amqp_host = hiera("${dw_service}::amqp_host")
)

Thanks!

On Wed, Dec 17, 2014 at 4:48 PM, Guy Matz  wrote:
>
> So I can't use a hash?  I'm trying to make a general use parameterized
> class using a profile . . .  Can I do something like this so I only have to
> pass in the service name that I want to configure from my node definition:
>
> class profiles::dropwizard (
>   $dw_service = 'dw_service_UNDEFINED',
>   $amqp_host = hiera($dw_service::amqp_host)
> )
>
> than my role would be:
> class roles::showroom inherits roles::base {
>   class { profiles::dropwizard:
> dw_service => 'showroom',
>}
> }
>
> Hiera isn't able to find the above, and i've tried with varying curly
> braces.  Sorry if this is getting convoluted & out of scope.
>
> On Wed, Dec 17, 2014 at 3:56 PM, Byron Miller  wrote:
>>
>> Guy,
>>
>> The example you have like..
>>
>> class showap(
>>$amqp_host,
>>.
>>   )
>>
>> Pattern is a "parameterized class" pattern.
>>
>> it's so you could have a site/node.pp or an ENC provide the
>> parameters/values.
>>
>> node yourserver {
>>
>>   class { 'showap' : amqp_host => 'TRUE'}
>>
>> }
>>
>> or if you wish, hiera will do automagic lookups of class parameters
>>
>> https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup
>>
>> i tend to keep the parameterized class pattern since its fairly portable,
>> works with hiera & enc's and once you've seen it, it does't look so scary..
>>   46 parameters is a lot, but not unheard of..
>>
>> -byron
>>
>> On Wednesday, December 17, 2014 2:02:24 PM UTC-6, guymatz wrote:
>>>
>>> Hi!  I'm taking over someone's code and have found the following class
>>> signature - it's been abbreviated considerably; over 46 vars get used!!:
>>>
>>> class showapp (
>>>   $amqp_host,
>>>   $amqp_password,
>>>   $amqp_port,
>>>   $amqp_user,
>>> .
>>> .
>>> .
>>>
>>>   $queue_service_host,
>>>   $queue_service_port,
>>>   $redis_host,
>>>   $redis_port,
>>>   )
>>> It looks like they thought that any hiera vars that were going to be
>>> used in the template needed to be defined in the class signature (this
>>> isn't right, is it?).
>>> these vars are defined in hiera and are needed to populate a template
>>> defined elsewhere in the class.I'd rather not have to define every var
>>> in my manifest, e.g.:
>>> $amqp_host = hiera(showapp::amqp_host)
>>>
>>> I think I'd rather have a hash defined in hiera that I can pull into my
>>> class with one call, e.g.:
>>> $showapp_data = hiera(showapp)
>>> then use as a hash, e.g.
>>> $showapp_data[amqp_host]
>>>
>>> Is that the way to go?  Will it work?  Is there a better way?
>>>
>>> If you're gotten this far, thank you, thank you, thank you!
>>>
>>> Guy
>>>
>>>  --
>> 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/368c7156-cbcd-4165-a499-3d4a886e58cc%40googlegroups.com
>> <https://groups.google.com/d/msgid/puppet-users/368c7156-cbcd-4165-a499-3d4a886e58cc%40googlegroups.com?utm_medium=email&utm_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/CABnTgtXdUSqD1fTHSBhpRLszBc6ORq7ZT5YWiakT_-MtWa5Dzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: modern data pattern?

2014-12-17 Thread Guy Matz
So I can't use a hash?  I'm trying to make a general use parameterized
class using a profile . . .  Can I do something like this so I only have to
pass in the service name that I want to configure from my node definition:

class profiles::dropwizard (
  $dw_service = 'dw_service_UNDEFINED',
  $amqp_host = hiera($dw_service::amqp_host)
)

than my role would be:
class roles::showroom inherits roles::base {
  class { profiles::dropwizard:
dw_service => 'showroom',
   }
}

Hiera isn't able to find the above, and i've tried with varying curly
braces.  Sorry if this is getting convoluted & out of scope.

On Wed, Dec 17, 2014 at 3:56 PM, Byron Miller  wrote:
>
> Guy,
>
> The example you have like..
>
> class showap(
>$amqp_host,
>.
>   )
>
> Pattern is a "parameterized class" pattern.
>
> it's so you could have a site/node.pp or an ENC provide the
> parameters/values.
>
> node yourserver {
>
>   class { 'showap' : amqp_host => 'TRUE'}
>
> }
>
> or if you wish, hiera will do automagic lookups of class parameters
>
> https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup
>
> i tend to keep the parameterized class pattern since its fairly portable,
> works with hiera & enc's and once you've seen it, it does't look so scary..
>   46 parameters is a lot, but not unheard of..
>
> -byron
>
> On Wednesday, December 17, 2014 2:02:24 PM UTC-6, guymatz wrote:
>>
>> Hi!  I'm taking over someone's code and have found the following class
>> signature - it's been abbreviated considerably; over 46 vars get used!!:
>>
>> class showapp (
>>   $amqp_host,
>>   $amqp_password,
>>   $amqp_port,
>>   $amqp_user,
>> .
>> .
>> .
>>
>>   $queue_service_host,
>>   $queue_service_port,
>>   $redis_host,
>>   $redis_port,
>>   )
>> It looks like they thought that any hiera vars that were going to be used
>> in the template needed to be defined in the class signature (this isn't
>> right, is it?).
>> these vars are defined in hiera and are needed to populate a template
>> defined elsewhere in the class.I'd rather not have to define every var
>> in my manifest, e.g.:
>> $amqp_host = hiera(showapp::amqp_host)
>>
>> I think I'd rather have a hash defined in hiera that I can pull into my
>> class with one call, e.g.:
>> $showapp_data = hiera(showapp)
>> then use as a hash, e.g.
>> $showapp_data[amqp_host]
>>
>> Is that the way to go?  Will it work?  Is there a better way?
>>
>> If you're gotten this far, thank you, thank you, thank you!
>>
>> Guy
>>
>>  --
> 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/368c7156-cbcd-4165-a499-3d4a886e58cc%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/CABnTgtUK-r5jKoAU6v0Wx2WuFKa8GjcYiT1raF3WROpV7e80qw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] modern data pattern?

2014-12-17 Thread Guy Matz
Hi!  I'm taking over someone's code and have found the following class
signature - it's been abbreviated considerably; over 46 vars get used!!:

class showapp (
  $amqp_host,
  $amqp_password,
  $amqp_port,
  $amqp_user,
.
.
.

  $queue_service_host,
  $queue_service_port,
  $redis_host,
  $redis_port,
  )
It looks like they thought that any hiera vars that were going to be used
in the template needed to be defined in the class signature (this isn't
right, is it?).
these vars are defined in hiera and are needed to populate a template
defined elsewhere in the class.I'd rather not have to define every var
in my manifest, e.g.:
$amqp_host = hiera(showapp::amqp_host)

I think I'd rather have a hash defined in hiera that I can pull into my
class with one call, e.g.:
$showapp_data = hiera(showapp)
then use as a hash, e.g.
$showapp_data[amqp_host]

Is that the way to go?  Will it work?  Is there a better way?

If you're gotten this far, thank you, thank you, thank you!

Guy

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


[Puppet Users] Hiera has stopped working correctly!

2014-12-16 Thread Guy Matz
Hiera is not honoring my hierarchy :-(

gmatz@bunnybear ~/Code/puppet $ cat hiera.yaml
---
:hierarchy:
  *- "%{::environment}"*
  - common
:backends:
  - eyaml
  - yaml
:merge_behavior: deeper
:eyaml:
  :datadir: /home/gmatz/Code/puppet/hieradata
  :pkcs7_private_key: /home/gmatz/Code/puppet/keys/private_key.pkcs7.pem
  :pkcs7_public_key: /home/gmatz/Code/puppet/keys/public_key.pkcs7.pem
:yaml:
  :datadir: /home/gmatz/Code/puppet/hieradata

gmatz@bunnybear ~/Code/puppet $ grep activemq_password
hieradata/production.eyaml
activemq_password: &activemq_password ENC[PKCS7,MIIBeQYJKggEhMIIBHQIBAD. .
. .

but it only looks for common:

gmatz@bunnybear ~/Code/puppet $ hiera -d -c ~/Code/puppet/hiera.yaml
activemq_password environment=production
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Hiera eYAML backend
starting
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option: datadir =
/home/gmatz/Code/puppet/hieradata
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option:
pkcs7_private_key = /home/gmatz/Code/puppet/keys/private_key.pkcs7.pem
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Set option:
pkcs7_public_key = /home/gmatz/Code/puppet/keys/public_key.pkcs7.pem
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Looking up
activemq_password in eYAML backend
DEBUG: 2014-12-16 09:31:19 -0500: [eyaml_backend]: Looking for data source
common
DEBUG: 2014-12-16 09:31:19 -0500: Hiera YAML backend starting
DEBUG: 2014-12-16 09:31:19 -0500: Looking up activemq_password in YAML
backend
DEBUG: 2014-12-16 09:31:19 -0500: Looking for data source common
nil

Any thoughts would be greatly appreciated!!

Thanks,
Guy

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


[Puppet Users] dynamically named variables?

2014-12-15 Thread Guy Matz
Hi!  I have a parameterized class that accepts a few parameters, one of
which I would like to use in the retrieval of hiera data, e.g.
class foo (  $app_user = 'bar' ) {
file { "/etc/${app_user::etc_dir}":
owner   => 'root',
group   => 'root',
mode=> '0644
}

so app_user should get passed to the class, then ${app_user}::etc_dir
should get resolved by hiera,  If I pass in nagios as app_user, then
nagios::etc_dir should be looked up in hiera.  I can't find the right
combination of curly braces to get this to work.  Should it work?

Thanks a lot,
Guy

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


[Puppet Users] hiera && Boolean values

2012-10-12 Thread Guy Matz
Hi!  Sorry if this has already been discussed . . .

I have a requirement to disallow root logins on my UK servers, but allow
them on my US servers.  I have an sshd_config template and am hoping to use
hiera to get a Yes/No depending on the country.  However It seems that
hiera is having a hard time dealing with Yes/No:

[root@gmatzpupmaster hieradata] $ grep estate_root_perm 70-country/u*
70-country/uk.yaml:estate_root_perm: No
70-country/us.yaml:estate_root_perm: Yes
[root@gmatzpupmaster hieradata] $ hiera  estate_root_perm mserv_loc=uk
/opt/puppet/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0/lib/hiera/backend/puppet_backend.rb:41:in
`lookup': uninitialized constant Hiera::Backend::Puppet_backend::Puppet
(NameError)
from
/opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:160:in
`lookup'
from
/opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:157:in
`each'
from
/opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera/backend.rb:157:in
`lookup'
from /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/lib/hiera.rb:59:in
`lookup'
from /opt/puppet/lib/ruby/gems/1.8/gems/hiera-0.3.0/bin/hiera:208
from /opt/puppet/bin/hiera:19:in `load'
from /opt/puppet/bin/hiera:19
[root@gmatzpupmaster hieradata] $ hiera  estate_root_perm mserv_loc=us
true

If I change the value to something else it works:

[root@gmatzpupmaster hieradata] $ vi 70-country/u*
2 files to edit
[root@gmatzpupmaster hieradata] $ grep estate_root_perm 70-country/u*
70-country/uk.yaml:estate_root_perm: ukukukuk
70-country/us.yaml:estate_root_perm: usususus
[root@gmatzpupmaster hieradata] $ hiera  estate_root_perm mserv_loc=uk
ukukukuk
[root@gmatzpupmaster hieradata] $ hiera  estate_root_perm mserv_loc=us
usususus


Any thoughts?

Thanks a lot,
Guy

-- 
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: Job Listing - Linux Admin in Boulder, CO

2012-09-07 Thread Guy Matz
Hey!  Sorry, I was away on vacation last week . .   Are you in the Boulder
area?  Can you send a resume to guy.m...@markitserv.com?

Thanks,
Guy

On Mon, Aug 27, 2012 at 2:09 PM, Michael Schmitt wrote:

> I'd definitely be interested, but I'm only a junior admin.  I have about 2
> years of experience and I'm still learning.  I'd love to get my foot in the
> door though.  Even if I'm not a good fit for this, does anyone know
> somewhere I could do this and improve my skills?
>
> --
> 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/-/LuZC9VFyVDUJ.
> 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] Re: Job Listing - Linux Admin in Boulder, CO

2012-08-17 Thread Guy Matz
It's not a telecommute position.  No relocation possible.  Sorry for having
not been explicit about that.

And sorry for not giving more details earlier.  The job is for a senior
RedHat Linux DevOps, WWW Admin, NetApp, VMware, etc.

Thanks,
Guy

On Fri, Aug 17, 2012 at 11:36 AM, Guy Matz  wrote:

> Anyone interested?
>
> Thanks,
> Guy
>
> guymatz at gmail
>

-- 
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] Job Listing - Linux Admin in Boulder, CO

2012-08-17 Thread Guy Matz
Anyone interested?

Thanks,
Guy

guymatz at gmail

-- 
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] Recommended network module?

2012-05-03 Thread Guy Matz
Hi!  There are a few network modules out there for managing network
interfaces, routes, etc.  Anyone recommend one over the others?

Thanks

-- 
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] hiera "environmentss" question

2012-05-03 Thread Guy Matz
Hmmm . .   anyone have any idea why environment would not be getting
interpolated?
Cannot find datafile
/etc/puppetlabs/puppet/%{environment}/hieradata/10-host/gmatzpupnode.yaml

I have the following in my node's puppet.conf [agent] section:
environment = default

thanks again,
Guy

On Wed, May 2, 2012 at 6:59 PM, Gary Larizza  wrote:

>
>
> On Wed, May 2, 2012 at 2:51 PM, Ramin K  wrote:
>
>> On 5/2/2012 2:16 PM, Gary Larizza wrote:
>>
>>>I'm using the following which I copied from somewhere. Quotes might
>>>be part of the missing magic. Also I'm not sure you'd want a - in
>>>there either.
>>>
>>>:yaml:
>>>:datadir: '/home/puppet/environments/%{**environment}/hieradata'
>>>
>>>
>>> I would use double-quotes for string interpolation, but this should
>>> work.  I've used this in a couple of on-site engagements, and it has
>>> worked well for us.
>>>
>>
>>I don't think this is correct. If it were, my config should not
>> work at all. In this case single or double quotes should both work. It's my
>> understanding that hiera.yaml is a data file that is going to be parsed and
>> then consumed by Puppet where things like variable interpolation would
>> happen. There isn't any variable interpolation during the parsing so single
>> quotes are more correct.
>>
>> http://www.yaml.org/YAML_for_**ruby.html#single-quoted_**strings
>>
>>
> Yep, like RI said you're totally correct here.  Thanks for correcting :)
>
>
>
>>
>> Ramin
>>
>> --
>> 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 .
>> For more options, visit this group at http://groups.google.com/**
>> group/puppet-users?hl=en
>> .
>>
>>
>
>
> --
>
> Gary Larizza
> Professional Services Engineer
> 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.



[Puppet Users] hiera "environmentss" question

2012-05-02 Thread Guy Matz
Hi!  I am using environments in my puppet setup, and would like to do the
same for hiera.  I used to have this sort of hierarchy:
:hierarchy: - hosts/%{fqdn}
- domain/%{domain}
- whatever/%{some_fact}
- common

with a yaml datadir:
:yaml:
   :datadir: - /etc/puppetlabs/puppet/hieradata

I would like to append %{environment} to my datadir in order to get
separation, however it looks like I can't and will have to do this:
:hierarchy: - %{environment}/hosts/%{fqdn}
- %{environment}/domain/%{domain}
- %{environment}/whatever/%{some_fact}
- %{environment}/common

Can anyone verify that appending %{environment} to datadir won't work?
Does anyone have a good way of separating hiera environments?

Thanks a lot!
Guy

-- 
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] hiera installation problem

2012-03-23 Thread Guy Matz
Gary, thanks for the help, but my puppet master is a frankenstein of (long
explanation) and I think I need to simply reinstall everything . . .

thanks for the help!

Regards

On Fri, Mar 23, 2012 at 1:00 PM, Gary Larizza  wrote:

> Can you print out what the contents of the common::mkuser defined resource
> type is?
>
>
>
> On Fri, Mar 23, 2012 at 7:40 AM, Guy Matz  wrote:
>
>> No, that didn't do it . . .  :-(What I have works on my test server,
>> but not my prod server . . .  Thanks again.
>>
>>
>> On Fri, Mar 23, 2012 at 9:57 AM, Gary Larizza wrote:
>>
>>> Can you single quote the value in your YAML file and then try again?
>>> Does that work?
>>>
>>>
>>>
>>> On Friday, March 23, 2012, Guy Matz  wrote:
>>> > Thanks, guys!
>>> >
>>> > Here's the relevant snippet from my manifest:
>>> >   @common::mkuser {
>>> > 'root':
>>> >   uid=> 0,
>>> >   comment=> 'root',
>>> >   home   => '/root',
>>> >   password   => hiera('rootPassword'),
>>> >   managehome => false;
>>> >
>>> > And here's what it looks like when I run from command-line:
>>> > # hiera -d rootPassword
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Hiera YAML backend starting
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking up rootPassword in
>>> YAML backend
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
>>> 10-host/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/10-host/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 20-env/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/20-env/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
>>> 30-genv/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/30-genv/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
>>> 40-tier-dc/-
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/40-tier-dc/-.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 50-dc/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/50-dc/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 60-app/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/60-app/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
>>> 70-country/
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
>>> /etc/puppetlabs/puppet/hieradata/70-country/.yaml, skipping
>>> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source common
>>> > $1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/
>>> >
>>> > And my yaml file:
>>> > # cat /etc/puppetlabs/puppet/hieradata/common.yaml
>>> > ---
>>> > rootPassword: $1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/
>>> > ntpserver: 10.73.206.12
>>> >
>>> > Again, the error is:
>>> > err: Could not retrieve catalog from remote server: Error 400 on
>>> SERVER: undefined method `empty?' for false:FalseClass at
>>> /etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27
>>> >
>>> > That's the line where my hiera call is in my manifest . . .
>>> >
>>> > Thanks again!!
>>> >
>>> > On Thu, Mar 22, 2012 at 7:52 PM, Gary Larizza 
>>> wrote:
>>> >
>>> > On Thursday, March 22, 2012 at 1:13 PM, Guy Matz wrote:
>>> >
>>> > Hi!  I think I've gone through the hiera install process correctly,
>>> but still getting:
>>> > err: Could not retrieve catalog from remote server: Error 400 on
>>> SERVER: undefined method `empty?' for false:FalseClass at
>>> /etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27 on node
>>> >
>>> > # gem list
>>> >
>>> > *** LOCAL GEMS ***
>>> >
>>> > activerecord (2.3.14)
>>> > activesupport (2.3.14

Re: [Puppet Users] hiera installation problem

2012-03-23 Thread Guy Matz
No, that didn't do it . . .  :-(What I have works on my test server,
but not my prod server . . .  Thanks again.

On Fri, Mar 23, 2012 at 9:57 AM, Gary Larizza  wrote:

> Can you single quote the value in your YAML file and then try again? Does
> that work?
>
>
>
> On Friday, March 23, 2012, Guy Matz  wrote:
> > Thanks, guys!
> >
> > Here's the relevant snippet from my manifest:
> >   @common::mkuser {
> > 'root':
> >   uid=> 0,
> >   comment=> 'root',
> >   home   => '/root',
> >   password   => hiera('rootPassword'),
> >   managehome => false;
> >
> > And here's what it looks like when I run from command-line:
> > # hiera -d rootPassword
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Hiera YAML backend starting
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking up rootPassword in YAML
> backend
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 10-host/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/10-host/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 20-env/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/20-env/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 30-genv/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/30-genv/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
> 40-tier-dc/-
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/40-tier-dc/-.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 50-dc/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/50-dc/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 60-app/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/60-app/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source
> 70-country/
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
> /etc/puppetlabs/puppet/hieradata/70-country/.yaml, skipping
> > DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source common
> > $1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/
> >
> > And my yaml file:
> > # cat /etc/puppetlabs/puppet/hieradata/common.yaml
> > ---
> > rootPassword: $1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/
> > ntpserver: 10.73.206.12
> >
> > Again, the error is:
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> undefined method `empty?' for false:FalseClass at
> /etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27
> >
> > That's the line where my hiera call is in my manifest . . .
> >
> > Thanks again!!
> >
> > On Thu, Mar 22, 2012 at 7:52 PM, Gary Larizza 
> wrote:
> >
> > On Thursday, March 22, 2012 at 1:13 PM, Guy Matz wrote:
> >
> > Hi!  I think I've gone through the hiera install process correctly, but
> still getting:
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> undefined method `empty?' for false:FalseClass at
> /etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27 on node
> >
> > # gem list
> >
> > *** LOCAL GEMS ***
> >
> > activerecord (2.3.14)
> > activesupport (2.3.14)
> > ar-extensions (0.9.5)
> > builder (2.1.2)
> > dalli (1.1.2)
> > hiera (0.2.0)
> > hiera-puppet (0.2.0)
> > multi_json (1.0.3)
> > puppet-module (0.3.4)
> > rack (1.1.3)
> > rake (0.8.7)
> > rubygems-update (1.8.12)
> > sinatra (1.2.6)
> > stomp (1.1.9)
> > tilt (1.3.3)
> >
> > and I downloaded the tar file and uncompressed it in the right place
> according to
> http://puppetlabs.com/blog/first-look-installing-and-using-hiera/
> >
> > I can using the command line:
> > # hiera ntpserver
> > 10.73.206.12
> >
> > but not as a puppet module (see error above)
> >
> > I've found that if i remove the yaml backend from my hiera.yaml, the
> puppet run is successful, i.e. it doesn't complain, however it doesn't read
> from my YAML hiera files!
> >
> > Any advice would be greatly appreciated!
> >
> > Thanks,
> > Guy
> >
> > Guy,
> > What does the hiera function call look like within your Pupp

Re: [Puppet Users] hiera installation problem

2012-03-23 Thread Guy Matz
Thanks, guys!

Here's the relevant snippet from my manifest:
  @common::mkuser {
'root':
  uid=> 0,
  comment=> 'root',
  home   => '/root',
  password   => hiera('rootPassword'),
  managehome => false;

And here's what it looks like when I run from command-line:
# hiera -d rootPassword
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Hiera YAML backend starting
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking up rootPassword in YAML
backend
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 10-host/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/10-host/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 20-env/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/20-env/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 30-genv/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/30-genv/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 40-tier-dc/-
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/40-tier-dc/-.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 50-dc/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/50-dc/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 60-app/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/60-app/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source 70-country/
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Cannot find datafile
/etc/puppetlabs/puppet/hieradata/70-country/.yaml, skipping
DEBUG: Fri Mar 23 09:12:27 -0400 2012: Looking for data source common
$1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/

And my yaml file:
# cat /etc/puppetlabs/puppet/hieradata/common.yaml
---
rootPassword: $1$0DvOGiBl$hDKhH80CetcqW/u6nObQA/
ntpserver: 10.73.206.12

Again, the error is:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
undefined method `empty?' for false:FalseClass at
/etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27

That's the line where my hiera call is in my manifest . . .

Thanks again!!

On Thu, Mar 22, 2012 at 7:52 PM, Gary Larizza  wrote:

>
> On Thursday, March 22, 2012 at 1:13 PM, Guy Matz wrote:
>
> Hi!  I think I've gone through the hiera install process correctly, but
> still getting:
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> undefined method `empty?' for false:FalseClass at
> /etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27 on node
>
> # gem list
>
> *** LOCAL GEMS ***
>
> activerecord (2.3.14)
> activesupport (2.3.14)
> ar-extensions (0.9.5)
> builder (2.1.2)
> dalli (1.1.2)
> hiera (0.2.0)
> hiera-puppet (0.2.0)
> multi_json (1.0.3)
> puppet-module (0.3.4)
> rack (1.1.3)
> rake (0.8.7)
> rubygems-update (1.8.12)
> sinatra (1.2.6)
> stomp (1.1.9)
> tilt (1.3.3)
>
> and I downloaded the tar file and uncompressed it in the right place
> according to
> http://puppetlabs.com/blog/first-look-installing-and-using-hiera/
>
> I can using the command line:
> # hiera ntpserver
> 10.73.206.12
>
> but not as a puppet module (see error above)
>
> I've found that if i remove the yaml backend from my hiera.yaml, the
> puppet run is successful, i.e. it doesn't complain, however it doesn't read
> from my YAML hiera files!
>
> Any advice would be greatly appreciated!
>
> Thanks,
> Guy
>
>
> Guy,
>
> What does the hiera function call look like within your Puppet manifest?
>  It sounds like you may be trying to set a default to an empty string or
> something like this?  I've seen this error before, but it might help to see
> a bit of your manifest and what a YAML file looks like that contains your
> value?
>
> Thanks!
>
>
>
> P.S. - my hiera.yaml looks like:
> :backends: - yaml
>- puppet
>
> :logger: console
>
> :hierarchy: - 10-host/%{fqdn}
> - 20-env/%{env}
> - 30-genv/%{mserv_genv}
> - 40-tier-dc/%{mserv_tier}-%{mserv_dc}
> - 50-dc/%{mserv_dc}
> - 60-app/%{mserv_app}
> - 70-country/%{mserv_loc}
> - common
> :yaml:
>:datadir: /etc/puppetlabs/puppet/hieradata
>
> :puppet:
>:datasource: data
>
>  --
> 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 fr

[Puppet Users] hiera installation problem

2012-03-22 Thread Guy Matz
Hi!  I think I've gone through the hiera install process correctly, but
still getting:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
undefined method `empty?' for false:FalseClass at
/etc/puppetlabs/puppet/modules/common/manifests/accounts.pp:27 on node

# gem list

*** LOCAL GEMS ***

activerecord (2.3.14)
activesupport (2.3.14)
ar-extensions (0.9.5)
builder (2.1.2)
dalli (1.1.2)
hiera (0.2.0)
hiera-puppet (0.2.0)
multi_json (1.0.3)
puppet-module (0.3.4)
rack (1.1.3)
rake (0.8.7)
rubygems-update (1.8.12)
sinatra (1.2.6)
stomp (1.1.9)
tilt (1.3.3)

and I downloaded the tar file and uncompressed it in the right place
according to
http://puppetlabs.com/blog/first-look-installing-and-using-hiera/

I can using the command line:
# hiera ntpserver
10.73.206.12

but not as a puppet module (see error above)

I've found that if i remove the yaml backend from my hiera.yaml, the puppet
run is successful, i.e. it doesn't complain, however it doesn't read from
my YAML hiera files!

Any advice would be greatly appreciated!

Thanks,
Guy

P.S. - my hiera.yaml looks like:
:backends: - yaml
   - puppet

:logger: console

:hierarchy: - 10-host/%{fqdn}
- 20-env/%{env}
- 30-genv/%{mserv_genv}
- 40-tier-dc/%{mserv_tier}-%{mserv_dc}
- 50-dc/%{mserv_dc}
- 60-app/%{mserv_app}
- 70-country/%{mserv_loc}
- common
:yaml:
   :datadir: /etc/puppetlabs/puppet/hieradata

:puppet:
   :datasource: data

-- 
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] spaceship operator with a regex!?

2012-03-19 Thread Guy Matz
Hi!  Anyone knoe if it's possible to realize resources with the spaceship
operator checking for regex equality?

Something like:

User<| group =~ /(qa|prod)/ |>

If not, anyone know of another way to do this sort of thing?

Thanks a lot!
Guy

-- 
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] custom fact issue

2012-03-16 Thread Guy Matz
Hi!  Does the following do what you might expect?

fact_name = 'noop'
Facter.add(fact_name) do
  setcode do
utc_hour = %x{/bin/date -u +"%H"}.chomp.to_i
environment = Facter.value(:environment)
#puts "env = #{environment}"
if environment.match("test|dev|qa")
  result = "false"
else
  if utc_hour.between?(1,10)
result = "false"
  else
result = "true"
  end
end
#puts "result #{result}"
result
  end
end


On Fri, Mar 16, 2012 at 10:56 AM, Jemmorey  wrote:

> Would anyone please assist me on this one?  This fact seems to work, but
> it doesn't return when called directly via facter --puppet noop, but the
> resulting facts end up in the reports.
>
> I'm at wits end with this. Thanks!
>
> 
> utc_hour = Facter::Util::Resolution.exec(%q).chomp
>
>
> Facter.add(:noop) do
> setcode do
> environment = Facter.value(:environment)
> if environment.match("test|dev|qa")
> result = false
> else
> if utc_hour.match("01|02|03|04|05|06|07|08|09|10")
> result = false
> else
> result = true
> end
> end
> result
> end
> end
> 
>
> --
> 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/-/Ubou1ggrLusJ.
> 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] Handling unique cases

2012-02-22 Thread Guy Matz
Hello, Everybody!

I need to allow my developers to run a special script on QA servers and
nowhere else.   I put this sort of thing in place:
class app-server {
  packages: foo:; bar:; baz:;

  if $environment == 'qa' {
file {
   'a':
content => ...
  }
}

which feels kinda kludgey to me.  Is there a better way to handle unique
cases like this in puppet?

Thanks, Everybody!
Guy

-- 
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: Template Help Please

2012-01-23 Thread Guy Matz
Is your issue resolved?  It looks like you don't have the correct erb
syntax in your loop

*<%=* scope.lookupvar('resolver::params::resolvers').split(/\s+/).each

I think should be

*<%* scope.lookupvar('resolver::params::resolvers').split(/\s+/).each


On Mon, Jan 23, 2012 at 4:00 PM, ollies...@googlemail.com <
paul.seym...@barcap.com> wrote:

>
>
> On Jan 23, 4:32 pm, Felix Frank 
> wrote:
> > On 01/23/2012 02:48 PM, ollies...@googlemail.com wrote:
> >
> > > host: parse of /etc/resolv.conf failed
> > > ./resolver/templates/resolv.conf.erb:7:in `result': compile error
> > > (SyntaxError)
> > > ./resolver/templates/resolv.conf.erb:4: syntax error
> > > _erbout.concat(( scope.lookupvar('resolver::params::resolvers').split(/
> > > \s+/).each do | ns | ).to_s); _erbout.concat "\n"
> >
> > > ^
> > > ./resolver/templates/resolv.conf.erb:7: syntax error
> > > _erbout
> >
> > Uhuh. Just a wild guess, but: *Does* your template end in a newline
> > character?
> > If not, add one. If in doubt, loose the '-%>' and substitute '%>'
> instead.
> >
> > HTH,
> > Felix
>
> Looks about right to me.
>
> Thanks for the continued help.
>
> Cheers
> Paul
>
> --
> 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.



[Puppet Users] Hiera - Any advice on getting started?

2012-01-13 Thread Guy Matz
my data is getting unwieldy . . .  any advice on migrating to hiera?

Thanks!

-- 
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] so close to getting new type to work!!

2011-11-10 Thread Guy Matz
Fudge!!  Thanks for the pointer, Stefan . . .  Yeah, the lines in
match_providers_with_resources that says:
if resource = match(record, matchers)
# Remove this resource from circulation so we don’t unnecessarily try to
match
matchers.delete(resource.title)
.
.
.

Means that it can never match two lines, I guess!

Thanks again  . . .

On Wed, Nov 9, 2011 at 3:48 PM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Wed, Nov 09, 2011 at 02:45:30PM -0500, Guy Matz wrote:
> > Stefan,
> > Right!  I think.  With a resource that looks like :
> > vncserver { '92':
> >   username => 'athusr',
> >   geometry => '123x78',
> >   ensure => 'present';
> > }
> >
> > I should get two entries in /etc/sysconfig/vncserver:
> > VNCSERVERARGS[92]="-geometry 123x78"
> > VNCSERVERS="$VNCSERVERS 92:athusr"
> >
> > I'm sorry if I am not understanding your post, and responding to it
> > nonsensically.  Are you saying that with a single "name" of 92, I will
> not
> > be able to make changes on two lines?
> >
>
> Yes. Every line in your config file (that is not a text line like a
> comment) will be parsed as one record.  During prefetching puppet tries
> to match the resources the user has defined in his manifest with the
> records of your target file(s).
>
> It works like this
> Puppet iterates over every record.  If puppet has a resource with a name
> that matches the current record's name then puppet creates a provider
> instance
> and assignes the provider to this resource.
>
> So in short
> * each resource has zero or one prefetched provider
> * one provider corresponds to one specific record in your file
>
> Have a look at provider/parsedfile.rb method
> match_providers_with_resources
>
> You may be able to define a custom prefetch_hook method in your
> provider where you merge your different records into one.  But I
> currently don't know how puppet behaves when it has to rewrite the file
> after possible changes.
>
> Untested prefetch hook:
>
>def prefetch_hook(records)
>  merged_records = {} # hash with the record's name as key
>  records.each do |record|
>if name = record[:name]
>  merged_record[name] ||= {}
>  merged_record[name].merge!(record)
>end
>  end
>  merged_records.values
>end
>
> You may get additional suggestions if you look at the cron provider.
>
> But in general I'm afraid that the parsedfile provider is not really
> good when information spanning over multiple lines.
>
> -Stefan
>
> > Thanks a lot!
> > Guy
> >
>

-- 
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] so close to getting new type to work!!

2011-11-09 Thread Guy Matz
Stefan,
Right!  I think.  With a resource that looks like :
vncserver { '92':
  username => 'athusr',
  geometry => '123x78',
  ensure => 'present';
}

I should get two entries in /etc/sysconfig/vncserver:
VNCSERVERARGS[92]="-geometry 123x78"
VNCSERVERS="$VNCSERVERS 92:athusr"

I'm sorry if I am not understanding your post, and responding to it
nonsensically.  Are you saying that with a single "name" of 92, I will not
be able to make changes on two lines?

Thanks a lot!
Guy

On Wed, Nov 9, 2011 at 2:38 PM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Wed, Nov 09, 2011 at 01:08:37PM -0500, Guy Matz wrote:
> > Hi!  I am s close to getting my vncserver type to work; I have one
> last
> > hurdle.  There are two kinds of record lines in a vncserver config file,
> so
> > I have two record_line definitions in my provider.  Only one of them gets
> > called, though!  The one that has the same name, ":parsed", as what I
> pass
> > to provide . . .
> >
> > require 'puppet/provider/parsedfile'
> >
> > vncservers = "/etc/sysconfig/vncservers"
> >
> > Puppet::Type.type(:vncserver).provide(:parsed,
> >   :parent =>
> > Puppet::Provider::ParsedFile,
> >   :filetype => :flat,
> >   :default_target => vncservers
> >   ) do
> >
> >   desc "The vncserver provider that uses the ParsedFile class"
> >
> >   confine :exists => vncservers
> >
> >   text_line :comment, :match => /^\s*#/;
> >   text_line :blank, :match => /^\s*$/;
> >
> >   record_line :parsed_opts,
> >   :fields => %w{name pre_geo_opts geometry post_geo_opts},
> >   :optional => %w{pre_geo_opts post_geo_opts},
> >   :match => /^VNCSERVERARGS\[(\d+)\]="(.*)\s*-geometry
> > (\d+x\d+)(.*)"$/,
> >   :to_line => proc { |record|
> > # Should end up looking like:
> > # VNCSERVERARGS[92]="-geometry 1280x1024"
> > 'VNCSERVERARGS[' + record[:name] +
> >   ']="-geometry ' + record[:geometry] + '"'
> >   };
> >   record_line :parsed_portuser,
> >   :fields => %w{name username},
> >   :match => /^VNCSERVERS="\$VNCSERVERS\s+(\d+):(\w+)\s*"$/,
> >   :to_line => proc { |record|
> > # Should end up looking like:
> > # VNCSERVERS="$VNCSERVERS 2:firstuser"
> > 'VNCSERVERS="$VNCSERVERS ' +
> >   record[:name] + ':' + record[:username] + '"'
> >   };
> > end
> >
> >
> > Thanks a lot!!
> >
> > Guy
>
> To be clear here can you have something like
>
>VNCSERVERARGS[23]=...
>VNCSERVERS="$VNCSERVERS 23:user"
>
> Because after parsing the whole file, puppet will have two records with
> record[:name] = 23 but the contents are not merged.
>
> So when prefetching happens and you have a resource type with the name 23,
> the resource will get a provider with pre_geo_opts, geometry and
> post_geo_opts OR a provider with username set but never both.
>
> -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.



Re: [Puppet Users] NFS clients - puppet hang when mount point

2011-11-09 Thread Guy Matz
OK.  This may seem like a bad idea, but it's a workaround that has worked
for me:
I add the nfs server to the 127.0.0.1 entry of the hosts file which causes
NFS to time out pretty immediately.  :-\

On Wed, Nov 9, 2011 at 10:00 AM, madAndroid  wrote:

> We've only recently discovered that puppet can manage mount points
> using the mount directive;
> however, a short while back we built an nfs client and server classes
> without using this resource, and we've encountered a problem where
> puppet seems to hang when the nfs server is unavailable.
>
> Using --debug doesn't seem to specify exactly at which point the run
> is failing, which could steer us in the right direction around putting
> something in place in the classes in question.
>
> Is there anything we can do, short of switching over to using the
> mount directive/resource, in order to mitigate the problem when the
> nfs server is unavailable? It's preventing us from managing other
> resources on the clients when this happens..
>
> thanks in advance,
> Andrew
>
> --
> 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.



[Puppet Users] so close to getting new type to work!!

2011-11-09 Thread Guy Matz
Hi!  I am s close to getting my vncserver type to work; I have one last
hurdle.  There are two kinds of record lines in a vncserver config file, so
I have two record_line definitions in my provider.  Only one of them gets
called, though!  The one that has the same name, ":parsed", as what I pass
to provide . . .

require 'puppet/provider/parsedfile'

vncservers = "/etc/sysconfig/vncservers"

Puppet::Type.type(:vncserver).provide(:parsed,
  :parent =>
Puppet::Provider::ParsedFile,
  :filetype => :flat,
  :default_target => vncservers
  ) do

  desc "The vncserver provider that uses the ParsedFile class"

  confine :exists => vncservers

  text_line :comment, :match => /^\s*#/;
  text_line :blank, :match => /^\s*$/;

  record_line :parsed_opts,
  :fields => %w{name pre_geo_opts geometry post_geo_opts},
  :optional => %w{pre_geo_opts post_geo_opts},
  :match => /^VNCSERVERARGS\[(\d+)\]="(.*)\s*-geometry
(\d+x\d+)(.*)"$/,
  :to_line => proc { |record|
# Should end up looking like:
# VNCSERVERARGS[92]="-geometry 1280x1024"
'VNCSERVERARGS[' + record[:name] +
  ']="-geometry ' + record[:geometry] + '"'
  };
  record_line :parsed_portuser,
  :fields => %w{name username},
  :match => /^VNCSERVERS="\$VNCSERVERS\s+(\d+):(\w+)\s*"$/,
  :to_line => proc { |record|
# Should end up looking like:
# VNCSERVERS="$VNCSERVERS 2:firstuser"
'VNCSERVERS="$VNCSERVERS ' +
  record[:name] + ':' + record[:username] + '"'
  };
end


Thanks a lot!!

Guy

-- 
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] parsedfile help needed

2011-10-14 Thread Guy Matz
Thanks!  That begs the question:  What's the difference between newparam &
newproperty?

One other thing:  Does anyone know why I would get the following error after
switching from newparam to newproperty?
err: Could not retrieve catalog from remote server: Could not intern from
pson: undefined method `merge' for []:Array

Thanks again,
Guy

On Fri, Oct 14, 2011 at 4:31 AM, Brice Figureau <
brice-pup...@daysofwonder.com> wrote:

> Hi,
>
> On Thu, 2011-10-13 at 17:47 -0400, Guy Matz wrote:
> > Thanks for the reply!!  One more thing I can't quite figure out:  How
> > to get a new entry in my target file!  I can parse, but an entry in
> > manifests doesn't magically appear.  Do I need to add something to my
> > provider or type to get that to happen?  Any help would be s
> > appreciated; i'm getting tired of struggling with this!
> >
> > vncserver/manifests/init.pp
> > class vncserver {
> >   vncserver { 'guymatz':
> >   port => '92',
> >   geometry => '1024x768',
> >   ensure => 'present'
>
> Those are properties: you want to manage them.
>
> >   }
> > } # class vncserver
> >
> >
> > vncserver/lib/puppet/type/vncserver.rb
> > require 'puppet/property/list'
> > require 'puppet/provider/parsedfile'
> >
> > Puppet::Type.newtype(:vncserver) do
> >
> > ensurable
> >
> > newparam(:port) do
> >   desc "The vnc servers port assignment.  Will be +5900 on the
> > server"
> > end
> >
> > newparam(:name) do
> >   isnamevar
> >   desc "The user who will own the VNC session."
> > end
> >
> > newparam(:geometry) do
> >   desc "Resolution for VNC, in XxY, e.g. 1024x768."
> > end
> >
> > newparam(:password) do
> >   desc "Password to be put into users .vnc/passwd."
> > end
> >
> > newparam(:args) do
> >   desc "Optional arguments to be added to the vncserver
> > command-line."
> > end
>
> But you defined them as parameters.
> Use newproperty instead of newparam.
>
> > @doc = "Installs and manages entries for vncservers.  For
> > Redhat-bases
> >   systems, and likely many others, these entries will be in
> >   /etc/sysconfig/vncservers."
> >
> > end
> >
> >
> > and, finally, my very unfinished provider:
> > vncserver/lib/puppet/provider/vncserver/parsed.rb:
> > require 'puppet/provider/parsedfile'
> >
> > vncservers = "/etc/sysconfig/vncservers"
> >
> > Puppet::Type.type(:vncserver).provide(:parsed,
> >   :parent =>
> > Puppet::Provider::ParsedFile,
> >   :default_target => vncservers,
> >   :filetype => :flat
> >   ) do
> >   desc "The vncserver provider that uses the ParsedFile class"
> >   confine :exists => vncservers
> >   text_line :comment, :match => /^\s*#/;
> >   text_line :blank, :match => /^\s*$/;
> >
> >   record_line :parsed,
> >   :joiner => '',
> >   :fields => %w{port geometry optional_args},
> >   :optional => %w{port geometry },
> >   :match => /^VNCSERVERARGS\[(\d+)\]="-geometry (\d+x\d
> > +)(.*)$/,
> >   :to_line => proc { |record|
> > "VNCSERVERARGS[#{record[:port]}]=\"-geometry
> > #{record[:geometry]} #{record[:optional_args]}\""
> >   }
> >
> >   record_line :parsed_again,
> >   :joiner => '',
> >   :fields => %w{port_name},
> >   :optional => %w{port_name},
> >   :match => /^VNCSERVERS="(.*)"$/,
> >   :to_line => proc { |record|
> > "VNCSERVERS=\"#{record[:port_name]}\""
> >   }
> > end
>
> Also, you don't have any property in the type for port_name.
>
>

-- 
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] parsedfile help needed

2011-10-13 Thread Guy Matz
Thanks for the reply!!  One more thing I can't quite figure out:  How to get
a new entry in my target file!  I can parse, but an entry in manifests
doesn't magically appear.  Do I need to add something to my provider or type
to get that to happen?  Any help would be s appreciated; i'm getting
tired of struggling with this!

vncserver/manifests/init.pp
class vncserver {
  vncserver { 'guymatz':
  port => '92',
  geometry => '1024x768',
  ensure => 'present'
  }
} # class vncserver


vncserver/lib/puppet/type/vncserver.rb
require 'puppet/property/list'
require 'puppet/provider/parsedfile'

Puppet::Type.newtype(:vncserver) do

ensurable

newparam(:port) do
  desc "The vnc servers port assignment.  Will be +5900 on the server"
end

newparam(:name) do
  isnamevar
  desc "The user who will own the VNC session."
end

newparam(:geometry) do
  desc "Resolution for VNC, in XxY, e.g. 1024x768."
end

newparam(:password) do
  desc "Password to be put into users .vnc/passwd."
end

newparam(:args) do
  desc "Optional arguments to be added to the vncserver command-line."
end

@doc = "Installs and manages entries for vncservers.  For Redhat-bases
  systems, and likely many others, these entries will be in
  /etc/sysconfig/vncservers."

end


and, finally, my very unfinished provider:
vncserver/lib/puppet/provider/vncserver/parsed.rb:
require 'puppet/provider/parsedfile'

vncservers = "/etc/sysconfig/vncservers"

Puppet::Type.type(:vncserver).provide(:parsed,
  :parent =>
Puppet::Provider::ParsedFile,
  :default_target => vncservers,
  :filetype => :flat
  ) do
  desc "The vncserver provider that uses the ParsedFile class"
  confine :exists => vncservers
  text_line :comment, :match => /^\s*#/;
  text_line :blank, :match => /^\s*$/;

  record_line :parsed,
  :joiner => '',
  :fields => %w{port geometry optional_args},
  :optional => %w{port geometry },
  :match => /^VNCSERVERARGS\[(\d+)\]="-geometry (\d+x\d+)(.*)$/,
  :to_line => proc { |record|
"VNCSERVERARGS[#{record[:port]}]=\"-geometry
#{record[:geometry]} #{record[:optional_args]}\""
  }

  record_line :parsed_again,
  :joiner => '',
  :fields => %w{port_name},
  :optional => %w{port_name},
  :match => /^VNCSERVERS="(.*)"$/,
  :to_line => proc { |record|
"VNCSERVERS=\"#{record[:port_name]}\""
  }
end

-- 
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] How to use parsedfile for more than name

2011-10-13 Thread Guy Matz
Hey!!  Did you ever get anywhere with this?  If so, I'd love to bounce a
couple of things off of you.  The lack of documentation for ParsedFile is
annoying . . .

thanks,
Guy

On Thu, Aug 4, 2011 at 9:35 PM, windowsrefund wrote:

> All,
>
> I'm working on a provider which uses ParsedFile and am running into an
> issue when I use anything more complicated than
>
> record_line :parsed, :fields => %w{name}
>
> If I try to use (for example) :fields => %w{foo, bar, baz}, my content
> ends up in my target file but every run adds another line. I've been
> attempting to figure out what is needed by studying the host type's
> provider but could use some help. I tend to think the answer lies
> somewhere in :match and/or :to_line but I'm not sure what these do.
>
> Any help would greatly appreciated.
>
> Best,
> Adam
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-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] parsedfile help needed

2011-10-12 Thread Guy Matz
hi!
I've seen it reported that there is no official doc for parsedfile; does
anyone know if this is still true?

I'm trying to make a new type and getting stuck on how parsedfile works . .
.  Any help would be appreciated:

regarding the "Puppet::Type.type(:newType).provide" line:
1. What does the ":parsed" label do?  Are there other options?
2. Are there other types of ":filetypes" besides ":flat"?  Does labeling as
:flat have any affect on the parsing?

regarding "record_line":
1. can the "name" parameter be anything?  is ":parsed" anything special?  Is
the name used for anything?
2. what exactly do the parenthetic groupings do, e.g. /^\s+(.*)=(.*):$/   ?
3.  Is there a relationship between the parenthetic groupings and the
":fields" label?
4. what is the relationship between :fields in provider, "newparams" in type
& fields in manifest/init.pp?
  4a. Why do i get the following error when I don't have stuff_1 as
":optional": Could not evaluate: Field 'stuff_1' is required
5. What does :post_parse do?
6 What does :pre_gen do?
7 Are there any other "mystery" parameter?

Thanks s much!!
Guy

-- 
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] Can I merge Virtual Resources?

2011-10-10 Thread Guy Matz
Hi!  I've got a requirement that a few users need to have the same username,
but different passwords on qa & prod server.  The users are currently
defined as
@users which gets realized in an appropriate module, and I've been thinking
about splitting out the users I need to have realized in different
environments and putting them in @qausers & @produsers, hoping that I could
say something like @users = @users + @{$env}users which would then contain
my "main" group of user definitions, plus my environment-specific ones.

Does anyone know of a good way of doing this?  Am I going about this the
wrong way?

Thanks a lot!
Guy

-- 
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] debugging new custom type

2011-09-20 Thread Guy Matz
But to answer your question, vncservers file is a little different . . .
there are two type of lines:
1. contains a space-separated  list of port and usernames separated by
colons, e.g.:
VNCSERVERS="92:gmatz 44:wsmith"

2. contains arguments to be supplied to vncserver, with port number acting
as an aray index, e.g.:
VNCSERVERARGS[92]="-geometry 1280x1024"
VNCSERVERARGS[44]="-geometry 1280x1024"

I was hoping to parse the vncserver config file using two different type of
record_lines, one for each of the line types . . .

thanks,
guy

On Mon, Sep 19, 2011 at 1:48 PM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Thu, Sep 15, 2011 at 04:22:45PM -0400, Guy Matz wrote:
> > hi!  Does anyone have any advice on debugging a new custom type?
> >
> > Any thoughts would be greatly appreciated . . .
> >
> > BTW, I'm getting the error:
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> > Could not render to pson: undefined method `merge' for []:Array
> >
> > with some very rough code.
> >
> > The Type (vncserver.rb):
> > module Puppet
> >   newtype(:vncserver) do
> >
> > ensurable
> >
> > newproperty(:port) do
> [...]
> > newproperty(:username) do
> [...]
> > newproperty(:geometry) do
> [...]
> > end
> >
> > The Provider (parsed.rb):
> [...]
> >   record_line :parsed, :fields => %w{vncservers}, :match =>
> > /^VNCSERVERS="(.*)"/
> >
> > end
> >
>
> You have defined three properties (port, username, geometry) but your
> provider is not able to retrieve or write any of these properties. So
> how does a line in vncservers actually looks like? How can you get port,
> username and geometry of a certain vncserver?
>
> -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.



Re: [Puppet Users] debugging new custom type

2011-09-20 Thread Guy Matz
Stefan, thanks again for your reply.  I'm just trying to get something
working, even if it doesn't actually do anything yet . . .

On Mon, Sep 19, 2011 at 1:48 PM, Stefan Schulte <
stefan.schu...@taunusstein.net> wrote:

> On Thu, Sep 15, 2011 at 04:22:45PM -0400, Guy Matz wrote:
> > hi!  Does anyone have any advice on debugging a new custom type?
> >
> > Any thoughts would be greatly appreciated . . .
> >
> > BTW, I'm getting the error:
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> > Could not render to pson: undefined method `merge' for []:Array
> >
> > with some very rough code.
> >
> > The Type (vncserver.rb):
> > module Puppet
> >   newtype(:vncserver) do
> >
> > ensurable
> >
> > newproperty(:port) do
> [...]
> > newproperty(:username) do
> [...]
> > newproperty(:geometry) do
> [...]
> > end
> >
> > The Provider (parsed.rb):
> [...]
> >   record_line :parsed, :fields => %w{vncservers}, :match =>
> > /^VNCSERVERS="(.*)"/
> >
> > end
> >
>
> You have defined three properties (port, username, geometry) but your
> provider is not able to retrieve or write any of these properties. So
> how does a line in vncservers actually looks like? How can you get port,
> username and geometry of a certain vncserver?
>
> -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.



Re: [Puppet Users] debugging new custom type

2011-09-17 Thread Guy Matz
ok, i found out what pastebin is.  All on my own!!  :-)  But puppet agent
--trace doesn't give me very much output.  Only:
[root@gmatzpupnode ~]# puppet agent --trace
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/daemon.rb:47:in `create_pidfile'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/util.rb:38:in `synchronize_on'
/opt/puppet/lib/ruby/1.8/sync.rb:230:in `synchronize'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/util.rb:38:in `synchronize_on'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/daemon.rb:46:in `create_pidfile'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/daemon.rb:22:in `daemonize'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/agent.rb:255:in
`setup'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in
`exit_on_fail'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:286:in `run'
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in
`execute'
/usr/local/bin/puppet:4
Could not prepare for execution: Could not create PID file:
/var/run/pe-puppet/agent.pid


it looks like it's failing, actually . . .

thanks,
guy

On Thu, Sep 15, 2011 at 6:50 PM, Adrien Thebo  wrote:

> Could you provide the output of puppet agent --trace in a pastebin to
> accompany this?
>
> On Thu, Sep 15, 2011 at 1:22 PM, Guy Matz  wrote:
>
>> hi!  Does anyone have any advice on debugging a new custom type?
>>
>> Any thoughts would be greatly appreciated . . .
>>
>> BTW, I'm getting the error:
>> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
>> Could not render to pson: undefined method `merge' for []:Array
>>
>> with some very rough code.
>>
>> The Type (vncserver.rb):
>> module Puppet
>>   newtype(:vncserver) do
>>
>> ensurable
>>
>> newproperty(:port) do
>>   desc "The vnc servers port assignment.  Will be +5900 on the server"
>> validate do |value|
>>   unless value.is_i?
>> raise Puppet::Error, "Invalid Port number"
>>   end
>> end
>> end
>>
>> newproperty(:username) do
>>   desc "The user who will own the VNC session."
>>   isnamevar
>>   validate do |value|
>> unless value !~ /\s/
>>   raise Puppet::Error, "Must be a valid username. No spaces,
>> please."
>> end
>>   end
>> end
>>
>> newproperty(:geometry) do
>>   desc "Resolution for VNC, in XxY, e.g. 1024x768."
>>   validate do |value|
>> unless value !~ /^\d*x\d*$/
>>   raise Puppet::Error, "Must be a valid geometry. e.g., 1024x768."
>> end
>>   end
>> end
>>
>> newparam(:password) do
>>   desc "Password to be put into users .vnc/passwd."
>>   validate do |value|
>> unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
>>   raise Puppet::Error, "Invalid host name"
>> end
>>   end
>> end
>>
>> newparam(:args) do
>>   desc "Optional arguments to be added to the vncserver command-line."
>>   end
>> end
>>
>> @doc = "Installs and manages entries for vncservers.  For Redhat-bases
>>   systems, and likely many others, these entries will be in
>>   /etc/sysconfig/vncservers."
>>
>> end
>>
>>
>> The Provider (parsed.rb):
>> require 'puppet/provider/parsedfile'
>>
>> vncservers = "/etc/sysconfig/vncservers"
>>
>> Puppet::Type.type(:vncserver).provide(:parsed,
>>   :parent =>
>> Puppet::Provider::ParsedFile,
>>   :default_target => vncservers,
>>   :filetype => :flat
>>   ) do
>>
>>   desc "The vncserver provider that uses the ParsedFile class"
>>
>>   confine :exists => vncservers
>>   text_line :comment, :match => /^#/;
>>   text_line :blank, :match => /\s*$/;
>>
>>   text_line :blank, :match => /\s*$/;
>>
>>   record_line :parsed, :fields => %w{vncservers}, :match =>
>> /^VNCSERVERS="(.*)"/
>>
>> end
>>
>>
>> And The Manifest:
>> class vncserver {
>>
>>   include common::vnc
>>
>>
>>   package {
>> 'tigervnc-server':
>>

Re: [Puppet Users] debugging new custom type

2011-09-17 Thread Guy Matz
Scott,
Thanks for the reply!!  Can you tell me what you mean by "just a
definition"?  or point me to a doc?

Thanks a lot!
Guy

On Thu, Sep 15, 2011 at 8:46 PM, Scott Smith  wrote:

> Hm, doesn't address your issue but you could probably do thus with just a
> definition instead of writing a new type.
> On Sep 15, 2011 1:22 PM, "Guy Matz"  wrote:
> > hi! Does anyone have any advice on debugging a new custom type?
> >
> > Any thoughts would be greatly appreciated . . .
> >
> > BTW, I'm getting the error:
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> > Could not render to pson: undefined method `merge' for []:Array
> >
> > with some very rough code.
> >
> > The Type (vncserver.rb):
> > module Puppet
> > newtype(:vncserver) do
> >
> > ensurable
> >
> > newproperty(:port) do
> > desc "The vnc servers port assignment. Will be +5900 on the server"
> > validate do |value|
> > unless value.is_i?
> > raise Puppet::Error, "Invalid Port number"
> > end
> > end
> > end
> >
> > newproperty(:username) do
> > desc "The user who will own the VNC session."
> > isnamevar
> > validate do |value|
> > unless value !~ /\s/
> > raise Puppet::Error, "Must be a valid username. No spaces,
> > please."
> > end
> > end
> > end
> >
> > newproperty(:geometry) do
> > desc "Resolution for VNC, in XxY, e.g. 1024x768."
> > validate do |value|
> > unless value !~ /^\d*x\d*$/
> > raise Puppet::Error, "Must be a valid geometry. e.g., 1024x768."
> > end
> > end
> > end
> >
> > newparam(:password) do
> > desc "Password to be put into users .vnc/passwd."
> > validate do |value|
> > unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
> > raise Puppet::Error, "Invalid host name"
> > end
> > end
> > end
> >
> > newparam(:args) do
> > desc "Optional arguments to be added to the vncserver command-line."
> > end
> > end
> >
> > @doc = "Installs and manages entries for vncservers. For Redhat-bases
> > systems, and likely many others, these entries will be in
> > /etc/sysconfig/vncservers."
> >
> > end
> >
> >
> > The Provider (parsed.rb):
> > require 'puppet/provider/parsedfile'
> >
> > vncservers = "/etc/sysconfig/vncservers"
> >
> > Puppet::Type.type(:vncserver).provide(:parsed,
> > :parent =>
> > Puppet::Provider::ParsedFile,
> > :default_target => vncservers,
> > :filetype => :flat
> > ) do
> >
> > desc "The vncserver provider that uses the ParsedFile class"
> >
> > confine :exists => vncservers
> > text_line :comment, :match => /^#/;
> > text_line :blank, :match => /\s*$/;
> >
> > text_line :blank, :match => /\s*$/;
> >
> > record_line :parsed, :fields => %w{vncservers}, :match =>
> > /^VNCSERVERS="(.*)"/
> >
> > end
> >
> >
> > And The Manifest:
> > class vncserver {
> >
> > include common::vnc
> >
> >
> > package {
> > 'tigervnc-server':
> > ensure => 'installed';
> > }
> >
> > vncserver {
> > 'gmatz':
> > port => '92',
> > geometry => '1024x768',
> > password => 'gmatz';
> > }
> > }
> >
> > --
> > 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.
>

-- 
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] debugging new custom type

2011-09-17 Thread Guy Matz
Adrien,
Thanks for the reply.  can you tell me what a pastebin is?

Thanks,
Guy

On Thu, Sep 15, 2011 at 6:50 PM, Adrien Thebo  wrote:

> Could you provide the output of puppet agent --trace in a pastebin to
> accompany this?
>
> On Thu, Sep 15, 2011 at 1:22 PM, Guy Matz  wrote:
>
>> hi!  Does anyone have any advice on debugging a new custom type?
>>
>> Any thoughts would be greatly appreciated . . .
>>
>> BTW, I'm getting the error:
>> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
>> Could not render to pson: undefined method `merge' for []:Array
>>
>> with some very rough code.
>>
>> The Type (vncserver.rb):
>> module Puppet
>>   newtype(:vncserver) do
>>
>> ensurable
>>
>> newproperty(:port) do
>>   desc "The vnc servers port assignment.  Will be +5900 on the server"
>> validate do |value|
>>   unless value.is_i?
>> raise Puppet::Error, "Invalid Port number"
>>   end
>> end
>> end
>>
>> newproperty(:username) do
>>   desc "The user who will own the VNC session."
>>   isnamevar
>>   validate do |value|
>> unless value !~ /\s/
>>   raise Puppet::Error, "Must be a valid username. No spaces,
>> please."
>> end
>>   end
>> end
>>
>> newproperty(:geometry) do
>>   desc "Resolution for VNC, in XxY, e.g. 1024x768."
>>   validate do |value|
>> unless value !~ /^\d*x\d*$/
>>   raise Puppet::Error, "Must be a valid geometry. e.g., 1024x768."
>> end
>>   end
>> end
>>
>> newparam(:password) do
>>   desc "Password to be put into users .vnc/passwd."
>>   validate do |value|
>> unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
>>   raise Puppet::Error, "Invalid host name"
>> end
>>   end
>> end
>>
>> newparam(:args) do
>>   desc "Optional arguments to be added to the vncserver command-line."
>>   end
>> end
>>
>> @doc = "Installs and manages entries for vncservers.  For Redhat-bases
>>   systems, and likely many others, these entries will be in
>>   /etc/sysconfig/vncservers."
>>
>> end
>>
>>
>> The Provider (parsed.rb):
>> require 'puppet/provider/parsedfile'
>>
>> vncservers = "/etc/sysconfig/vncservers"
>>
>> Puppet::Type.type(:vncserver).provide(:parsed,
>>   :parent =>
>> Puppet::Provider::ParsedFile,
>>   :default_target => vncservers,
>>   :filetype => :flat
>>   ) do
>>
>>   desc "The vncserver provider that uses the ParsedFile class"
>>
>>   confine :exists => vncservers
>>   text_line :comment, :match => /^#/;
>>   text_line :blank, :match => /\s*$/;
>>
>>   text_line :blank, :match => /\s*$/;
>>
>>   record_line :parsed, :fields => %w{vncservers}, :match =>
>> /^VNCSERVERS="(.*)"/
>>
>> end
>>
>>
>> And The Manifest:
>> class vncserver {
>>
>>   include common::vnc
>>
>>
>>   package {
>> 'tigervnc-server':
>>   ensure => 'installed';
>>   }
>>
>>   vncserver {
>> 'gmatz':
>>   port => '92',
>>   geometry => '1024x768',
>>   password => 'gmatz';
>>   }
>> }
>>
>> --
>> 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.
>>
>
>
>
> --
> Adrien Thebo
> adr...@puppetlabs.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>

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



[Puppet Users] debugging new custom type

2011-09-15 Thread Guy Matz
hi!  Does anyone have any advice on debugging a new custom type?

Any thoughts would be greatly appreciated . . .

BTW, I'm getting the error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not render to pson: undefined method `merge' for []:Array

with some very rough code.

The Type (vncserver.rb):
module Puppet
  newtype(:vncserver) do

ensurable

newproperty(:port) do
  desc "The vnc servers port assignment.  Will be +5900 on the server"
validate do |value|
  unless value.is_i?
raise Puppet::Error, "Invalid Port number"
  end
end
end

newproperty(:username) do
  desc "The user who will own the VNC session."
  isnamevar
  validate do |value|
unless value !~ /\s/
  raise Puppet::Error, "Must be a valid username. No spaces,
please."
end
  end
end

newproperty(:geometry) do
  desc "Resolution for VNC, in XxY, e.g. 1024x768."
  validate do |value|
unless value !~ /^\d*x\d*$/
  raise Puppet::Error, "Must be a valid geometry. e.g., 1024x768."
end
  end
end

newparam(:password) do
  desc "Password to be put into users .vnc/passwd."
  validate do |value|
unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
  raise Puppet::Error, "Invalid host name"
end
  end
end

newparam(:args) do
  desc "Optional arguments to be added to the vncserver command-line."
  end
end

@doc = "Installs and manages entries for vncservers.  For Redhat-bases
  systems, and likely many others, these entries will be in
  /etc/sysconfig/vncservers."

end


The Provider (parsed.rb):
require 'puppet/provider/parsedfile'

vncservers = "/etc/sysconfig/vncservers"

Puppet::Type.type(:vncserver).provide(:parsed,
  :parent =>
Puppet::Provider::ParsedFile,
  :default_target => vncservers,
  :filetype => :flat
  ) do

  desc "The vncserver provider that uses the ParsedFile class"

  confine :exists => vncservers
  text_line :comment, :match => /^#/;
  text_line :blank, :match => /\s*$/;

  text_line :blank, :match => /\s*$/;

  record_line :parsed, :fields => %w{vncservers}, :match =>
/^VNCSERVERS="(.*)"/

end


And The Manifest:
class vncserver {

  include common::vnc


  package {
'tigervnc-server':
  ensure => 'installed';
  }

  vncserver {
'gmatz':
  port => '92',
  geometry => '1024x768',
  password => 'gmatz';
  }
}

-- 
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] ruby functions in puppet DSL

2011-09-08 Thread Guy Matz
Sorry if this has been hashed out before, but I can't find an answer
anywhere . . .

I would like to use the ruby function "upcase" on a variable that gets set
in my site.pp . . .  do I really need to write a custom function for this?
Does anyone have any code I can drop into my puppet code that does basic
ruby functions in puppet, like the upcase I need?

thanks,
guy

-- 
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] What came first, the user or the group?

2011-09-01 Thread Guy Matz
Hi,
I have inherited some code to create users that doesn't work when removing
users . . .  it's listed below.  It works for adding users, but when it
comes to removing users I get:
err: /Stage[main]/Common/Common::Mkuser[oshi.apen]/Group[oshi.apen]/ensure:
change from present to absent failed: Could not delete group oshi.apen:
Execution of '/usr/sbin/groupdel oshi.apen' returned 8: groupdel: cannot
remove the primary group of user 'oshi.apen'

User requires the Group to be defined, which, again, works for adding users,
but not removing.  My instinct is to have a condition test for remove/add
and set the dependencies from there, but that seems klunky and inelegant.
Anyone have any better code for adding/removing users?  A suggestion?

Thanks a lot,
Guy

define common::mkuser (
  $uid,
  $gid= undef,
  $group  = undef,
  $shell  = "/bin/bash",
  $home   = undef,
  $ensure = "present",
  $managehome = true,
  $dotssh = "ensure",
  $comment= "created via puppet",
  $groups = undef,
  $password   = undef,
  $symlink= undef,
  $mode   = undef
) {

  # if gid is unspecified, match with uid
  if $gid {
$mygid = $gid
  } else {
$mygid = $uid
  } # fi $gid

  # if home is unspecified, use /home/
  if $home {
$myhome = $home
  } else {
$myhome = "/home/${name}"
  } # fi $home

  # if group is unspecified, use the username
  if $group {
$mygroup = $group
  } else {
$mygroup = $name
  } # fi $group

  if $password {
$mypassword = $password
  } else {
$mypassword = '!!'
  } # fi $password

  # create user
  user { $name:
uid=> $uid,
gid=> $mygid,
shell  => $shell,
groups => $groups,
password   => $password,
managehome => $managehome,
home   => $myhome,
ensure => $ensure,
comment=> $comment,
require=> Group[$name],
  } # user

  group { $name:
gid=> $mygid,
name   => $mygroup,
ensure => $ensure,
  } # group

  # if link is passed a symlink will be used for ensure => , else we will
make it a directory
  if $symlink {
#$myEnsure = $symlink
$myEnsure = 'symlink'
  } else {
$myEnsure = 'directory'
  } # fi $symlink

  # if mode is unspecified, use 0700
  if $mode {
$myMode = $mode
  } else {
$myMode = '0700'
  } # fi $mode

  if $myEnsure == 'symlink' {
# link home dir
file { "$myhome":
ensure  => symlink,
target  => $symlink,
mode=> $myMode,
owner   => $name,
group   => $name,
require => User["$name"],
} # file

  } else {
# create home dir
file { "$myhome":
#ensure  => $myEnsure,
ensure  => directory,
mode=> $myMode,
owner   => $name,
group   => $name,
require => User["$name"],
} # file
  } # fi $myensure

-- 
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] unable to distribute custom facts

2011-08-12 Thread Guy Matz
Oh, wait . . .  that fact exists solely as an environment variable?  You
haven't put that code in a file for distribution?  Then please ignore my
previous response.  Sorry

On Fri, Aug 12, 2011 at 10:30 AM, newguy  wrote:

> Guys
> I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
> -c 1-2`;) on puppet master, and when I do facter envt it shows the
> desired result, now my problem is that am unable to distribute it to
> the client machines.
>
> I read up a little on adding custom facts and found out the pluginsyc
> would help me but it didnt, I have pluginsync=true on both
> puppetmaster and client but still when I do "sudo puppetd --test --
> pluginsync" on client it says the following:
>
> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
> resource: Could not retrieve information from source(s)
> puppet://puppet/plugins
>
> On client /var/lib/puppet/lib has no directory
> On server /var/lib/puppet/lib has puppet and facter directories
>
> sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
> facter and on server its the same.
>
> Please help.
>
> Thanks
>
> --
> 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] unable to distribute custom facts

2011-08-12 Thread Guy Matz
Where exactly is you fact?  Is it in a module?  My recent experience
required placement of my facts in $modulepath/module/lib/facter . . .

On Fri, Aug 12, 2011 at 10:30 AM, newguy  wrote:

> Guys
> I made a custom fact using export;(export FACTER_envt=`hostname -s|cut
> -c 1-2`;) on puppet master, and when I do facter envt it shows the
> desired result, now my problem is that am unable to distribute it to
> the client machines.
>
> I read up a little on adding custom facts and found out the pluginsyc
> would help me but it didnt, I have pluginsync=true on both
> puppetmaster and client but still when I do "sudo puppetd --test --
> pluginsync" on client it says the following:
>
> err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of
> resource: Could not retrieve information from source(s)
> puppet://puppet/plugins
>
> On client /var/lib/puppet/lib has no directory
> On server /var/lib/puppet/lib has puppet and facter directories
>
> sudo puppetd --configprint factpath on client is  /var/lib/puppet/lib/
> facter and on server its the same.
>
> Please help.
>
> Thanks
>
> --
> 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] Another Custom Fact deployment problem

2011-07-29 Thread Guy Matz
Nan, thanks for the hint!  If I put the facts in module/lib/facter they work
on the client . . .  I used puppet-module to create the module and followed
the directions for creating a custom fact, but I guess they need to go in
module/lib/facter, not module/lib/puppet/facter . . .

thanks a lot everyone!

On Fri, Jul 29, 2011 at 11:54 AM, Guy Matz  wrote:

> hmm . . .   my custom facts are in
> /var/opt/lib/pe-puppet/lib/puppet/facter, but if I put them in
> /var/opt/lib/pe-puppet/lib/facter they *do* show up in facter -p . . .  does
> that mean I am "packaging" my facts incorrectly on the server?  Or is my
> client misconfigured?
> puppet.conf on my client is:
> [main]
> vardir = /var/opt/lib/pe-puppet
> logdir = /var/log/pe-puppet
> rundir = /var/run/pe-puppet
> modulepath = /etc/puppetlabs/puppet/modules
> user = pe-puppet
> group = pe-puppet
>
> [agent]
> certname = gmatzpupnode.mserv.local
> server = gmatzpupmaster.mserv.local
> report = true
> classfile = $vardir/classes.txt
> localconfig = $vardir/localconfig
> graph = true
> pluginsync = true
>
>
> Again, the fact is defined on the server in modules/ldap/lib/puppet/facter
> . . .
>
> Thanks again
>
>
>
> On Fri, Jul 29, 2011 at 11:48 AM, Guy Matz  wrote:
>
>> No!!!  facter -p does *not* show my facts . . .  what does that mean!?
>>
>> thank *you*!
>>
>>
>> On Fri, Jul 29, 2011 at 11:42 AM, Nan Liu  wrote:
>>
>>> On Fri, Jul 29, 2011 at 11:38 AM, Guy Matz  wrote:
>>> > yeah, I got that set . . .  yeah, I should have mentioned that the
>>> facts do
>>> > get downloaded on the client to $vardir/lib/puppet/facter . . .  but
>>> still
>>> > the facts are not available!
>>>
>>> If you run facter -p on the client side does it load the custom fact?
>>> If it's loading the fact successfully on the agent, is this fact
>>> uploaded to the masters $vardir/yaml/facts directory?
>>>
>>> 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] Another Custom Fact deployment problem

2011-07-29 Thread Guy Matz
hmm . . .   my custom facts are in /var/opt/lib/pe-puppet/lib/puppet/facter,
but if I put them in /var/opt/lib/pe-puppet/lib/facter they *do* show up in
facter -p . . .  does that mean I am "packaging" my facts incorrectly on the
server?  Or is my client misconfigured?
puppet.conf on my client is:
[main]
vardir = /var/opt/lib/pe-puppet
logdir = /var/log/pe-puppet
rundir = /var/run/pe-puppet
modulepath = /etc/puppetlabs/puppet/modules
user = pe-puppet
group = pe-puppet

[agent]
certname = gmatzpupnode.mserv.local
server = gmatzpupmaster.mserv.local
report = true
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
graph = true
pluginsync = true


Again, the fact is defined on the server in modules/ldap/lib/puppet/facter .
. .

Thanks again


On Fri, Jul 29, 2011 at 11:48 AM, Guy Matz  wrote:

> No!!!  facter -p does *not* show my facts . . .  what does that mean!?
>
> thank *you*!
>
>
> On Fri, Jul 29, 2011 at 11:42 AM, Nan Liu  wrote:
>
>> On Fri, Jul 29, 2011 at 11:38 AM, Guy Matz  wrote:
>> > yeah, I got that set . . .  yeah, I should have mentioned that the facts
>> do
>> > get downloaded on the client to $vardir/lib/puppet/facter . . .  but
>> still
>> > the facts are not available!
>>
>> If you run facter -p on the client side does it load the custom fact?
>> If it's loading the fact successfully on the agent, is this fact
>> uploaded to the masters $vardir/yaml/facts directory?
>>
>> 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] Another Custom Fact deployment problem

2011-07-29 Thread Guy Matz
No!!!  facter -p does *not* show my facts . . .  what does that mean!?

thank *you*!

On Fri, Jul 29, 2011 at 11:42 AM, Nan Liu  wrote:

> On Fri, Jul 29, 2011 at 11:38 AM, Guy Matz  wrote:
> > yeah, I got that set . . .  yeah, I should have mentioned that the facts
> do
> > get downloaded on the client to $vardir/lib/puppet/facter . . .  but
> still
> > the facts are not available!
>
> If you run facter -p on the client side does it load the custom fact?
> If it's loading the fact successfully on the agent, is this fact
> uploaded to the masters $vardir/yaml/facts directory?
>
> 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] Another Custom Fact deployment problem

2011-07-29 Thread Guy Matz
yeah, I got that set . . .  yeah, I should have mentioned that the facts do
get downloaded on the client to $vardir/lib/puppet/facter . . .  but still
the facts are not available!

thanks a lot!
guy

On Fri, Jul 29, 2011 at 11:29 AM, Craig White wrote:

> on clients - agent.conf
>
> pluginsync = true
>
> Craig
>
> On Jul 29, 2011, at 8:06 AM, Guy Matz wrote:
>
> > Hi all,
> >
> > My facts work during testing, but not on deployment.   Any help would be
> greatly appreciated.
> >
> >
> > Fact in modules/ldap/lib/puppet/facter/nss_ldap.rb:
> >
> > fact_name = 'nss_ldap'
> >
> > Facter.add(fact_name) do
> >
> >   setcode do
> >
> > auth_settings = %x{/usr/share/authconfig/authconfig.py --test}
> >
> > auth_settings = auth_settings.split(/\n/)
> >
> >
> > # The line of output we are looking for
> >
> > line = auth_settings.collect { |v| v if v =~ /#{fact_name}/
> }.compact[0]
> >
> > # The setting that the line is set to . . .
> >
> > line.scan(/\s+is\s+(\w*)/)[0][0]
> >
> >   end # of setcode
> >
> > end # of Facter.add
> >
> >
> >
> > for testing, I have a call to a template in my init.pp:
> >
> > file {
> >
> > '/tmp/ldap_info.txt':
> >
> > content => template('ldap/ldap_info.erb');
> >
> > } # file
> >
> >
> > And the template says:
> >
> >
> > nss_ldap <%= nss_ldap %>
> >
> > pam_ldap <%= pam_ldap %>
> >
> > pam_oddjob_mkhomedir <%= pam_oddjob_mkhomedir %>
> >
> >
> > My node fails, however, with the error:
> >
> > err: Could not retrieve catalog from remote server: Error 400 on SERVER:
> Failed to parse template ldap/ldap_info.erb: Could not find value for
> 'nss_ldap' at /etc/puppetlabs/puppet/modules/ldap/manifests/init.pp:23 on
> node gmatzpupnode
> >
> >
> > Any thoughts would be greatly appreciated, especially suggestions on how
> to go about debugging the issue. . .
> >
> >
> > Thanks a lot,
> >
> > Guy
> >
> >
> > --
> > 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.
>
> --
> Craig White ~~  craig.wh...@ttiltd.com
> 1.800.869.6908 ~~~ www.ttiassessments.com
>
> Need help communicating between generations at work to achieve your desired
> success? Let us help!
>
> --
> 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.



[Puppet Users] Another Custom Fact deployment problem

2011-07-29 Thread Guy Matz
Hi all,

My facts work during testing, but not on deployment.   Any help would be
greatly appreciated.



Fact in modules/ldap/lib/puppet/facter/nss_ldap.rb:

fact_name = 'nss_ldap'

Facter.add(fact_name) do

  setcode do

auth_settings = %x{/usr/share/authconfig/authconfig.py --test}

auth_settings = auth_settings.split(/\n/)



# The line of output we are looking for

line = auth_settings.collect { |v| v if v =~ /#{fact_name}/ }.compact[0]

# The setting that the line is set to . . .

line.scan(/\s+is\s+(\w*)/)[0][0]

  end # of setcode

end # of Facter.add





for testing, I have a call to a template in my init.pp:

file {

'/tmp/ldap_info.txt':

content => template('ldap/ldap_info.erb');

} # file



And the template says:



nss_ldap <%= nss_ldap %>

pam_ldap <%= pam_ldap %>

pam_oddjob_mkhomedir <%= pam_oddjob_mkhomedir %>



My node fails, however, with the error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Failed to parse template ldap/ldap_info.erb: Could not find value for
'nss_ldap' at /etc/puppetlabs/puppet/modules/ldap/manifests/init.pp:23 on
node gmatzpupnode



Any thoughts would be greatly appreciated, especially suggestions on how to
go about debugging the issue. . .



Thanks a lot,

Guy

-- 
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] is ruby code allowed in puppet manifest?

2011-06-16 Thread Guy Matz
Hi,
I'm trying to get the following to work:

class cluster {

  $cluster_name = hostname.slice(0..-2)
.
.
} # class

hoping that if I have a server called appfarmserver1 (obtained from facter,
can I use a fact like this!?), cluster_name will get set to appfarmserver .
. .

puppet --parseonly init.pp says:
err: Could not parse for environment production: Syntax error at '.';
expected '}'

Is there some way to get this to work?  Is there a better, more puppetty way
to do what I want to do, i.e. based on the hostname from fatcer, set the
variable cluster_name for use in a template.

Thanks so much,
Guy Matz

-- 
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] special handling for template file with XML?

2011-06-16 Thread Guy Matz
hi,
i get the following error when trying to use a template with XML in it:
Could not parse for environment production: Syntax error at '<'

So I tried using the HTML & "codes" for special chars but now get:
"Could not parse for environment production: Could not match 

[Puppet Users] Testing, testing . . .

2011-06-10 Thread Guy Matz
Any of you folks have any good tests that you use to make sure a module has
completed successfully?  Any best practice suggestions?

I looked around on the www but didn't see anything about this.  Please point
me in the right direction if I missed it.

thanks,
guy

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