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

2017-05-04 Thread Sans
Thanks Gav! I see that now.
PuppetDB v3 is only compatible with Puppet v4, which I cannot upgrade to it 
yet.

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

-San

On Thursday, May 4, 2017 at 11:11:38 AM UTC+1, Gavin Williams wrote:
>
> Sans
>
> I wouldn't be surprised if that version of the 'puppetdb' pkg has a 
> dependency on 'puppetagent', which will install Puppet 4.x.
> See https://docs.puppet.com/puppetdb/#versions for more info on PuppetDB 
> + Puppet support... 
>
> So if you *really *want to use Puppet 3.x, you could try and install 
> 'puppetdb' < 3... 
>
> However the recommendation everywhere now is to use Puppet 4.x, as Puppet 
> 3 has been EOL'd... 
>
> HTH
>
> Gav
>

-- 
You received this message because you are subscribed to 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/efc48051-e8c8-49dc-b5ca-95e6706b486b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-05-04 Thread Sans
Looks like Puppetforge  puppetdb module is doing some thing under the hood. 
With a vanilla installation, everything seems look right: 

root@e115-s-pmaster-001:/# dpkg -l|egrep 'puppet((master|db){,1})[ -]'|awk 
'{printf ("%-22s%s\n",$2,$3)}'
puppet3.8.7-1puppetlabs1
puppet-common 3.8.7-1puppetlabs1
puppetdb  3.2.4-1puppetlabs1
puppetmaster  3.8.7-1puppetlabs1
puppetmaster-common   3.8.7-1puppetlabs1
#
root@e115-s-pmaster-001:/etc/apt/sources.list.d# puppet config print vardir 
ssldir
vardir = /var/lib/puppet
ssldir = /var/lib/puppet/ssl
#
root@e115-s-pmaster-001:/etc/apt/sources.list.d# puppet --version
3.8.7


Things seem to be changing the moment I apply that module. Any one got a 
clue? 

-San

-- 
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/4a5f33c0-62e4-42dc-bdda-52aea9ceb3dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-05-03 Thread Sans
Dear all,

I was just trying to install Puppet v3.8.7 with PuppetDB v3.2.4: 

root@e115-s-pmaster-001:/# dpkg -s puppet|grep -i version
Version: 3.8.7-1puppetlabs1
Config-Version: 3.8.7-1puppetlabs1
#
root@e115-s-pmaster-001:/# dpkg -s puppetdb|grep -i version
Version: 3.2.4-1puppetlabs1

but puppet --version reports v4.10.0:

root@e115-s-pmaster-001:/# puppet --version
4.10.0

FYI, my initial/main issue started with configuration value for vardir and 
ssldir, as reported by puppet. Puppet should have used this (according to 
puppet.conf):

root@e115-s-pmaster-001:/# egrep '(vardir|ssldir)=' /etc/puppet/puppet.conf
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl 

but puppet reports a different location:

root@e115-s-pmaster-001:/# puppet config print vardir ssldir
vardir = /opt/puppetlabs/puppet/cache
ssldir = /etc/puppetlabs/puppet/ssl

But I have a feelings that the config mismatch got something to do with 
version mismatch as well. Anyone here to help?

-San 

-- 
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/cb19e886-f04a-4cc6-8734-562c985921a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use external facts in a template?

2017-01-25 Thread Sans
Hi Henrik,

Thanks for commenting. Could you elaborate "Only reference Facter in logic 
that implements facts" pls? Does it mean when defining, e.g. a custom-fact, 
it's okay to reference another fact but not anywhere else? People gave me 
so many advice about dos and don'ts but no one actually explain why it's 
not working or how can I do it. Regardless of it should be done or not, why 
it works for thing like *Facter.value(:hostname)* but not with like: 
*Facter.value(:my_external_fact)*?

Basically, I have some external facts setup, during the initial machine 
provisioning and then I wanna make sure those facts are defined, if not put 
those facts in the external_fact file with some default value. That 
template is to maintain that external_fact file - that's my case.

-San

On Wednesday, January 25, 2017 at 11:23:06 PM UTC, Henrik Lindberg wrote:

>
> Do not ever reference Facter directly on the master side from functions 
> or ERB templates used when compiling. Only reference Facter in logic 
> that implements facts. It should be safe to reference Facter on the 
> agent side in provider logic. 
>
> If you have been advised to use Facter directly in templates I would 
> like to know where that advice came from. 
>
> You want to reference @facts['factname'] in an ERB if you are on a 
> modern puppet, otherwise individual top scope variables. 
>
> - henrik 
>
>
> -- 
>
> Visit my Blog "Puppet on the Edge" 
> http://puppet-on-the-edge.blogspot.se/ 
>

-- 
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/e45d81c5-f66a-4c29-960b-c52cbc334486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use external facts in a template?

2017-01-25 Thread Sans


On Wednesday, January 25, 2017 at 7:05:03 PM UTC, R.I. Pienaar wrote:
>
>
>
> only if you enable structured facts and have a new facter 
>

Well, it's not "structured" i.e. it returns only a string. and didn't work 
as expected. 
It also an "external fact", not sure if that's the main issue. 
Facter.value() works fine with other  fact, like "hostname" etc.

-San 

-- 
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/8ca3bbac-e3ff-4fc6-9af5-6c27b6506d07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use external facts in a template?

2017-01-25 Thread Sans


On Wednesday, January 25, 2017 at 2:20:30 PM UTC, R.I. Pienaar wrote:
>
>
> not been following, but if you're on a recent version @facts["foo"] is the 
> best 
>

I didn't know that but will check soon. I'm on v3.8.x - will it work there?

-S

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


Re: [Puppet Users] how to use external facts in a template?

2017-01-25 Thread Sans


> Hi Sans, 
>
> I think your ERB syntax may be off. Here's an example doing something 
> similar. Instead of Facter.value() just put an @ in front of the fact 
> name. 
>
> <% @nameservers.each do |nameserver| -%> 
> nameserver <%= nameserver %> 
> <% end -%> 
>
> Best regards, 
> -g 
>
>  
AFAIK (and understand), when you gave this: @nameservers compiler just 
treat that as variable, regardless of the fact it's actually a Fact or 
otherwise. Facter.value() is a valid syntax, which I use very often in my 
template and custom fact. The part of template, also try to determine if 
the fact is defined at all or not. It's not working for any external fact. 
As I already mentioned, it works for other facts, like "hostname" etc.

-S
 

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


[Puppet Users] how to use external facts in a template?

2017-01-25 Thread Sans
Dear all,
I'm having this issue and running out of ideas. 
I have this two external facts (defined in 
/etc/facter/facts.d/extn_git_facts.txt):


root@p19-d-pmaster-001:~# facter|grep ks_git
ks_git_puppet-hiera => master 
ks_git_puppet-master => develop

I want to use these two facts in a template. Here is my pseudo code:

<%-
git_repos = ['puppet-hiera', 'puppet-master']
git_repos.each do |g_repo|
git_branch = "ks_git_#{g_repo}"
git_br_name = Facter.value("ks_git_#{g_repo}")
-%>
GIT_BRANCH  :: <%= git_branch %>
GIT_BRANCH_NAME :: <%= git_br_name %>
<%-
end
-%>

and I don't get anything returned by `git_br_name` at all. If I use the 
same code in irb console, it works just fine:

 irb(main):012:0> require 'facter'
 => true
 irb(main):013:0> git_repos = ['puppet-hiera', 'puppet-master']
 => ["puppet-hiera", "puppet-master"]
 irb(main):014:0> git_repos.each do |g_repo|
 irb(main):015:1* p Facter.value("ks_git_#{g_repo}")
 irb(main):016:1> end
 "master"
 "develop"
 => ["puppet-hiera", "puppet-master"]


What am I doing wrong in the template? if I use some other built-in facts 
instead, e.g. `Facter.value(:hostname)` - it works just okay. Does mean the 
external facts cannot be used in template? Thanks in advance.

Best,
Santanu

-- 
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/cba5d7f3-e9f8-4077-ae9f-b34ea5d0d41a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] the issues with thias/fooacl: filesystem ACL

2016-05-20 Thread Sans


On Friday, May 20, 2016 at 1:21:24 AM UTC+1, Ken Lareau wrote:
>
>  
> If the file changes, fooacl on its own won't notice the change and won't 
> reset the ACLs.  You need to notify the class to ensure it does catch 
> this.  We have something like this for ours that we put after the fooacl 
> resource:
>
> File[] ~> Class['::fooacl']
>
> Hopefully this helps.
>
>
I have something similar but is it actually directly related to the issue I 
described? I have this: 

concat { "${wp_root}/wp-config.php":
mode=> '0400',
require => Wpcli::Core::Download["download_wordpress_${title}"],
notify  => Class['::fooacl'],
}
 
fooacl::conf { "allow_${wordpress::wp_owner}_wp_config_${title}":
target  => "${wp_root}/wp-config.php",
permissions => [ "user:${wordpress::wp_owner}:r" ],
require => Concat[ "${wp_root}/wp-config.php" ],
}

I cannot figure out if there is fundamentally wrong with this or not. Any 
suggestions?

-San
 

-- 
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/32692633-ebef-4e16-9b12-d6519e7ed063%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] the issues with thias/fooacl: filesystem ACL

2016-05-19 Thread Sans
Hi there,

Is anyone using thias/fooacl  
module? I use it for WordPress, to give www-data read access to wp-config.php 
and few other files. Every time puppet runs, the file becomes unreadable: 

# file: wp-config.php
# owner: root
# group: root
user::r--
user:www-data:r--   #effective:---
group::---
mask::---
other::---

eventually breaking the whole site. Any idea why that's happening? And/or 
how can I fix that? Really appreciate any help on this.

-San

-- 
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/baa51382-f4a7-42b5-ad76-e5365178b0be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to check existences of a file in a ERB template?

2016-04-13 Thread Sans
That was a brilliant idea!! You are a super-star!!
Worked like a charm!! 

-San
 

On Tuesday, March 29, 2016 at 8:05:23 PM UTC+1, Ramin K wrote:

>
> I think it's simpler to make PHP do the work because templates are 
> evaluated on the master. 
>
> if(file_exists('/var/www/<%= @title %>/wp-content/wp-extra-config.php')')) 
>require_once(ABSPATH . 'wp-content/wp-extra-config.php'); 
>
> Or whatever the if PHP syntax would be 
>
> Ramin 
>

-- 
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/c0a31b7c-3867-42a6-8793-7897ab480dc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to check existences of a file in a ERB template?

2016-03-29 Thread Sans
Hi Trevor,

I don't think "Templates" are technically executed on the Master - that's 
for the client/agents. The asset(s) we define in the template has to native 
to the agent. You can say everything gets complied on the master. Correct 
me, if I'm wrong.

w.r.t. custom-fact, as I said, it cannot be done, if I understood it 
correctly. I have a hiera hash like this:

wordpress::params::install_dir: '/var/www'
wordpress::client_hash:
'wp007':
client_enabled: true
wp_site_domain: 'wp007.com '

'wp008':
client_enabled: true
wp_site_domain: 'wp008.com '
.

and then in the init.pp, I process the info this way:

$client_hash = hiera_hash('wordpress::client_hash')
create_resources("@wordpress::sites",$client_hash)

where wordpress::sites is a define()type that loops through that array. The 
value (of the fact), in this case, has to change dynamically, on the fly. 
Meaning, has_wp_extra_config has to change during the puppet-run for 
clients, e.g. wp007 and wp008, which I don't think possible with a fact. 

-San


On Tuesday, March 29, 2016 at 10:50:09 AM UTC+1, Trevor Vaughan wrote:
>
> Hi San,
>
> Templates are executed on the master and so it will be checking the 
> existence on the master as written.
>
> You'll need to write a custom fact (they're easy) 
> https://docs.puppetlabs.com/facter/3.1/custom_facts.html. Something like 
> a boolean 'has_wp_extra_config' would be ideal.
>
> Then, in your template, change your line to <%- if @has_wp_extra_config 
> -%> and you should be good to go.
>
> Trevor
>
>
>

-- 
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/3dafad56-1209-4b82-80af-66cf36869231%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to check existences of a file in a ERB template?

2016-03-29 Thread Sans
Hi Trevor,

I don't think "Templates" are technically executed on the Master - that's 
for the client/agents. The asset(s) we define in the template has to native 
to the agent. You can say everything gets complied on the master. Correct 
me, if I'm wrong.

w.r.t. custom-fact, as I said, it cannot be done, if I understood it 
correctly. I have a hiera hash like this:

wordpress::params::install_dir: '/var/www'
wordpress::client_hash:
'wp007':
client_enabled: true
wp_site_domain: 'abccap-dev.kurtosysweb.com'

'wp008':
client_enabled: true
wp_site_domain: 'abccap-dev.kurtosysweb.com'
.

and then in the init.pp, I process the info this way:

$client_hash = hiera_hash('wordpress::client_hash')
create_resources("@wordpress::sites",$client_hash)

where wordpress::sites is a define()type that loops through that array. The 
value (of the fact), in this case, has to change dynamically, on the fly. 
Meaning, has_wp_extra_config has to change during the puppet-run for 
clients, e.g. wp007 and wp008, which I don't think possible with a fact. 

-San
   
 




The main issue is 


On Tuesday, March 29, 2016 at 10:50:09 AM UTC+1, Trevor Vaughan wrote:
>
> Hi San,
>
> Templates are executed on the master and so it will be checking the 
> existence on the master as written.
>
> You'll need to write a custom fact (they're easy) 
> https://docs.puppetlabs.com/facter/3.1/custom_facts.html 
> <https://www.google.com/url?q=https%3A%2F%2Fdocs.puppetlabs.com%2Ffacter%2F3.1%2Fcustom_facts.html=D=1=AFQjCNEx2vCQGG__pNRGIR9EWTwqcQMtBw>.
>  
> Something like a boolean 'has_wp_extra_config' would be ideal.
>
> Then, in your template, change your line to <%- if @has_wp_extra_config 
> -%> and you should be good to go.
>
> Trevor
>
> On Mon, Mar 28, 2016 at 3:44 PM, Sans <r.sant...@gmail.com > 
> wrote:
>
>> Hi there,
>>
>> I'm setting up a multi-tenancy WordPress environment, where multiple 
>> sites are structured as: /var/www/. Long story short: I want 
>> to put a line in the wp-config.php based on existences of a file in 
>> wp-content (under each site_location, provided by my users) directory, 
>> which I don't actively managed. So, I have this in the template that 
>> generates the wp-config.php file: 
>>
>> <%- if File.exist?('/var/www/'+@title+'/wp-content/wp-extra-config.php') 
>> -%>
>> require_once(ABSPATH . 'wp-content/wp-extra-config.php');
>> <%- end -%>
>>
>> where @title is the site_name that comes from a hiera hash. But it's not 
>> working and I think the reason being Puppet checking the existences of 
>> wp-extra-config.php file on the master during the compilation, hence 
>> setting it as false, for obvious reason. I cannot have it as a fact, 
>> because of the multi-tenancy and existences of that file varies from 
>> project to project. How do I go around this issue?
>>
>> -San 
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to puppet-users...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/15dd9afc-a55c-45d3-ab22-ed3ffc68fc3c%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/puppet-users/15dd9afc-a55c-45d3-ab22-ed3ffc68fc3c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
>
> -- This account not approved for unencrypted proprietary information --
>

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


[Puppet Users] how to check existences of a file in a ERB template?

2016-03-28 Thread Sans
Hi there,

I'm setting up a multi-tenancy WordPress environment, where multiple sites 
are structured as: /var/www/. Long story short: I want to put a 
line in the wp-config.php based on existences of a file in wp-content 
(under each site_location, provided by my users) directory, which I don't 
actively managed. So, I have this in the template that generates the 
wp-config.php file: 

<%- if File.exist?('/var/www/'+@title+'/wp-content/wp-extra-config.php') -%>
require_once(ABSPATH . 'wp-content/wp-extra-config.php');
<%- end -%>

where @title is the site_name that comes from a hiera hash. But it's not 
working and I think the reason being Puppet checking the existences of 
wp-extra-config.php file on the master during the compilation, hence 
setting it as false, for obvious reason. I cannot have it as a fact, 
because of the multi-tenancy and existences of that file varies from 
project to project. How do I go around this issue?

-San 


-- 
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/15dd9afc-a55c-45d3-ab22-ed3ffc68fc3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] directory environemnt doesn't seem to be working for vcsrepo

2016-03-14 Thread Sans

Hi there ,

I'm seeing a very strange error, which I cannot figure out where it's 
coming from:


*Error: Failed to apply catalog: Parameter revision failed on 
Vcsrepo[/var/www/wp007/wp-content]: Invalid value "". Valid values match 
/^\S+$/. at /usr/local/p19/puppet/modules/wordpress/manifests/app.pp:163*


Line #163  is where I specified the vcsrepo to do the git pull from staging 
branch. I cannot get any other info using -td or --trace. Any one has seen 
this error before or know what's going on?
Just to give you a but of background, the PuppetMaster is running with two 
environments: development and staging, with directory environment enabled. 
This error is coming from the staging instances.  Is it possible it's not 
getting the environment specific values to compile the catalog? Hoe do I do 
further debugging? 

Got really stuck in the middle, so nay help will be appreciated.

-San

-- 
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/13af960b-eaa6-4944-9800-b36a4ebb0e4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to safely distibute SSL keys with PuppetMaster

2016-03-08 Thread Sans


On Tuesday, March 8, 2016 at 1:16:13 AM UTC, Matt wrote:
>
> So I've done this simple with hiera email and using the contents of the 
> ssl keys and certs as strings for file resources to use with created 
> resources 
>
>
Thanks Matt!! that worked. I think I'm good for now that way.

-S  

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


Re: [Puppet Users] how to safely distibute SSL keys with PuppetMaster

2016-03-08 Thread Sans


On Tuesday, March 8, 2016 at 1:16:13 AM UTC, Matt wrote:
>
> So I've done this simple with hiera email and using the contents of the 
> ssl keys and certs as strings for file resources to use with created 
> resources 
>
> Could you tell me in a bit details how did you do it. I tried but really 
actually working. Not sure if I'm doing something wrong.
So, in my .eyaml, I have something like this:


wpress::params::nx_dhparam: >
ENC[PKCS7,MIIDHQYJKoZIhvcNAQcDoIIDD3434ufkfjr9r90gEhMIIBHQIBADAFMAACAQEw
DQYJKoZIhvcNAQEBBQAEggEAVLx8H1hbRwKvFWn5x40ckC7f6II191LC0d82
xbh4id3Jy/tV9s2abJxNl72BBj1mkVtNsBEigfgx79wfNtQ34mLRvA6wv9pG
yYYwm89PMHf1WlWbMogIMgMXGQx0IDhOewupfNJe75avEe2aIjwzxowLSq1p
x6migdVUCdi3ywlNdIAVPbe0N6fTG1OT4nQBW6PVJor6zA5Q3eFYCa+UmgYC
81bGdpVXDw3lUFWm2hg5aY4aG90Wa2mBK72t+QyeT1nlgcjoQDs2scuzojIh
n067O0oI6NlsVfaVQiwY1SmfIvKjldF4VX+q6I+lMkRQK9e8]


then in my nginx.pp:


$dhparam_pem = hiera('wpress::params::nx_dhparam')

file { '/etc/nginx/ssl/dhparam.pem':
ensure  => present,
mode=> '0440',
owner   => 'root',
group   => 'root',
content => $dhparam_pem,
}


hoping to the see the file: /etc/nginx/ssl/dhparam.pem has been created 
with the decrypted $dhparam_pem content but I get exactly the same text as 
in the 
heria. What am I doing wrong?

-S

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


[Puppet Users] how to safely distibute SSL keys with PuppetMaster

2016-03-07 Thread Sans

Hi there ,

I've a situation here, where I need to provide SSL key-pair for Nginx 
configuration and the SSL keys, that copied on to the agents as file{} 
resources goes to the repo, which is accessed by a number of people in the 
organization, which I don't like. What's the general recommendation (which 
goes along with the automation flow) here to handle this kind of situation?

I use eyal back-end for password and other secret string but how do I 
handle the files? I know: eyaml edit -f  can encrypt a file but 
how do I use that in Puppet or in a file{} resource? Thanks in advance!

-S

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


[Puppet Users] Re: puppet cannot find class.

2016-03-05 Thread Sans
I've never used a module with out a init.pp, so cannot tell you if that's 
the issue, I think it's not.
But normally this what I would do:

class all_class::first_class {  } and  class all_class::dep {  }

Probably worth giving a try.
On a general note, you should have all the owner, group values within the 
single-quote. But that's not to actual issue though.

-S 

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


Re: [Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-05 Thread Sans
Can this look-up done from agent as well?

-S


On Friday, March 4, 2016 at 4:52:05 PM UTC, Henrik Lindberg wrote:

>
> Recent would be >= 4.2 wrt. lookup functionality. 
> Sorry. 
> - henrik 
>
>
>

-- 
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/2a78f835-cef9-4e84-8871-0f9ba6fe347b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-04 Thread Sans

I'm on v3.8.4
Can it be run from agent? If it does, then it gonna solve my another issue 
as well.

-San


On Thursday, March 3, 2016 at 6:10:33 PM UTC, Henrik Lindberg wrote:
>
>
> If you are on a newer puppet version where the lookup command is 
> available you can use 'puppet lookup --explain your::variable' 
> as it will tell you how it searched for the value. 
>
> - henrik 
>
>
> -- 
>
> Visit my Blog "Puppet on the Edge" 
> http://puppet-on-the-edge.blogspot.se/ 
>

-- 
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/8f38c396-c514-40f0-ac8c-b36d4406d4a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-03 Thread Sans

Looks like to me it's not getting value from the Hiera at all. How can I 
make sure of that?

-S

On Thursday, March 3, 2016 at 1:28:51 PM UTC, Trevor Vaughan wrote:
>
> Hi Sam,
>
> Are you 100% sure that $wp_multisite is getting the value from Hiera?
>
> In this case, it looks like the value is empty.
>
> Thanks,
>
> Trevor
>
>
>

-- 
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/8cc362dc-cc0e-4e5a-bde2-aeec9045ef29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] validate_bool() throwing in error syaing the value not a boolean

2016-03-03 Thread Sans

Hi guys,

Suddenly started getting this error, which I cannot understand why I'm 
getting this:


Error: Evaluation Error: Error while evaluating a Function Call, "" is not 
a boolean.  It looks to be a String at /usr/local/K101/puppet/modules/apps/
manifests/app.pp:32:5 on node..

the line 32 is: validate_bool($wp_multisite), which is coming from hiera 
and set to true
Running PM in foreground or running the agent with --trace doesn't provide 
any additional information. I'm running out of ideas. Can anyone please 
help? Thanks in advance!!

-S

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


Re: [Puppet Users] How to run shell command on puppet agent

2016-02-01 Thread Sans
I agree with Steve comment but the point you guys are missing here it's a 
multi-tenant system and I'm getting hard time to visualize how a custom 
fact will handle the situation as the the same command will return 
different result for different databases, based on the client. 

It does make difference in the sense as /etc/passwd is unique for given 
puppet agent but it's not when you running, e.g. ls ~/Documents|wc -l for 
different users on the same puppet agent. How you will do the with a custom 
fact? I'm glad to be educated. 

-S



On Monday, February 1, 2016 at 2:31:08 PM UTC, jcbollinger wrote:
>
>
>
> On Friday, January 29, 2016 at 12:43:17 PM UTC-6, Sans wrote:
>>
>>
>> Steve, how you doing?? It's been very long time...
>>
>> The list-of-users was just an example.  The command that I actually wanna 
>> run is [...]
>>
>
>
> It makes no difference.  Steve's answer was spot on: facts are *the* 
> mechanism for conveying information about current node state to the 
> master.  There are multiple mechanisms by which you can implement custom 
> facts <https://docs.puppetlabs.com/facter/3.1/custom_facts.html>, some of 
> them accommodating shell scripting quite directly 
> <https://docs.puppetlabs.com/facter/3.1/custom_facts.html#external-facts>.
>
>  
>
>> I thought about the custom fact and I think I can work around it that way 
>> but having something equivalent to inline_template()that I can run on 
>> the fly is useful and simpler in this case.
>>
>
>
> You can use ERB on the client side to evaluate your custom fact if you 
> really want to do, but I don't see what the gains you even in your revised 
> example.  There, ERB is just a wrapper around a shell-out; it would be 
> simpler to just implement that particular fact via a shell script, cutting 
> Ruby and ERB out of the picture entirely.  Even if you used a traditional 
> Ruby custom fact implementation, the ERB in that particular example would 
> be needless, as you could instead just use the Ruby embedded inside, 
> directly.
>
> More generally, ERB is most useful for *formatting*.  If you find 
> yourself wanting to do much formatting in your custom fact implementations 
> then you're doing something wrong.  Neither of your examples so far 
> actually exhibits that problem, however; instead, the ERB in them is 
> altogether extraneous.
>
>
> 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/6f2110a4-8d7f-4829-a99d-7f64f544c6a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using Future Parser on Puppet v3.8.2

2016-02-01 Thread Sans
Thanks Henrik, for giving me the clue. 

It was really silly: My PM is self-managed, i.e. the puppet-agent also runs 
on the PM, which maintains the puppet.conf and it was overriding the 
parser=future, every time I was restating Apache after adding that bit 
manually. 

Sorry guys for the noise and false alarm. It's working now.

-S  


On Sunday, January 31, 2016 at 4:32:41 PM UTC, Henrik Lindberg wrote:

>
> Since you in the second example got a syntax error on the '.' that is an 
> indication that your configuration is not what you think it is. 
> i.e. future parser is not turned on. 
>
> If you change the place where you wrote parser=future, to parser=current 
> you probably get exactly the same error. That indicates that the 
> configuration file, or setting of parser= is in the wrong place. 
>
> - henrik 
>
> -- 
>
> Visit my Blog "Puppet on the Edge" 
> http://puppet-on-the-edge.blogspot.se/ 
>

-- 
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/1e2a8c5e-c6ac-4b34-83a9-e3011fa14ce7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Using Future Parser on Puppet v3.8.2

2016-01-31 Thread Sans

yes, so many times.

-S

On Saturday, January 30, 2016 at 10:58:33 AM UTC, Martin Alfke wrote:
>
>
> Have you restarted puppet master process after adding future_parser to 
> puppet.conf? 
>
> Best, 
> Martin 
>
>

-- 
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/19268fa9-ffd7-4140-b0ea-9993b45a0327%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to run shell command on puppet agent

2016-01-29 Thread Sans

Hi all,

Just trying to solve a little thing: I understand that inline_template() 
gets complied on the PM and return the result that is not native to puppet 
agent . i.e.

$ls_users = inline_template("<%= `cat /etc/passwd|awk -F: '{print $1}'` %>")
notify { "THE SITE NAME: ${ls_users}": }

will print all the users that exist on the PuppetMaster. What's the 
equivalent thing to do to get the result from the Puppet Agent? I know 
exec{} can be used but I need to put that value in a variable. Any help?

-S

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


Re: [Puppet Users] How to run shell command on puppet agent

2016-01-29 Thread Sans

Steve, how you doing?? It's been very long time...

The list-of-users was just an example.  The command that I actually wanna 
run is:

$site_id = inline_template("<%= `/usr/bin/mysql -h0 -u${db_user} 
-p${db_password} -s -r -N -e 'SELECT id FROM 
${db_name}.${wp_table_prefix}domain_mapping;'` %>")


on a multi-tenant server where domain_mapping is not  present for all the 
${db_name}. I thought about the custom fact and I think I can work around 
it that way but having something equivalent to inline_template()that I can 
run on the fly is useful and simpler in this case.

-S


On Friday, January 29, 2016 at 6:19:41 PM UTC, Steve Traylen wrote:
>
>
> Hi Santanu,
> Hope your well.
> This kind of thing is exactly what custom facts are for. Write a custom 
> fact to report the users.
> Steve.
> ---
> Steve Traylen
>
> *From:* Sans <r.sant...@gmail.com >
> *Sent:* 29 Jan 2016 7:16 pm
> *To:* Puppet Users
> *Subject:* [Puppet Users] How to run shell command on puppet agent
>
>
> Hi all,
>
> Just trying to solve a little thing: I understand that inline_template() 
> gets complied on the PM and return the result that is not native to puppet 
> agent . i.e.
>
> $ls_users = inline_template("<%= `cat /etc/passwd|awk -F: '{print $1}'` 
> %>")
> notify { "THE SITE NAME: ${ls_users}": }
>
> will print all the users that exist on the PuppetMaster. What's the 
> equivalent thing to do to get the result from the Puppet Agent? I know 
> exec{} can be used but I need to put that value in a variable. Any help?
>
> -S
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/a47c2632-5c8d-4e94-bf25-2563fc071e8f%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/a47c2632-5c8d-4e94-bf25-2563fc071e8f%40googlegroups.com?utm_medium=email_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/df7b03e5-8801-4a7f-92e2-174d72607b7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Using Future Parser on Puppet v3.8.2

2016-01-29 Thread Sans

Hi there,
Need to iterate over an arry, so was trying the Future Parser. Using a very 
simple example:


$alpha = ['a','b','c']
each($alpha) |String $value| { notice( "Hi there, ${value}" ) }

but getting this error:
*Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Could not match |String at..*

Not using the strict variable type also doesn't help, I get error at  *|*
*$value* that time.

I also tried using: $alpha.each |String $value| { notice( "Hi there, 
${value}" ) }

and get the error like:
*Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Syntax error at '.'; expected '}' at*


I do have parser=future defined in the puppet.conf on my PM. what am I 
still missing?

-San

-- 
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/adae1bd7-a596-43c0-b38e-5aa164de2dc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Is there a way to read multiple hiera file from a datadir location?

2015-12-02 Thread Sans
Hi all,

Is there way to use multiple Hiera data-source yaml from a fixed location 
like: /etc/puppet/sites/clients/ ?

I see having something like this:

:hierarchy:
- "clients/*"
- default


doesn't really work for Hiera. The issues for me There gonna be 100s of 
.yaml in there and I don't want to over load my hiera.yaml with 100s of 
entries or edit that file every time we add new client's data. Or is there 
way to use RegEx name? I don't care in what order they are executed. How do 
I deal with this situation? Best!

-- 
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/64150920-abb5-4508-9c5e-7dddea97dd50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Possible to overriding Hiera on the run-time?

2015-09-17 Thread Sans
Thanks Craig!
I will give it a go tonight and report here back.

-S


On Thursday, September 17, 2015 at 2:55:23 PM UTC+1, Craig Dunn wrote:

>
> It's can be done easier than that, although facts is the right 
> track...  You don't actually have to create a fact, you could just 
> test for the existence of it... 
>
> class mything ( 
>   $pull_repo, # sourced from hiera mything::pull_repo 
> ) { 
>
>   $do_pull = $::pull_repo ? { 
> undef => $pull_repo, 
> default => $::pull_repo, 
>   } 
> } 
>
> Note the use of top level scoping there - by default $::pull_repo will 
> be undef and the value from hiera used, you can then dynamically 
> create your fact on the fly by calling puppet agent with... 
>
> FACTER_pull_repo=yes puppet agent -t 
>
> Im not sure how you would tie that into the mcollective job, but it 
> shouldn't be too hard 
>
> Craig 
>
> -- 
> Enviatics | Automation and configuration management 
> http://www.enviatics.com | @Enviatics 
> Puppet Training http://www.enviatics.com/training/ 
>

-- 
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/f62a82d2-9879-4d19-804d-bf29f50c7ebd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Possible to overriding Hiera on the run-time?

2015-09-16 Thread Sans
Hi there,

I got to solve a "rare" issue here which I'm running out of ideas for. In 
our manifest, we do some conditional  git pull (using vcsrepo forgemodule) 
based on a Hiera variable that set either true or false. We keep the value 
as false i.e. no git-pull by default but want to set it true, on the fly 
temporarily for onetime run. Is there anyway to override hiera value when 
running puppet agent from the command-line on the run-time? 

Generally, we run on-demand puppet agent using mcollective, like this: mco 
puppet runonce -I 
Is there anywhay to achieve the same using mCollective at all? Or what 
other options do I have?

Any suggestions/pointer will be greatly appreciated. 

-San

-- 
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/a3f0be40-c999-4d39-8a6d-63f664fb6767%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] manage users and ssh_authorized_key from hiera

2015-01-30 Thread Sans
This is the class I have for the user creation:


 *#users.pp*

class common::users {

 create_resources('group', hiera_hash('groups'))
 
 define create_ssh_users () {
 user { $name:
 password   = $password,
 managehome = $managehome,
 groups = $groups,
 ensure = $ensure,
 } -

 ssh_authorized_key { $name:
 user   = $name,
 type   = $type,
 key= $key,
 ensure = $ensure,
 purge_ssh_keys = $purge_ssh_keys,
 }
 }
 create_resources('create_ssh_users', hiera_hash('ssh_users'))
 }


in my *nodes.pp*:  

 hiera_include('classes')



and the associated hiera file is like this:

*#users.yaml*

classes:
 - 'common::users'

 groups:
 'admins':
 ensure: present
 gid: '2001'
 'network':
 ensure: present
 gid: '2002'

 ssh_users:
 'sans':
 password: '$1$33mRSE$deEDRKq2aGPu0'
 managehome: true
 key: 'B3NzaC1yc2EAAAzdqs8etdh'
 purge_ssh_keys: true
 groups:
 - 'admins' 
 - 'networks'

ensure: present 

'joe':
 
 



When I run puppet, I see errors like:

Error: Invalid parameter managehome on 
Common::Users::Create_ssh_users[andy] on node p19-d-nagios-001
or 
Error: Invalid parameter purge_ssh_keys on 
Common::Users::Create_ssh_users[sans] on node p19-d-nagios-001


The errors are pretty inconsistent - changes the parameter (i.e. sometimes 
it's managehome, next time is key etc.) and the user-name over time. Can 
anyone tell what am I missing please? 
Best!

-- 
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/e2fa18b7-97d9-4370-a2d6-44a0835f63cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet array merge failure?

2015-01-30 Thread Sans
Did you check if have ruby-deep-merge (or the equivalent to your OS) 
installed? 

-- 
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/e65a5cfe-f689-437c-a5d3-0312eb4d4482%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-10-06 Thread Sans
Hi Gavin,

I know it's almost a 2 yrs. old thread but I'm still getting the very same 
*Could 
not find a suitable provider for domain* error. Did you able to solve the 
this prob at all in the end?

Best!


On Wednesday, October 24, 2012 9:36:33 PM UTC+1, Gavin Williams wrote:

 Stefan 

 Cheers for the feedback. 

 Understood on the exists element. 

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

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

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

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

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

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

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

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

   optional_commands :asadmin = 'binary_that_may_be_absent'

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

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

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

 -Stefan

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

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

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

2014-10-06 Thread Sans
Hi Gavin,

I know it's almost a 2 yrs. old thread but I'm still getting the very same 
*Could 
not find a suitable provider for domain* error. Did you able to solve the 
this prob at all in the end?

Best!

-- 
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/ae1ca1c2-36ca-4248-9a16-634eb364c4d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] What else in stead of using import keyword?

2014-07-13 Thread Sans
With *import* is being phased out, what's the equivalent? I did go through 
this deprecation notice 
http://docs.puppetlabs.com/puppet/latest/reference/lang_import.html#deprecation-notice
 
but didn't really get it.

Say, I've some side-wide global variables defines in *sites.pp*:  

*#/etc/puppet/manifests/sites.pp*
$my_var1 = 'ThisIsMyVar-2'
$my_var2 = 'ThisIsMyVar-2'
$my_other_var1 = 'ThisIsMyOtherVar-1'
$my_other_var2 = 'ThisIsMyOtherVar-2'

And in my does *nodes.pp*, I want to use them:

*#/etc/puppet/manifests/nodes.pp*
node default {
notify { This is my MY_VAR: ${my_var}: }
}

How do I do this? Doing above, yields variable not found.  Any idea?
Best!

-- 
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/7d4860a9-b210-49ca-860a-2b6b24f7d52d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] What else in stead of using import keyword?

2014-07-13 Thread Sans
Thanks Felix! it worked.
Some reason, I missed that directory as manifest thing when first time I 
read it. 

BTW, I'm actually back to square one again: Using Vagrant for the 
provisioning and it doesn't accept/understand the directory as main 
manifest, throwing in error:

puppet provisioner:
* The configured Puppet manifest is missing. Please specify a path to an 
existing manifest:

Do you (/any one) know a workaround? Best!



 To keep your node definitions 
 http://docs.puppetlabs.com/puppet/latest/reference/lang_node_definitions.html
  
 in separate files, specify a directory as your main manifest 
 http://docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html.

  

-- 
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/12aa040d-a179-402b-9599-66d430197440%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] What else in stead of using import keyword?

2014-07-13 Thread Sans
Just found the bug report and the fix is HERE 
https://github.com/schauer/vagrant/commit/8a45485de4f1c8158f07168b4f491ee38d22c8fc
.
JFI, on OS X, basically, you need to open the file:

/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/provisioners/puppet/config/puppet.rb
 


and replace the line 108, with: *if !expanded_manifest_file.file?  
!expanded_manifest_file.directory?*

worked just find for me. Best!


On Sunday, July 13, 2014 9:56:06 PM UTC+1, Felix.Frank wrote:

  On 07/13/2014 10:42 PM, Sans wrote:
  
 puppet provisioner:
 * The configured Puppet manifest is missing. Please specify a path to an 
 existing manifest:
  
 Do you (/any one) know a workaround? Best!


 I assume this is a Vagrant bug, and there is likely no workaround.

 I'll take a quick look, might be easy to fix.

 Cheers,
 Felix
  

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


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-18 Thread Sans
Thanks Rakesh! 
But, as you probably can guess, that didn't change a thing; still getting 
the same error. I'm not sure if PuppetDB look in the DNS record (as opposed 
to hosts file), in that case it never gonna work. Best!!

-- 
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/9c9cc6c3-1059-4b67-abd8-29f8d77e8527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to get logs in to the same termianl in agent side

2014-06-18 Thread Sans
I think, you cannot: The manifest is first compiled on Puppet Master and 
then the catalog (complied manifests) is sent to the agent, where that 
command actually runs. You can try this instead to see if you get any thing 
better

command= '/pathToShellScript/myScript.sh 21',

 logoutput  = true,


Best!

-- 
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/3c611f20-e087-42ef-8edd-e8d20d0acc82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: How to get logs in to the same termianl in agent side

2014-06-18 Thread Sans
Another thing, JFYI: I think somewhere you said you are new the Puppet, so 
get into the habit to follow the style-guide before it's too late, 
especially for the quote: you are mixing up the double and single quotes. 
Look at here: http://docs.puppetlabs.com/guides/style_guide.html

-- 
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/bf6c50dc-942c-4cf8-9af5-7d6110336da3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
Hi there,

Just started using PuppetDB (using the Puppetlabs' module) and getting 
issues with connection. First it was giving me server Not Found:

Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 
 
 Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb within timeout window of 15 seconds; 
 giving up.
 Error: Unable to connect to puppetdb server! (puppet.internal:8081)
 Error: 
 /Stage[main]/Puppetdb::Master::Config/Puppetdb_conn_validator[puppetdb_conn]/ensure:
  
 change from absent to present failed: Unable to connect to puppetdb server! 
 (puppet.internal:8081)


but from the puppetdb ssl-setup, it looks okay:

root@puppet:/vagrant/PuppetConf/manifests# puppetdb ssl-setup -f
 PEM files in /etc/puppetdb/ssl already exists, checking integrity.
 Overwriting existing PEM files due to -f flag
 Copying files: /var/lib/puppet/ssl/certs/ca.pem, 
 /var/lib/puppet/ssl/private_keys/puppet.internal.pem and 
 /var/lib/puppet/ssl/certs/puppet.internal.pem to /etc/puppetdb/ssl
 Setting ssl-host in /etc/puppetdb/conf.d/jetty.ini already correct.
 Setting ssl-port in /etc/puppetdb/conf.d/jetty.ini already correct.
 Setting ssl-key in /etc/puppetdb/conf.d/jetty.ini already correct.
 Setting ssl-cert in /etc/puppetdb/conf.d/jetty.ini already correct.
 Setting ssl-ca-cert in /etc/puppetdb/conf.d/jetty.ini already correct.


 
since then, I'm still getting eventually the same error but with different 
Notice:

Warning: Puppet::Util::SUIDManager.run_and_capture is deprecated; please 
 use Puppet::Util::Execution.execute instead.
(at 
 /vagrant/VagrantConf/modules/postgresql/lib/puppet/provider/postgresql_psql/ruby.rb:57:in
  
 `run_sql_command')
 Notice: 
 /Stage[main]/Puppetdb::Server::Jetty_ini/Ini_setting[puppetdb_sslhost]/value: 
 value changed '0.0.0.0' to 'puppet.internal'
 Info: Class[Puppetdb::Server::Jetty_ini]: Scheduling refresh of 
 Service[puppetdb]
 Notice: /Stage[main]/Puppetdb::Server/Service[puppetdb]: Triggered 
 'refresh' from 1 events
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 
 
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb within timeout window of 15 seconds; 
 giving up.
 Error: Unable to connect to puppetdb server! (puppet.internal:8081)
 Error: 
 /Stage[main]/Puppetdb::Master::Config/Puppetdb_conn_validator[puppetdb_conn]/ensure:
  
 change from absent to present failed: Unable to connect to puppetdb server! 
 (puppet.internal:8081)


Can anyone explain to me what actually going on/wrong please? Why it was Not 
Found before and now Unable to connect? Any help/pointer would be much 
appreciated. Best!

-- 
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/9517f14f-8b38-4243-9aaf-353a27ae8079%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Use external facts inside templetes

2014-06-17 Thread Sans
Hi there,

First of all, if it's a fact, then you really should be doing *${::key1}* 
instead. 

To use it in template, *%= @key1 %* should work just fine.  Otherwise, 
you can have this: *$localkey = ${::key1}* in your init.pp and then *%= 
@localkey %* in the template but I don't think you gonna get anything 
thing better.

On the agent, if you do: *facter -p key1*, do you get the result that you 
expect? Best!
 

On Tuesday, June 17, 2014 12:33:06 PM UTC+1, Malintha Adikari wrote:


   I have defined some key value pairs in /etc/facter/facts.d/value.txt 
 file. I could use those keys inside my init.pp script and successfully for 
 the values using

*${key1}*
  

 I want to get those values inside my template file. I have used 

*%= @key1 %*
  

 but it doesn't give me the value. What is the correct way to get the value 
 of the external fact inside template.

 Regards,

 Malintha


-- 
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/35dcdb3b-0209-4b66-a350-42705df5c542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
Hi Ken,

Thanks for the heads up!
First of all, it's a VBox VM, provisioned by Vigrant. PuppetMaster and 
PuppetDB are on the same machine.
I did go through those basic checks before posting, which appeared fine:


root@puppet:~# telnet puppet.internal 8081
 Trying 127.0.1.1...
 Connected to puppet.internal.
 Escape character is '^]'.


root@puppet:~# netstat -ntpl | grep 80
 tcp0  0 0.0.0.0:80  0.0.0.0:*LISTEN  
 14345/apache2
 tcp6   0  0 :::8080 :::* LISTEN  
 16301/java
 tcp6   0  0 127.0.1.1:8081  :::* LISTEN  
 16301/java


This is my jetty.ini:

root@puppet:~# awk '!/^($|#)/ {print}' /etc/puppetdb/conf.d/jetty.ini
 [jetty]
 host = 0.0.0.0
 port = 8080
 ssl-host = puppet.internal
 ssl-port = 8081
 ssl-key = /etc/puppetdb/ssl/private.pem
 ssl-cert = /etc/puppetdb/ssl/public.pem
 ssl-ca-cert = /etc/puppetdb/ssl/ca.pem


Java is also running:

root@puppet:~# ps auxww | grep java
 puppetdb 16301  1.0 26.8 1558932 135336 ?  Sl   13:47   2:26 
 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -XX:OnOutOfMemoryError=kill -9 
 %p -Xmx192m -XX:+HeapDumpOnOutOfMemoryError 
 -XX:HeapDumpPath=/var/log/puppetdb/puppetdb-oom.hprof 
 -Djava.security.egd=file:/dev/urandom -cp /usr/share/puppetdb/puppetdb.jar 
 clojure.main -m com.puppetlabs.puppetdb.core services -c 
 /etc/puppetdb/conf.d



ping  can resolve:

root@puppet:~# ping -c2 puppet.internal
 PING puppet.internal (127.0.1.1) 56(84) bytes of data.
 64 bytes from puppet.internal (127.0.1.1): icmp_req=1 ttl=64 time=0.023 ms
 64 bytes from puppet.internal (127.0.1.1): icmp_req=2 ttl=64 time=0.032 ms

 --- puppet.internal ping statistics ---
 2 packets transmitted, 2 received, 0% packet loss, time 999ms
 rtt min/avg/max/mdev = 0.023/0.027/0.032/0.006 ms



but nslookup cannot:

root@puppet:~# nslookup puppet.internal
 Server:10.0.2.3
 Address:10.0.2.3#53

 ** server can't find puppet.internal: NXDOMAIN 

(nslookup is fine though with localhost)

This is what my /etc/hosts looks like:

127.0.0.1localhost
 127.0.1.1puppet.internalpuppet



It's Ubuntu 12.04 server and I heard that name resolving works differently 
in this version. I'm lost here. Best!!

-- 
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/f1f592e5-c15f-407b-bf09-48ee28eb9ab7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
hi Ken,

Right now I'm creating only one VM, co-locating PuppetMaster and PuppetDB 
to make it simple - destroying and rebuilding. But it always fails - during 
the provisioning/building and also even after if I login to the machine and 
run puppet apply. Telnet works fine:

root@puppet:~# telnet puppet.internal 8081
 Trying 127.0.1.1...
 Connected to puppet.internal.
 Escape character is '^]'.
 Connection closed by foreign host.


and iptables is not configured at all but here is the output:


root@puppet:~# ufw status
 Status: inactive

root@puppet:~# iptables -vnL
 Chain INPUT (policy ACCEPT 349 packets, 47388 bytes)
  pkts bytes target prot opt in out source   
 destination

 Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  pkts bytes target prot opt in out source   
 destination

 Chain OUTPUT (policy ACCEPT 246 packets, 46964 bytes)
  pkts bytes target prot opt in out source   
 destination


-San


On Tuesday, June 17, 2014 7:16:57 PM UTC+1, Ken Barber wrote:

 Oh ... and lets see the output of: 

 iptables -vnL 

 Perhaps there is a firewall here? Its worth double checking. 


-- 
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/2bebdfb5-7a16-4238-863f-b112306198c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
It's very strange: Until I run puppetdb ssl-setup -f, I get 

*Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found*

but after that, I get

Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)



Since, I increased the timeout to 60, it changed into this:

Info: Class[Puppetdb::Server::Jetty_ini]: Scheduling refresh of 
 Service[puppetdb]
 Notice: /Stage[main]/Puppetdb::Server/Service[puppetdb]: Triggered 
 'refresh' from 1 events
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Notice: Unable to connect to puppetdb server (puppet.internal:8081): 
 #Errno::ECONNREFUSED: Connection refused - connect(2)
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 .
 .
 Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb; sleeping 2 seconds before retry
 Error: Unable to connect to puppetdb server (puppet.internal:8081): [404] 
 Not Found
 Notice: Failed to connect to puppetdb within timeout window of 60 seconds; 
 giving up.
 Error: Unable to connect to puppetdb server! (puppet.internal:8081)
 Error: 
 /Stage[main]/Puppetdb::Master::Config/Puppetdb_conn_validator[puppetdb_conn]/ensure:
  
 change from absent to present failed: Unable to connect to puppetdb server! 
 (puppet.internal:8081) 



I'm  rebuilding the server now. 

-- 
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/a3fd3359-c160-43fa-9f52-9d0615e32214%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
This is just after building a new server:


2014-06-17 23:20:05,246 INFO  [p.t.s.w.jetty9-core] Removing buggy security 
 provider SunPKCS11-NSS version 1.7
 2014-06-17 23:20:06,036 INFO  [p.t.s.w.jetty9-service] Initializing web 
 server.
 2014-06-17 23:20:06,132 INFO  [p.t.s.w.jetty9-service] Starting web server.
 2014-06-17 23:20:06,134 INFO  [o.e.j.s.Server] jetty-9.1.z-SNAPSHOT
 2014-06-17 23:20:06,177 INFO  [o.e.j.s.ServerConnector] Started 
 ServerConnector@5c5a7bf{HTTP/1.1}{0.0.0.0:8080}
 2014-06-17 23:20:06,437 INFO  [o.e.j.s.ServerConnector] Started 
 ServerConnector@1bfc3437{SSL-HTTP/1.1}{puppet.internal:8081}
 2014-06-17 23:20:06,531 INFO  [c.p.p.c.services] PuppetDB version 2.0.0
 2014-06-17 23:20:06,900 WARN  [c.p.p.s.migrate] Adding additional indexes; 
 this may take several minutes, depending on the size of your database. 
 Trust us, it will all be worth it in the end.
 2014-06-17 23:20:07,004 WARN  [c.p.p.s.migrate] Building resource 
 parameters cache. This make take a few minutes, but faster resource queries 
 are worth it.
 2014-06-17 23:20:07,140 INFO  [c.p.p.c.services] Starting broker
 2014-06-17 23:20:07,619 WARN  [o.a.a.b.BrokerService] Store limit is 
 10 mb, whilst the data directory: /var/lib/puppetdb/mq/localhost/KahaDB 
 only has 73883 mb of usable space
 2014-06-17 23:20:07,620 INFO  [c.p.p.c.services] Starting 1 command 
 processor threads
 2014-06-17 23:20:07,639 INFO  [c.p.p.c.services] Starting query server
 2014-06-17 23:20:07,642 WARN  [o.e.j.s.h.ContextHandler] Empty contextPath
 2014-06-17 23:20:07,650 INFO  [o.e.j.s.h.ContextHandler] Started 
 o.e.j.s.h.ContextHandler@3a3670a8{/,null,AVAILABLE}
 2014-06-17 23:20:07,724 INFO  [c.p.p.c.services] Starting sweep of stale 
 reports (threshold: 14 days)
 2014-06-17 23:20:07,750 INFO  [c.p.p.c.services] Finished sweep of stale 
 reports (threshold: 14 days)
 2014-06-17 23:20:07,750 INFO  [c.p.p.c.services] Starting database garbage 
 collection
 2014-06-17 23:20:07,777 INFO  [c.p.p.c.services] Finished database garbage 
 collection



-San 

-- 
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/f7e70e29-10f3-47f7-84a6-5adf74de0205%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB connection issue - Failed to connect!!

2014-06-17 Thread Sans
The puppetdb log is attached in the previous post. 

And, here is the curl output:

root@puppet:~# curl 
 'http://puppet.internal:8080/v2/metrics/mbean/java.lang:type=Memory'
 {
   ObjectPendingFinalizationCount : 0,
   HeapMemoryUsage : {
 committed : 86220800,
 init : 8052480,
 max : 194641920,
 used : 41882456
   },
   NonHeapMemoryUsage : {
 committed : 63504384,
 init : 24313856,
 max : 224395264,
 used : 63257288
   },
   Verbose : false,
   ObjectName : java.lang:type=Memory


-- 
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/36c1d8af-e7bb-4d95-960f-f00db7dc460e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-06 Thread Sans
Okay, here comes the follow-up question.
I've changed the zpack_installer, which doesn't do any inline_template() 
things any more,  instead it looks something like this now:

define installer::zpack_installer($sure='present',
   $inst='false',
   $zp_ver, $zp_rep) {
 
 
 }


and then:

class packages::zenpacks::core {

$zpack_list = keys($hr_zpack_core)
## $hr_zpack_core is the hash, comes from nodes.pp 

installer::zpack_installer { $zpack_list:
zp_ver   = inline_template(%= 
@hr_zpack_core[@name]['ver'].to_s.chomp %),
zp_rep   = inline_template(%= 
@hr_zpack_core[@name]['rep'].to_s.chomp %),
require  = Installer::Zpack_installer[ inline_template(%= 
@hr_zpack_core[@name]['req'].to_s.chomp %) ],
}
}

But it's failing with: err: Failed to parse inline template: undefined 
method `[]' for nil:NilClass
 
I think, the problem is coming from the @name bit. Is it right way of doing 
it? 
if I do the same thing in a ruby console, replacing @name with a 'key', I 
get exactly what I expect. Any pointer??

-San

-- 
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/6bd06ca0-e28a-48ad-9469-cbda98f722a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-06 Thread Sans
I never used the create_resources() and trying to get my head around it.  
So, how do I [re]write my define() type to work with  create_resources() to 
do the same thing similar to this:

class packages::zenpacks::core($pkgs_hash) {

 define installer::zpack_installer($sure='present',
   $inst='false',
   $zp_ver, $zp_rep)) {
 package { $name:
 ensure   = $zp_ver,
 require  = [
   Yumrepo[ $zp_rep ],
   Package[ 'zenpack-tools', 'patchutils' ],
 ];
 }
   ...
   ...
 }

 create_resources(installer::zpack_installer, $pkgs_hash)
 }



For my purpose,  I think I still need to use inline_template() for the rqed 
key. 
When I install the individual zenpacks, I actually need to do this to 
complete the installation:


installer::zpack_installer { 
 'zenpack-digmonitor': 
 require  = Installer::Zpack_installer[ 'zenpack-apachemonitor' ];
 }


How do I handle that? 

-San

-- 
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/9e05a6cc-3432-4157-8e8f-45bfa8b70a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to use variables elsewhere that defined in a define() type?

2014-06-05 Thread Sans
I have a class something like this, where I'm passing a [hiera] hash (
zpack_hash) to it:

class installer::zenpack($zpack_hash) {

 define zpack_installer($sure='present', $inst='false') {

 $z_pack  = $installer::zenpack::zpack_hash[$name]
 $zp_ver  = inline_template(%= @z_pack['ver'].to_s.chomp %)
 $zp_repo = inline_template(%= @z_pack['rep'].to_s.chomp %)
 $zp_rqed = inline_template(%= @z_pack['req'].to_s.chomp %)

 package { $name:
 ensure = $sure ? { present = $zp_ver, default = $sure },
 notify = Exec[ 'refresh_zenpack_daemons', 
 'create_default_conf' ],
 require= [
 File[ '/opt/zenpack/etc/global.conf' ],
 Yumrepo[ $zp_repo ],
   ];
 }
 }
 $my_zpack_list = keys($zpack_hash)
 zpack_installer { $my_zpack_list: }
 }

 
Later in my module, how can I use any of the variables (e.g. $zp_repo) that 
are already defined in the zpack_installer? I tried something like this:

class zenoss_four::packages::zenpacks::core {
 $hr_zenoss_zpack_core = hiera_hash('zenoss_four::zpack_core', 
 undef)

 class { 'installer::zenpack':
 zpack_hash = $hr_zenoss_zpack_core,
 require= [
 Yumrepo[ 
 $installer::zenpack::zpack_installer::zp_repo 
 ],
 File[ '/opt/zenoss/etc/global.conf' ],
 Zenoss_four::Installer::Zenpack::Zpack_installer[ 
 $installer::zenpack::zpack_installer::zp_rqed ],
   ];
 }
 }


but that's not working; throwing in errors like:


err: Failed to apply catalog: Could not find dependency Yumrepo[undef] for 
 Class[Installer::Zenpack]



on the lines that marked in red. It works just fine if I comment out these 
two lines. any help/suggestion from any one?

-- 
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/1058b3d0-f3c9-4da8-8e1f-4eacd7eff9e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-06-05 Thread Sans
No such ENC (other than Hiera).
There is also no static node declaration in Puppet; that comes from 
Hiera. But again, rest of the 50-odd nodes are running just fine the very 
same way.

-San 



On Monday, June 2, 2014 3:33:12 PM UTC+1, jcbollinger wrote:


 Is there an ENC involved?
 Is there a node declaration matching the affected node?


 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/507cf84f-ada2-4b85-be16-ac0deb17bc7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans

I have a class something like this, where I'm passing a [hiera] hash (
zpack_hash) to it:

class installer::zenpack($zpack_hash) {

 define zpack_installer($sure='present', $inst='false') {

 $z_pack  = $installer::zenpack::zpack_hash[$name]
 $zp_ver  = inline_template(%= @z_pack['ver'].to_s.chomp %)
 $zp_repo = inline_template(%= @z_pack['rep'].to_s.chomp %)
 $zp_rqed = inline_template(%= @z_pack['req'].to_s.chomp %)

 package { $name:
 ensure = $sure ? { present = $zp_ver, default = $sure },
 notify = Exec[ 'refresh_zenpack_daemons', 
 'create_default_conf' ],
 require= [
 File[ '/opt/zenpack/etc/global.conf' ],
 Yumrepo[ $zp_repo ],
   ];
 }
 }
 $my_zpack_list = keys($zpack_hash)
 zpack_installer { $my_zpack_list: }
 }

 
Later in my module, how can I use any of the variables (e.g. $zp_repo) that 
are already defined in the zpack_installer? I tried something like this:

class packages::zenpacks::core {
 $hr_zenoss_zpack_core = hiera_hash('zenoss_four::zpack_core', 
 undef)

 class { 'installer::zenpack':
 zpack_hash = $hr_zenoss_zpack_core,
 require= [
 Yumrepo[ 
 $installer::zenpack::zpack_installer::zp_repo 
 ],
 File[ '/opt/zenoss/etc/global.conf' ],
 Installer::Zenpack::Zpack_installer[ $installer::
 zenpack::zpack_installer::zp_rqed ],
   ];
 }
 }


but that's not working; throwing in errors like:


err: Failed to apply catalog: Could not find dependency Yumrepo[undef] for 
 Class[Installer::Zenpack]



on the lines that marked in red. It works just fine if I comment out these 
two lines. any help/suggestion from any one?

-- 
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/f11a912b-4157-4cab-bcad-ddb004c33a21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans
Thanks Felix, for the heads up!
I was also thinking along the line that variables define() type variables 
are not accessible from elsewhere. 

w.r.t. inline_templates, what else would you suggest? The hiera hash that 
I'm using here is something like this:

zpack_four::zpack_core:
 zenpack-apachemonitor:
 ver: latest
 repo: zenoss-four-%{environment}
 req: zenpack-apachemonitor
 zenpack-digmonitor:
 ver: latest
 repo: zenoss-four-%{environment}
 rqed: zenpack-apachemonitor



-San


On Thursday, June 5, 2014 12:47:32 PM UTC+1, Felix.Frank wrote:

 On 06/05/2014 01:06 PM, Sans wrote: 
  Later in my module, how can I use any of the variables (e.g. $zp_repo) 
  that are already defined in the zpack_installer? 

 I strongly disbelieve that this can work. 

 You can access variables defined in classes, but I would be mildly 
 disturbed if there was a similar feature for accessing interna of 
 defined type instances. 

 If you have Hiera, you likely want to have your data in structured hiera 
 values, so that you can look them up from all parts of your manifest. 

 As an aside - inline_templates in defined types can be performance 
 sinks, evaluating them is rather costly for the compiler. 

 HTH, 
 Felix 


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


Re: [Puppet Users] how to use variables elsewhere that's defined in a define() type?

2014-06-05 Thread Sans
Thanks Felix, for the heads up!
I was also thinking along the line that variables define() type variables 
are not accessible from elsewhere. 

w.r.t. inline_templates, what else would you suggest? The hiera hash that 
I'm using here is something like this:

zpack_four::zpack_core:
 zenpack-apachemonitor:
 ver: latest
 repo: zenpack-four-%{environment}
 req: zenpack-apachemonitor
 zenpack-digmonitor:
 ver: latest
 repo: zenpack-four-%{environment}
 rqed: zenpack-apachemonitor



-San

-- 
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/a07dbdba-5cf2-473c-bece-e4a163173ea0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: starting hiera + ntp module

2014-06-01 Thread Sans


On Wednesday, October 9, 2013 4:11:46 PM UTC+1, TimV wrote:


 Inside hieradata, I have a simple common.yaml file, and in that file I 
 have:

 ---
 testmsg : 'Tim was here'
 ntp::restrict : false,
 ntp::autoupdate : true,
 ntp::enable : false,
 ntp::servers : [
   ntp.example.org iburst,
   0.us.pool.ntp.org iburst,
   1.us.pool.ntp.org iburst,
   2.us.pool.ntp.org iburst
   ]


One this noticed about your ntp::servers here: I don't know if you can do 
that way but normally I define an array in hiera like this: 

ntp::servers:
 - ntp.example.org iburst
 - 0.us.pool.ntp.org iburst
 - 1.us.pool.ntp.org iburst
 - 2.us.pool.ntp.org iburst

 

In that case, the error message: Error 400 on SERVER: false, is not an 
Array - seems right. Best!


-- 
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/1898c642-2820-4e57-acc9-37a5be285584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-31 Thread Sans
Good catch Ellison; I haven't noticed that but nope, nothing unusual from 
facter on the affected node. 
Now running puppet agent -tv with certificate cleared from both master and 
agent yields these:


notice: Starting Puppet master version 2.7.23
 
 
 info: access[/certificate_request]: allowing * access
 info: access[/]: adding authentication any
 info: Inserting default '/status' (auth true) ACL because none were found 
 in '/etc/puppet/auth.conf'
 info: Could not find certificate for 'serv106.syst.local'
 info: Could not find certificate_request for 'serv106.syst.local'
 notice: serv106.syst.local has a waiting certificate request
 notice: Signed certificate request for serv106.syst.local
 notice: Removing file Puppet::SSL::CertificateRequest serv106.syst.local 
 at '/var/lib/puppet/ssl/ca/requests/serv106.syst.local.pem'
 info: Expiring the node cache of
 /usr/lib/ruby/site_ruby/1.8/puppet/node.rb:110:in `names'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:212:in 
 `evaluate_ast_node'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:101:in `compile'
 
 


It does sign the certificate just right but again the same wired info: 
Expiring the node cache of after that. 

-San



On Saturday, May 31, 2014 12:26:09 AM UTC+1, Ellison Marks wrote:

 It's weird, but it looks like the hostname isn't being defined, or isn't 
 being sent properly. See

 info: Expiring the node cache of

 With just a blank afterwards. Does running facter on the affected node 
 show anything unusual?



-- 
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/5d18a945-01f6-4087-b20e-b1be9cf5099b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Sans
Hi Henrik,

I don't really use WEBrick but apache/passenger for the normal operation. I 
think WEBrick is used to run puppet master in background in debug mode.  Is 
there a way to use apache/passenger for that?
Anyway, I'm running puppet v2.7.3 and getting the same error for one of 
those nodes even using passenger. 

-San



On Friday, May 30, 2014 3:10:28 AM UTC+1, Henrik Lindberg wrote:

 Is this using version 3.6.x of Puppet? We are currently working on 
 webrick issues for 3.6 that are caused by concurrency problems. 
 (I noticed in the trace that you are using webrick). 

 Note that Webrick is really just suitable for light out of the box, 
 simple development test work and is not recommended for production. 

 If you switch to using passenger, do you get the same error? 

 - henrik 




-- 
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/216861c1-5372-4fd7-909b-d93c1af81488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Sans


On Friday, May 30, 2014 11:13:51 PM UTC+1, Henrik Lindberg wrote:


 Ok, then webrick is not the cause of your problem. 

 Run with --trace set to get a ruby stack trace. That will help to find 
 what is causing the problem. 

 - henrik 


Yes, that was the output from --trace and that's why I where I'm a bit 
stuck as it's not saying that much.

-San

-- 
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/ed3d8bc3-629e-42b1-9138-e7ea6b6fd5f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-29 Thread Sans
 I have two identical nodes - serv106 and serv107 - one of which is working 
just fine but the other one failing with these error message:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 undefined method `include?' for nil:NilClass on node 
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run



running puppet master in the foreground, I see these on the screen: 

err: undefined method `include?' for nil:NilClass on node
 err: undefined method `include?' for nil:NilClass on node
 debug: Received report to process from serv106.syst.local
 debug: Processing report from serv106.syst.local with processor 
 Puppet::Reports::Store
 debug: Processing report from serv106.syst.local with processor 
 Puppet::Reports::Http
 err: Report processor failed: Connection refused - connect(2)
 debug: Processing report from serv106.syst.local with processor 
 Puppet::Reports::Log
 err: //serv106.syst.local/Puppet: Could not retrieve catalog from remote 
 server: Error 400 on SERVER: undefined method `include?' for nil:NilClass 
 on node
 warning: //serv106.syst.local/Puppet: Not using cache on failed catalog
 err: //serv106.syst.local/Puppet: Could not retrieve catalog; skipping run



a bit if google-search suggested that  removing certificates from both 
master and the agent (and recreating afterwards) is the solution to this 
issue. Which did but no joy so far. Has any one ever seen this error before 
or know what's I'm doing wrong here. Any help/pointer would be greatly 
appreciated. 

Best!

-- 
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/32a78b4c-2b58-454f-9e59-10c4a6081d4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-29 Thread Sans
Thanks Felix for the heads up.
Sorry for the long post. That's all I get using --trace option but I still 
can't figure out what's going wrong.


notice: Starting Puppet master version 2.7.23
 info: access[^/catalog/([^/]+)$]: allowing 'method' find
 info: access[^/catalog/([^/]+)$]: allowing $1 access
 info: access[^/node/([^/]+)$]: allowing 'method' find
 info: access[^/node/([^/]+)$]: allowing $1 access
 info: access[/certificate_revocation_list/ca]: allowing 'method' find
 info: access[/certificate_revocation_list/ca]: allowing * access
 info: access[^/report/([^/]+)$]: allowing 'method' save
 info: access[^/report/([^/]+)$]: allowing $1 access
 info: access[/file]: allowing * access
 info: access[/certificate/ca]: adding authentication any
 info: access[/certificate/ca]: allowing 'method' find
 info: access[/certificate/ca]: allowing * access
 info: access[/certificate/]: adding authentication any
 info: access[/certificate/]: allowing 'method' find
 info: access[/certificate/]: allowing * access
 info: access[/certificate_request]: adding authentication any
 info: access[/certificate_request]: allowing 'method' find
 info: access[/certificate_request]: allowing 'method' save
 info: access[/certificate_request]: allowing * access
 info: access[/]: adding authentication any
 info: Inserting default '/status' (auth true) ACL because none were found 
 in '/etc/puppet/auth.conf'
 info: Expiring the node cache of
 /usr/lib/ruby/site_ruby/1.8/puppet/node.rb:110:in `names'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:212:in 
 `evaluate_ast_node'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:101:in `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:24:in `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:84:in 
 `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:161:in `benchmark'
 /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
 /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:160:in `benchmark'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:82:in 
 `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:42:in 
 `find'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/indirection.rb:195:in `find'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:111:in `do_find'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:68:in `send'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/handler.rb:68:in `process'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick/rest.rb:24:in 
 `service'
 /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
 /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:45:in `listen'
 /usr/lib/ruby/1.8/webrick/server.rb:173:in `call'
 /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
 /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
 /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
 /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
 /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
 /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
 /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
 /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:42:in `listen'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in 
 `initialize'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in `new'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:41:in `listen'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:38:in 
 `synchronize'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/http/webrick.rb:38:in `listen'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:126:in `listen'
 /usr/lib/ruby/site_ruby/1.8/puppet/network/server.rb:141:in `start'
 /usr/lib/ruby/site_ruby/1.8/puppet/daemon.rb:124:in `start'
 /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:202:in `main'
 /usr/lib/ruby/site_ruby/1.8/puppet/application/master.rb:146:in 
 `run_command'
 /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
 /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:416:in `hook'
 /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
 /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:407:in `exit_on_fail'
 /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:309:in `run'
 /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:69:in `execute'
 /usr/bin/puppet:4
 err: undefined method `include?' for nil:NilClass on node
 /usr/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:27:in `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:84:in 
 `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:161:in `benchmark'
 /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
 /usr/lib/ruby/site_ruby/1.8/puppet/util.rb:160:in `benchmark'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:82:in 
 `compile'
 /usr/lib/ruby/site_ruby/1.8/puppet/indirector/catalog/compiler.rb:42:in 
 `find'
 

[Puppet Users] Re: Hiera question: Nested hash

2014-05-06 Thread Sans
Hi John,

I haven't use create_resources() before, so following the puppetlab docs. After 
having the data structure in my default.yaml, I have this  in the nodes.pp:

$hr_mon_base_pkgs = hiera_hash('rpm_mon_base_pack', undef)


and then in my utils.pp, I have this:

class monitoring::mon-utils {

 define mon_pkgs($pkgs_pack) {
 $repo = inline_template(%= @pkgs_pack.values.each { |repo| if 
 repo.has_key?(@name) { repo; break } } %)

 if $repo == '' {
 fail(No package '@name' defined in the provided pack)
 }
 package { $name:
 ensure   = $pkgs_pack[$repo][$name],
 require  = Yumrepo[ $repo ],
 }
 }
 create_resources(  monitoring::mon-utils::mon_pkgs, $hr_mon_base_pkgs )
 }



but ends up with the error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Invalid parameter rpm-mon-ntp on node mon105.back.local
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run


which is one of the packages in the hiera hash. Am I doing it right at all??

Best,
San


On Monday, May 5, 2014 6:13:13 PM UTC+1, jcbollinger wrote:



 You can use the create_resources() function to declare resources based on 
 hashes similar in form to those you present.  You cannot, however, express 
 resource references in hiera data, and you need resource references to 
 express your resource relationships.  That can be worked around.  In this 
 case, you also structure your data in a form that is not particularly 
 conducive to the lookups you want to perform, but that, too can be worked 
 around.

 As is often the case in Puppet DSL, a suitable defined type can serve here 
 as an adaptor, and suitable templates can do the needed processing.  I 
 might do something like this:

 define site::hiera_package($package_pack) {
   $repo = inline_template(%= @package_pack.values.each { |repo| if 
 repo.has_key?(@name) { repo; break } } %)
   if $repo == '' {
 fail(No package '@name' defined in the provided pack)
   }
   package { $name:
 ensure = $package_pack[$repo][$name]
 require = Yumrepo[$repo]
   }

}

 That will work with the data structure you presented, but will not provide 
 relationships on other Packages.  However, since you are assuming the Yum 
 package provider, you should not need to define package relationships to 
 Puppet.  These should already be adequately described in your packages' 
 internal metadata, which Yum uses to install any needed dependencies 
 automatically.

 If you nevertheless want data-driven explicit dependencies between 
 packages, then you can probably obtain that.  One approach would involve 
 making the values of the inner hashes be a third level of hash wherein you 
 describe possibly-multiple properties of the package named by the key.  One 
 of those properties would be the state to ensure, and another could be an 
 array of the names of packages it should depend on.  You could then use an 
 additional define to process the array and declare appropriate resource 
 relationships via a chain operator.  Alternatively, the iteration 
 facilities of the Future parser might provide a more direct route to 
 expressing the needed chain operations.


 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/ccebd1f8-d760-4f64-8e2a-9968f20bdda0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Hiera question: Nested hash

2014-05-06 Thread Sans


On Tuesday, May 6, 2014 3:36:13 PM UTC+1, jcbollinger wrote:




 Using hiera_array() does ensure that the value retrieved is an array, but 
 it's not at all what you want for this job or for either data structure.  
 In this case, the returned array will contain one element -- the same hash 
 that would be returned by the ordinary hiera() function.  If the 
 'rpm_mon_base_pack' key appeared at multiple levels of your hierarchy, then 
 the array returned by hiera_array() would contain the values from the other 
 levels, too -- *that's* the main purpose of the funciton.


Just noticed the typo: I was actually using hiera_hash() in stead of 
hiera_array(). This is for reason - I have four environments and the idea 
is override the default values from the environment specific yaml. Using 
:merge_behavior: 
deeper to merge  the values levels.

Best,
San


-- 
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/e7a27cbe-9843-46f7-9ae7-bf29ccdd6ed6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Hiera question: Nested hash

2014-05-05 Thread Sans
Thanks John for showing me a way to do it. I haven't tried that yet but 
meanwhile, I was also trying the define type but different way. Do you 
think this is a better data structure?

rpm_mon_base_pack:
 base-pkg1:
 rep: mon-repo-test
 rpm: rpm-mon-ntp
 ver: latest
 base-pkg2:  
 rep: mon-utils-test:
 rpm: rpm-mon-utils
 ver: latest


then, in my .pp:

class packages::rpm::monitoring-utils {

 $rpm_pkgs_list = hiera_array('rpm_mon_base_pack', undef) 

define monitoring_utils_pkgs() {

 $i_rpm = $rpm_pkgs_list[$name]
 $u_rpm = inline_template(%= @i_rpm['rpm'].to_s.chomp %)
 $u_ver = inline_template(%= @i_rpm['ver'].to_s.chomp %)
 $u_rep = inline_template(%= @i_rpm['rep'].to_s.chomp %)
 
 package { $u_rpm:
 ensure   = $u_ver,
 require  = [
   Yumrepo[ $u_rep ],
   Package[ 'mon-tools', 'patch-utils' ],
 ];
 }
 }
 monitoring_utils_pkgs { $rpm_pkgs_list: }
 }


But I end up with the error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Resource title must be a String, not Hash 



 What's doing wrong here? I'll try your suggestion to night as well. Best!



-- 
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/43f01cd7-ed8b-4ba3-9fc9-3bc6baf4f8ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera question: Nested hash

2014-05-02 Thread Sans
In my module, I have something like this to installed some base packages:

package {
 'rpm-mon-ntp':
 ensure   = latest,
 require  = Yumrepo[ mon-repo-test ];

 'rpm-mon-utils':
 ensure   = installed,
 require  = Yumrepo[ mon-utils-test ];
 
'rpm-mon-patch':
 ensure   = installed,
 require  = [ 
  Yumrepo[ mon-repo-test ],
  Package[ 'mon-tools', 'patch-utils' ],
 ];
 }


I want to use hiera to supply the values - repo-name, rpm-name, version 
etc. Is it possible at all?
I suppose, in the .yaml I can have something like this (in {repo-name{rpm-name: 
version}} format) : 


rpm_mon_base_pack:
 mon-repo-test:
 rpm-mon-ntp: latest
 rpm-mon-patch: installed

mon-utils-test:
 rpm-mon-utils: latest



but then, how do I do to make the package{} to get the values from hiera? 
How do I handle the case when Package[] is also required? Any help/pointer? 

Best!


-- 
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/068472ad-0a19-4862-a7d3-5d93d49f2a91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Use the virtual resources and hiera to create the environent specific group os users

2014-05-01 Thread Sans
Thanks guys for the heads up!
I didn't get time to try any of those, which I'll do tonight and report 
back.

-- 
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/3a46375c-b0de-4052-9e87-07ba71586749%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Use the virtual resources and hiera to create the environent specific group os users

2014-04-30 Thread Sans
Hi all,

I have users module, which I don't control but include in my manifest to 
setup user(s) on my system. This is something I have in one of the .pp 
files:

class users::productupport {
 @group { 'productsupport':
 gid = '1553',
 }
 @produser { 'jake_s':
 user= 'jake_s',
 uid = '5001',
 group   = 'productsupport',
 comment = 'Jake Sully',
 .
 }
 @produser { 'nina_g':
 
 }


and in my manifest, I realize that information like this: 

sudoers::snippet {
 'productsupport':
 group   = 'productsupport',
 rights  = ['ALL'];
  }
 Users::Produser | group == productsupport |



I have four environments and not all  user-group are required on all the 
environment. How can I do the from hiera? I'm planing to have this in my 
hiera files:

*test.yaml:*
 user_group:
   - productsupport
   - mondev

 *stage.yaml:*
 user_group:
   - productsupport
   - idreport



but then I cannot figure out how I can use user_group to create the group 
of users. Any help/pointer?
Just one thing to note: changing anything in the users module not really an 
option for me but I'm open to any suggestion(s) if it makes thing even 
better. 

Best!


-- 
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/d19ad979-a9ea-4b78-9d3b-34e366275bd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to apply a set of configurations to a specific host group?

2014-04-23 Thread Sans

Hi all,

For some historical reason, our hosts are not systematically named nor 
matches with the service(s) it runs and I don't see it's changing any time 
soon. So using a Regex in the nodename is not really an option for me. I 
have four environments - Dev, Int, Stage and Live - and I've just started 
using hiera to define the nodes like this:

curr_coll_list:
 - mon510.back.local
 - mon507.mgrt.local

 curr_db_list:
 - mon512.mgrt.local
 - pdb511.back.local
 - pdb504.back.local


Is there any way I can use that to apply a set of configurations to, say 
curr_coll_list? Or, what are the other options I have?
I know that node can have a comma separated list of host names but that 
doesn't make things any easier for me.

Best,
San

-- 
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/c8369c3a-be6b-4623-add3-a4dfea4da1d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to apply a set of configurations to a specific host group?

2014-04-23 Thread Sans

Thanks Jose! 
That trick worked (I've actually used that thing before) but I was 
wondering if there is a way to do it properly, like creating  a 
host-group or something like that. 

Best! 

On Wednesday, April 23, 2014 12:25:09 PM UTC+1, Jose Luis Ledesma wrote:

 Hi,

 You can use a default node definition, checking if the hostname is inside 
 any of your array declarations.

 Regards,


-- 
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/b5c3d9d9-b049-495a-8aef-f7726a345afc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] How to apply a set of configurations to a specific host group?

2014-04-23 Thread Sans
Do you have any example(s) handy, Neil?
I'm trying in google as well. Top of that, I never used SQL with hiera 
before.


On Wednesday, April 23, 2014 10:03:24 PM UTC+1, Neil - Puppet List wrote:

 Hello

 I think you'd probably be best served by using a sql backend to hiera.

 this would allow you to think and configure in terms of host groups but 
 hiera to find that a host has a class of group.

 A view or two might be needed to keep things tidy.

 Neil


-- 
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/7646ff1e-5271-493f-a340-398a911aaf3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Facts in ERB Template not working

2014-04-22 Thread Sans


On Tuesday, April 22, 2014 2:35:05 PM UTC+1, jcbollinger wrote:



 That is the current recommendation, but it is not a requirement.  Bare 
 variable names work, too.

 
You sure it's just a recommendation? IIRC, it doesn't work with Ruby 
v1.9.x. 
But that's definitely not the actual problem here though.

-- 
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/c8ee09aa-630b-4e3a-9f50-620102df4aef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Hiera arry into ERB template

2014-04-17 Thread Sans
Thanks guys for the explanation; worked just fine.
Is there any other good hiera documentation apart from the one in 
Puppetlab doc?

-San




On Wednesday, April 16, 2014 6:59:27 PM UTC+1, jcbollinger wrote:

 On Wednesday, April 16, 2014 11:31:53 AM UTC-5, Sans wrote:

 Hi there,

 Trying to figure out how to use  hiera-array in my template. So, this is 
 what I have in .yaml file:



 No, you are just trying to use an array.  Your template can't tell where 
 the array came from or how it was constructed.

  



 my_coll_list:
 - mon502.local
 - mon522.local


 and in my nodes.pp, I have this:

 $my_colloctors = hiera_array('my_coll_list')





 You probably do not want to use hiera_array() for that.  Use plain hiera() 
 instead.  The former traverses your entire hierarchy, returning an array 
 whose elements are the values matching the specified key at each level.  
 The latter returns the value associated with the requested key at the 
 highest-priority level of your hierarchy that provides one, as whatever 
 data type is modeled by the data (an array, in your example).

  

 then in one of my ERB templates, I using that like this:

 COLLECTORS = %= @my_colloctors % 



 if i understood correctly, according the Puppet documentation, using *array 
 merge lookup,* I was expecting a result like this: COLLECTORS = 
 ['mon502.local', 'mon522.local']
 but what I'm getting is: COLLECTORS = mon502.localmon522.local

  

1. You are confusing the Puppet DSL representation of an array with 
its (Ruby) stringification.  The latter is what your template will 
 produce, 
and it is simply the concatenation of the string values of the array 
elements.
2. The Puppet DSL form of the value of $my_colloctors that you 
actually have is in all likelihood [['mon502.local', 'mon522.local']].  
That is, an array whose only element is an array of your colloctors 
(whatever those are).  See my previous comments about hiera_array() vs. 
hiera().

  


 What am I missing here?



 If you really do want to collect collectors from multiple levels of your 
 hierarchy, then you will need to flatten the result.  Additionally, you 
 will need to format it into your template yourself.  There are many ways to 
 do that, but one would be something like this:

 COLLECTORS = [%= @my_collectors.map { |c| '#{c.to_s}'}.join(', ') %]


 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/eff94c7e-1651-4c2f-a850-b723ed7406ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Hiera arry into ERB template

2014-04-16 Thread Sans
Hi there,

Trying to figure out how to use  hiera-array in my template. So, this is 
what I have in .yaml file:


my_coll_list:
 - mon502.local
 - mon522.local


and in my nodes.pp, I have this:

$my_colloctors = hiera_array('my_coll_list')



then in one of my ERB templates, I using that like this:

COLLECTORS = %= @my_colloctors % 



if i understood correctly, according the Puppet documentation, using *array 
merge lookup,* I was expecting a result like this: COLLECTORS = 
['mon502.local', 'mon522.local']
but what I'm getting is: COLLECTORS = mon502.localmon522.local


What am I missing here?

Best,
San

-- 
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/ba8d7376-6c45-48d6-80a1-5e5d58af71cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] agent hangs at: Caching certificate_revocation_list for ca

2013-11-18 Thread Sans
Dear all,

I just upgraded the OS of my PuppetMaster from Debian Squeeze to Wheezy (on 
AWS/EC2) and since then all the clients hangs at: 
 
Info: Caching certificate_revocation_list for ca

and then eventually fails with  Timeout error. I think, it did work until I 
rebooted the Master. In addition, I did puppet cert clean on the master 
for that particular node and removed the ssl directory from the agent (so 
that it asks for a new certificate) and ran puppet agent -tv and it fails 
with these:

Info: Creating a new SSL key for ip-10-0-8-43.eu-west-1.compute.internal
 Info: Caching certificate for ca
 Info: Creating a new SSL certificate request for 
 ip-10-0-8-43.eu-west-1.compute.internal
 Info: Certificate Request fingerprint (SHA256): 
 32:0E:84:F3:EA:8D:49:48:43:85:08:55:64:6D:F8:D5:A1:E7:73:4F:82:70:7B:0B:B1:7F:E5:A4:F4:35:7A:ED
 Info: Caching certificate for ip-10-0-8-43.eu-west-1.compute.internal
 Info: Caching certificate_revocation_list for ca
 Error: Failed to apply catalog: Timeout::Error



Any idea what am I missing? This thing is stopping me form upgrading the OS 
on the PuppetMaster for long. JFI, using Puppet v3.3.2, if that important. 
Amy help is greatly appreciated.

Cheers,
Santanu 

-- 
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/2d0f7570-a6d6-424e-ba89-6ff561d5a89c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: how to pass the value to custom function?

2013-10-23 Thread Sans
Thanks John!
That fixed problem. I believe, in that, case symbol should be used over 
string in a hash? Cheers!!


On Tuesday, October 22, 2013 2:12:17 PM UTC+1, jcbollinger wrote:



 Your hash keys are symbols, whereas argument 0 to the function is a 
 string.  'linux' != :linux.  Try adding

   cls = cls.to_sym if cls.is_a? String 

 between initially setting cls and testing whether it is a key of your 
 hash.


 John



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] how to pass the value to custom function?

2013-10-21 Thread Sans
Dear all,

I'm trying this thing for a while but can't figure out what am I doing 
wrong. 
Here is my sample function (which is similar to the original one, except 
for the hash, which is generated dynamically in the original one):

module Puppet::Parser::Functions
 newfunction(:am_running_oss, :type = :rvalue ) do |args|

 oss = {:linux=[Slackware, RedHat, Caldera],
:mac=[Jaguar, Lion, Tiger, Kodiak],
:win=[Chicago, Daytona, Longhorn]}
 
 cls = args[0] 
 
 if oss.key?(cls)
 return oss[cls][0]
 else
 return 'undefined'
 end
 end
 end


and then in my module's init.pp, I have this:


$h= am_running_oss($::am_os_type)
 notify { =*=*= amRunningOS |:| ${h} =*=*=*=*=*=*=*=: }



(am_os_type is a fact, that returns *win*, *mac* or *linux* based on the 
node type)

I was expecting to see *Jaguar* as the return value but I get 
*undefined*instead. What am I doing wrong? Is there anything still am I missing 
in 
terms of passing the *args* to the  function? Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-18 Thread Sans
Thanks John! 
That's it! feel myself like the biggest stupid in the world!
Thanks every one for the help. It's working just fine now. Cheers!!



On Friday, October 18, 2013 2:24:29 PM UTC+1, jcbollinger wrote:



 *Be sure to restart your master after modifying any custom functions.  If 
 you have not done so, then the master might not see the changes.**
 *
 [ .]
 John



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: installing a package nmap on ubuntu

2013-10-18 Thread Sans
What you get running this:

/usr/bin/apt-get -y -o DPkg::Options::=--force-confold install nmap


on the agent? Cheers!!



On Friday, October 18, 2013 8:30:37 AM UTC+1, kampy wrote:

 Hi, i am new to puppet please help me how to resolve this issue. 
 below is my script 
 class nmap {
 package { 'nmap':
 ensure = installed,
 }

 }
 include nmap

 below is the error it is failing 

 err: /Stage[main]/Nmap/Package[nmap]/ensure: change from purged to present 
 failed: Execution of '/usr/bin/apt-get -q -y -o 
 DPkg::Options::=--force-confold install nmap' returned 100: Reading package 
 lists...
 Building dependency tree...
 Reading state information...
 The following NEW packages will be installed:
   nmap
 0 upgraded, 1 newly installed, 0 to remove and 159 not upgraded.
 Need to get 1643 kB of archives.
 After this operation, 6913 kB of additional disk space will be used.
 WARNING: The following packages cannot be authenticated!
   nmap
 E: There are problems and -y was used without --force-yes

 notice: Finished catalog run in 1.16 seconds

 please help in understanding what i am missing here to install this package

 Thanks in advance 

 Regards,
 kampy



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Nagios Puppet

2013-10-17 Thread Sans
Hi steve,

So, you have all the services defined statically on the Nagios server? 
That setup only works, I think, if you install your Nagios server at the 
very end of your deployment process and all the clients are up and ready 
before the server. If you do a parallel deployment, then there is a very 
good chance that Nagios will refuse to start at the first run. Cheers!! 


On Friday, June 28, 2013 3:57:09 PM UTC+1, Steve J wrote:

 In my experience, exporting nagios_command resources doesn't work so well. 
 What I've found works best, is to define nagios_command{}'s directly on the 
 server, rather than exporting and collecting them there later.

 In my setup, the only resource that export is the nagios_host. I define 
 commands and services on the server, and assign the services to hostgroups. 
 Hosts then get service checks assigned to them based on which hostgroups I 
 put them in (usually done via the hosts role definition). I find that this 
 works well, since it doesn't leave me with multiple exported nagios_service 
 resources for every single host, that will eventually need to get cleaned 
 out of PuppetDB when the host is no longer in service.

 -Steve



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-17 Thread Sans
It's strange: whatever I do I can't go past these error. Either it cannot 
recognize the function or fails with  single array error. Still don't 
understand what I'm missing. Cheers!!


On Thursday, October 17, 2013 1:34:26 AM UTC+1, Sans wrote:

 Not sure if it's important: the line number in the error message points to 
 the line in the .pp file where  $h = am_running_oss() is defines. If I 
 change that line with am_running_oss_hash('/tmp/OSs.txt') it works just 
 fine. Cheers!!


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-16 Thread Sans
Hi Cristian,

Thanks for the code. gos[:mac] is the right thing to do (as we defined: gos 
= {}); I think I g_C was a typo in my example script somewhere down the 
line). 

One related question: as I read that the name of the file must be the same 
as the name of the function, then I suppose I cannot do something similar 
to this in function:


gos.each_key do |cls|
 Facter.add('am_oss_' + cls.to_s) do
 setcode { gos[cls][0] }
 end
 end



as one can easily do with custom-facts? Any workaround available to this 
issue? Cheers!!


On Tuesday, October 15, 2013 2:27:00 PM UTC+1, Cristian Falcas wrote:

 I've changed your g_C[:mac] to gos[:mac], because I don't know what it 
 should do and puppet complained about it. 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-16 Thread Sans

I just modified your code a little bit and created two function out of that:


*# am_running_oss_hash.rb*

 module Puppet::Parser::Functions
 newfunction(:am_running_oss_hash, :type = :rvalue ) do |args|
 inFile = args[0]
 gos = {}

 if File.exist?(inFile)
 open(inFile, 'r').each do |line|
 next if line =~ /^\s*(#|$)/
 parts = line.split(',').map(:strip)

 case parts[1]
 when /^Mac/
 (gos[:mac] ||= [])  parts[0]
 when /_Win$/
 (gos[:win] ||= [])  parts[0]
 else
 (gos[:linux] ||= [])  parts[0]
 end
 end
 end

 return gos
 end
 end

 

*# am_running_oss.rb*

 module Puppet::Parser::Functions
 newfunction(:am_running_oss, :type = :rvalue ) do |args|
 #Puppet::Parser::Functions.function('am_running_oss_hash')
 Puppet::Parser::Functions.autoloader.loadall

 oss = function_am_running_oss_hash(['/tmp/OSs.txt'])
 if oss.count = 1
  return oss.keys.join(',')
 else
  return 'undefined'
 end
 end
 end



and then in the module:

$h = am_running_oss()
 notify {=*=*= RunnigOSS |:| ${h} =*=*=*=*=*=*=*=:}

 

but I'm getting this error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 custom functions must be called with a single array that contains the 
 arguments. For example, function_example([1]) instead of function_example(1)

 

What am I doing wrong? Cheers!!


On Wednesday, October 16, 2013 11:45:42 AM UTC+1, Cristian Falcas wrote:

 You could return a hash, or an array if you need multiple from the 
 function. 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-16 Thread Sans
Not sure if it's important: the line number in the error message points to 
the line in the .pp file where  $h = am_running_oss() is defines. If I 
change that line with am_running_oss_hash('/tmp/OSs.txt') it works just 
fine. Cheers!!




On Wednesday, October 16, 2013 10:37:19 PM UTC+1, Cristian Falcas wrote:

 sorry, i didn't see that you already did that. I will try to respond 
 again more meaningful in the morning 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-15 Thread Sans

Yes, the file is only on the master (and not exactly maintained by the 
Puppet but the provisioning framework) and it looks something like this:


Slackware, Linux, i-num=1
 Jaguar, MacX, i-num=6
 Chicago, this_Win, i-num=2
 Daytona, an_other_Win, i-num=7
 RedHat, Linux, i-num=5
 Lion, MacY, i-num=4
 Caldera, Linux, i-num=9
 Longhorn, that_Win, i-num=8
 Tiger, MacZ, i-num=3
 Indiana, Solaris, i-num=10
 Kodiak, MacX, i-num=11



What I was trying to do is to get a fact (or function) that returns a 
string like: win,mac,linux, as I showed in my previous post. Really 
appreciate if you can make an example function out of that. cheers!!



On Monday, October 14, 2013 9:37:51 PM UTC+1, Cristian Falcas wrote:

 i understood that the file is only on the master? If so, I will try to 
 write something tomorrow to implement this, 

 If the value never changes, it will be better to put it in an external 
 variable. 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
Dear all,

I have a custom fact, that reads a file and then generate the values 
dynamically based on the file content. It's something like this:


inFile = /home/admin/OSs.txt
 gos = {} 

 if File.exist?(inFile)
 open(inFile, 'r').each do |line|
 next if line =~ /^\s*(#|$)/
 parts = line.split(',').map(:strip)

 case parts[1]
 when /^Mac/
 (g_C[:mac] ||= [])  parts[0]
 when /_Win$/
 (g_C[:win] ||= [])  parts[0]
 else
 (g_C[:linux] ||= [])  parts[0]
 end
 end
 end

 Facter.add(:am_running_oss) do
 has_weight 100
 if gos.count = 1
 setcode { gos.keys.join(',') }
 else
 setcode { 'undefined' }
 end
 end



The file is on the PuppetMaster. Hence the custom fact 'am_running_oss' is 
not available or empty when it runs on the agent. What are the options I 
have to make the custom facts(s) available on every single puppet agent? 
Thanks in advance. Cheers!! 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] exporting custom facts to the puppet agents

2013-10-13 Thread Sans


Dear all,

I have a custom fact, that reads a file and then generate the values 
dynamically based on the file content. It's something like this:


inFile = /home/admin/OSs.txt
 gos = {} 

 if File.exist?(inFile)
 open(inFile, 'r').each do |line|
 next if line =~ /^\s*(#|$)/
 parts = line.split(',').map(:strip)

 case parts[1]
 when /^Mac/
 (gos[:mac] ||= [])  parts[0]
 when /_Win$/
 (gos[:win] ||= [])  parts[0]
 else
 (gos[:linux] ||= [])  parts[0]
 end
 end
 end

 Facter.add(:am_running_oss) do
 has_weight 100
 if gos.count = 1
 setcode { gos.keys.join(',') }
 else
 setcode { 'undefined' }
 end
 end



The file is on the PuppetMaster. Hence the custom fact 'am_running_oss' is 
not available or empty when it runs on the agent. What are the options I 
have to make the custom facts(s) available on every single puppet agent? 
Thanks in advance. Cheers!! 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
Hi Martin,

That doesn't actually work: I thought exactly the same in the beginning and 
already have the pluginsync enabled. I think, the reason being, the fact 
(am_running_oss.rb) file itself reads a text file and the file should be 
local. When it runs on the agent, the file (inFile = /home/admin/OSs.txt)is 
there for the .rb file to read it, hence the fact returns 'undefined'as 
well. 

-San



 

On Sunday, October 13, 2013 11:18:46 AM UTC+1, Martin Alfke wrote:

 Hi, 

 On 13.10.2013, at 10:57, Sans r.sant...@gmail.com javascript: wrote: 

  [...] 

  The file is on the PuppetMaster. Hence the custom fact 'am_running_oss' 
 is not available or empty when it runs on the agent. What are the options I 
 have to make the custom facts(s) available on every single puppet agent? 
 Thanks in advance. Cheers!! 
  

 You have to put the fact inside the lib/facter directory of a module and 
 you have to enable pluginsync on all nodes puppet.conf. 
 http://docs.puppetlabs.com/guides/plugins_in_modules.html 

 hth, 

 Martin 





-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
.well, unless I'm missing something here.

-Santanu



On Sunday, October 13, 2013 11:37:19 AM UTC+1, Sans wrote:

 Hi Martin,

 That doesn't actually work: I thought exactly the same in the beginning 
 and already have the pluginsync enabled. I think, the reason being, the 
 fact (am_running_oss.rb) file itself reads a text file and the file should 
 be local. When it runs on the agent, the file (inFile = 
 /home/admin/OSs.txt)is there for the .rb file to read it, hence the 
 fact returns 'undefined'as well. 

 -San



  

 On Sunday, October 13, 2013 11:18:46 AM UTC+1, Martin Alfke wrote:

 Hi, 

 On 13.10.2013, at 10:57, Sans r.sant...@gmail.com wrote: 

  [...] 

  The file is on the PuppetMaster. Hence the custom fact 'am_running_oss' 
 is not available or empty when it runs on the agent. What are the options I 
 have to make the custom facts(s) available on every single puppet agent? 
 Thanks in advance. Cheers!! 
  

 You have to put the fact inside the lib/facter directory of a module and 
 you have to enable pluginsync on all nodes puppet.conf. 
 http://docs.puppetlabs.com/guides/plugins_in_modules.html 

 hth, 

 Martin 





-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
To solve my copying file issue, I can certainly have a file{} type like 
this: 

file { 'running_oss':
 name= '/home/admin/OSs.txt',
 mode= '0644',
 content = file('/home/admin/OSs.txt');
 }


to copy the file from the Master to the agent, but as Retrieving plugin stuff 
 
happens way before anything else, the file is not copied prior to the 
custom fact. So, I need to run puppet twice to get the custom fact working 
on a freshly installed agent.

-San
 


On Sunday, October 13, 2013 11:39:22 AM UTC+1, Sans wrote:

 .well, unless I'm missing something here.

 -Santanu



 On Sunday, October 13, 2013 11:37:19 AM UTC+1, Sans wrote:

 Hi Martin,

 That doesn't actually work: I thought exactly the same in the beginning 
 and already have the pluginsync enabled. I think, the reason being, the 
 fact (am_running_oss.rb) file itself reads a text file and the file should 
 be local. When it runs on the agent, the file (inFile = 
 /home/admin/OSs.txt)is there for the .rb file to read it, hence the 
 fact returns 'undefined'as well. 

 -San



  

 On Sunday, October 13, 2013 11:18:46 AM UTC+1, Martin Alfke wrote:

 Hi, 

 On 13.10.2013, at 10:57, Sans r.sant...@gmail.com wrote: 

  [...] 

  The file is on the PuppetMaster. Hence the custom fact 
 'am_running_oss' is not available or empty when it runs on the agent. What 
 are the options I have to make the custom facts(s) available on every 
 single puppet agent? Thanks in advance. Cheers!! 
  

 You have to put the fact inside the lib/facter directory of a module and 
 you have to enable pluginsync on all nodes puppet.conf. 
 http://docs.puppetlabs.com/guides/plugins_in_modules.html 

 hth, 

 Martin 





-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
Hi Wolf,

yes, the custom fact itself is working just fine, so that's not a prob at 
all. It's something like this:

inFile = /home/admin/OSs.txt
 gos = {} 

 if File.exist?(inFile)
 open(inFile, 'r').each do |line|
 next if line =~ /^\s*(#|$)/
 parts = line.split(',').map(:strip)

 case parts[1]
 when /^Mac/
 (gos[:mac] ||= [])  parts[0]
 when /_Win$/
 (gos[:win] ||= [])  parts[0]
 else
 (gos[:linux] ||= [])  parts[0]
 end
 end
 end

 Facter.add(:am_running_oss) do
 has_weight 100
 if gos.count = 1
 setcode { gos.keys.join(',') }
 else
 setcode { 'undefined' }
 end
 end



As you can see, the problem is the very first line.
BTW, w.r.t. provisioning system, it's a bit of mess at the moment and I 
don't wanna touch it before the demo, that we have in two weeks time. It's 
a ENC based system, which we replaced by a master-less Puppet (for AWS) 
implementation and then back to old ENC system again as we started having 
problem with our cloud provisioning. So, right now, it does ship the file 
on to the PM and whatever the extra stuff I'm putting in doing from 
modules; one of the modules needs that file available on every host for 
that custom-fact to work. Thanks anyway. Cheers!!




On Sunday, October 13, 2013 6:17:06 PM UTC+1, Wolf Noble wrote:

 Hi Santanu,

 custom facts should always do their work inside a setcode block. 
 http://docs.puppetlabs.com/guides/custom_facts.html

 That has nothing to do with the issue at hand, however.

 If you need the file to exist before puppet's first run, have your 
 provisioning system lay it down. Otherwise, you'll have the situation 
 you're describing where your first puppet run's job is to set the stage for 
 the rest of your runs.

 hth

 W


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] exporting custom facts to puppet agents

2013-10-13 Thread Sans
Hi Cristian,

That sounds a workable solution. Do you have any example handy; I've never 
used that before. 

-San




On Sunday, October 13, 2013 9:04:09 PM UTC+1, Cristian Falcas wrote:

 Why not make your fact a function? 

 This way it will only run on the master and you will use a return 
 value in your manifests instead of facts. 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Re: Puppet fails to install package, whilst it's okay to do manually

2013-10-11 Thread Sans
True! I didn't show that it actually installed from the command line but it 
does/did. After a bit digging, I found a rather strange issue - that was 
the very first installation just after spinning up the instance and puppet 
needed an *apt-get update* first to carry-on with installation, whilst it 
was just fine from the CLI, without issuing *update* first. It happened on 
a number of nodes in my cluster, so I tested several times. Any further 
thought/comments on that?

-San


On Thursday, October 10, 2013 3:06:40 PM UTC+1, jcbollinger wrote:


 I don't think you've demonstrated that it does run fine from the command 
 line.  It appears to me that the error reported by Puppet would not 
 manifest on the command line until after the point where your transcript 
 cuts off.

 Anyway, if a command succeeds when run from the command line but fails 
 when executed by Puppet then the usual problem is a difference in execution 
 environment, typically in the environment variables.  Puppet intentionally 
 provides a very sparse environment to external commands it executes.  Your 
 case is unusual in that the command seems to mostly work.  Could it be that 
 you need a proxy server configured for FTP, but not for HTTP?


 John



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet fails to install package, whilst it's okay to do manually

2013-10-10 Thread Sans
Dear all,

I'm seeing this strange thing: When I run *puppet agent -td* on the node 
(Nagios, in this example case), puppet fails to install Nagios3 (on Debian) 
with this:


Debug: Executing '/usr/bin/dpkg-query -W --showformat ${Status} ${Package} 
 ${Version}\n nagios3'
 Debug: Executing '/usr/bin/apt-get -q -y -o 
 DPkg::Options::=--force-confold install nagios3' 

Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o 
 DPkg::Options::=--force-confold install nagios3' returned 100: Reading 
 package lists...
 Building dependency tree...
 Reading state information...
 The following extra packages will be installed:
   apache2-mpm-prefork bsd-mailx javascript-common libapache2-mod-php5
   libjs-jquery liblockfile-bin liblockfile1 libonig2 libqdbm14 
 nagios-images
   nagios3-cgi nagios3-common nagios3-core php5-cli php5-common psmisc
   wwwconfig-common
 Suggested packages:
   php-pear nagios-nrpe-plugin mysql-client postgresql-client
 The following packages will be REMOVED:
   apache2-mpm-worker
 The following NEW packages will be installed:
   apache2-mpm-prefork bsd-mailx javascript-common libapache2-mod-php5
   libjs-jquery liblockfile-bin liblockfile1 libonig2 libqdbm14 
 nagios-images
   nagios3 nagios3-cgi nagios3-common nagios3-core php5-cli php5-common 
 psmisc
   wwwconfig-common
 0 upgraded, 18 newly installed, 1 to remove and 20 not upgraded.
 Need to get 5808 kB/10.9 MB of archives.
 After this operation, 31.3 MB of additional disk space will be used.
 Err http://ftp.de.debian.org/debian-security/ wheezy/updates/main 
 php5-common amd64 5.4.4-14+deb7u3
   404  Not Found
 Err http://ftp.de.debian.org/debian-security/ wheezy/updates/main 
 libapache2-mod-php5 amd64 5.4.4-14+deb7u3
   404  Not Found
 Err http://ftp.de.debian.org/debian-security/ wheezy/updates/main php5-cli 
 amd64 5.4.4-14+deb7u3
   404  Not Found
 Failed to fetch 
 http://ftp.de.debian.org/debian-security/pool/updates/main/p/php5/php5-common_5.4.4-14+deb7u3_amd64.deb
   
 404  Not Found
 Failed to fetch 
 http://ftp.de.debian.org/debian-security/pool/updates/main/p/php5/libapache2-mod-php5_5.4.4-14+deb7u3_amd64.deb
   
 404  Not Found
 Failed to fetch 
 http://ftp.de.debian.org/debian-security/pool/updates/main/p/php5/php5-cli_5.4.4-14+deb7u3_amd64.deb
   
 404  Not Found
 E: Unable to fetch some archives, maybe run apt-get update or try with 
 --fix-missing?



But if I run the same command (well, without '-y') on the node, it works 
just fine. 

root@ip-10-0-2-44:~# /usr/bin/apt-get -q -o DPkg::Options::=--force-confold 
 install nagios3
 Reading package lists...
 Building dependency tree...
 Reading state information...
 The following extra packages will be installed:
   apache2-mpm-prefork bsd-mailx javascript-common libapache2-mod-php5 
 libjs-jquery liblockfile-bin liblockfile1 libonig2
   libqdbm14 nagios-images nagios3-cgi nagios3-common nagios3-core php5-cli 
 php5-common psmisc wwwconfig-common
 Suggested packages:
   php-pear nagios-nrpe-plugin mysql-client postgresql-client
 The following packages will be REMOVED:
   apache2-mpm-worker
 The following NEW packages will be installed:
   apache2-mpm-prefork bsd-mailx javascript-common libapache2-mod-php5 
 libjs-jquery liblockfile-bin liblockfile1 libonig2
   libqdbm14 nagios-images nagios3 nagios3-cgi nagios3-common nagios3-core 
 php5-cli php5-common psmisc wwwconfig-common
 0 upgraded, 18 newly installed, 1 to remove and 20 not upgraded.
 Need to get 5808 kB/10.9 MB of archives.
 After this operation, 31.3 MB of additional disk space will be used.
 Do you want to continue [Y/n]? 


Any idea what am I missing here? Thanks in advance. 
Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] err: Could not retrieve catalog from remote server: Error 400 on SERVER: allocator undefined for Proc

2013-10-06 Thread Sans

Hi there,

Just to report that I still see the same issue:


Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 allocator undefined for Proc
 /usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:185:in `is_http_200?'
 /usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:100:in `find'
 /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:197:in `find'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:243:in `block in 
 retrieve_new_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:351:in `block in thinmark'
 /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:350:in `thinmark'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:242:in 
 `retrieve_new_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:67:in `retrieve_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:107:in 
 `prepare_and_retrieve_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:159:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (5 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (4 levels) in run'
 /usr/lib/ruby/1.9.1/sync.rb:227:in `sync_synchronize'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (3 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:119:in `with_client'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:42:in `block (2 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:84:in `run_in_fork'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:41:in `block in run'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:39:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:353:in `onetime'
 /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:327:in `run_command'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) 
 in run'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:456:in `plugin_hook'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:504:in `exit_on_fail'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:86:in `execute'
 /usr/bin/puppet:4:in `main'
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run
 Debug: report supports formats: b64_zlib_yaml pson raw yaml; using pson



System info, as requested:

root@ip-10-0-3-82:/etc/puppet/modules# lsb_release -irc
 Distributor ID:Debian
 Release:6.0.7
 Codename:squeeze
 #
 root@ip-10-0-3-82:/etc/puppet/modules# ruby -v
 ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
 #
 root@ip-10-0-3-82:/etc/puppet/modules# puppet -V
 3.1.1



Only workaround, for me, so far is to delete the node from the puppet 
database. Cheers!!



On Thursday, November 29, 2012 2:34:50 PM UTC, John Lamb wrote:

 OS: Red Hat Enterprise Linux Server release 6.3 (Santiago)
 Ruby: ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
 Puppet: puppet-3.0.1-1.el6.noarch

 I can get the facter output to you later today.

 For what it's worth, I ran into this problem as I was developing a class 
 within an already-existing service. I referenced one or several resources 
 that didn't actually exist (via the require metaparameter - I tried to 
 require Group['git'],) and after fixing this issue I was no longer able to 
 get my puppet agent runs to work, even after commenting out all the changes 
 I had made.

 I was able to fix this by trying puppet node clean broken.node.name, 
 which failed, then I tested puppet node clean against a working node, which 
 also failed, then on a whim I tried it against the broken node once more, 
 at which point it worked. Since then puppet has worked as usual.

 The error I got from puppet node clean is:
 Error: uninitialized constant ActiveRecord::Base
 Error: Try 'puppet help node clean' for usage

 Interestingly, this morning our puppet deprecation report told us: 11 
 ActiveRecord-based storeconfigs and inventory are deprecated. We normally 
 don't have any deprecated storeconfigs. We have a total of 25 machines.  I 
 don't know if this is related to the issue at large.

 On Wednesday, November 28, 2012 8:09:38 PM UTC-5, Jeff McCune wrote:

 On Wed, Nov 28, 2012 at 10:55 AM, John Lamb lam...@wfu.edu wrote: 
  I am also seeing this bug on one of my nodes (worryingly, the puppet 
 master 
  itself!) The relevant output of puppet agent -t --debug --trace 
 --verbose 
  matches what Fabrice and Lee have also reported: 

 OK, there's definitely a bug somewhere... 

 I'm going to work on reproducing this issue tomorrow.  Before then, 
 could anyone affected by this allocator undefined for Proc error 
 

Re: [Puppet Users] err: Could not retrieve catalog from remote server: Error 400 on SERVER: allocator undefined for Proc

2013-10-06 Thread Sans

Hi there,

Just to report that I still see the same issue:


Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
 Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 allocator undefined for Proc
 /usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:185:in `is_http_200?'
 /usr/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:100:in `find'
 /usr/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:197:in `find'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:243:in `block in 
 retrieve_new_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:351:in `block in thinmark'
 /usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:350:in `thinmark'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:242:in 
 `retrieve_new_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:67:in `retrieve_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:107:in 
 `prepare_and_retrieve_catalog'
 /usr/lib/ruby/vendor_ruby/puppet/configurer.rb:159:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (5 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (4 levels) in run'
 /usr/lib/ruby/1.9.1/sync.rb:227:in `sync_synchronize'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (3 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:119:in `with_client'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:42:in `block (2 levels) in run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:84:in `run_in_fork'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:41:in `block in run'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
 /usr/lib/ruby/vendor_ruby/puppet/agent.rb:39:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:353:in `onetime'
 /usr/lib/ruby/vendor_ruby/puppet/application/agent.rb:327:in `run_command'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block (2 levels) 
 in run'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:456:in `plugin_hook'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `block in run'
 /usr/lib/ruby/vendor_ruby/puppet/util.rb:504:in `exit_on_fail'
 /usr/lib/ruby/vendor_ruby/puppet/application.rb:364:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
 /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:86:in `execute'
 /usr/bin/puppet:4:in `main'
 Warning: Not using cache on failed catalog
 Error: Could not retrieve catalog; skipping run
 Debug: report supports formats: b64_zlib_yaml pson raw yaml; using pson



System info, as requested:

root@ip-10-0-3-82:/etc/puppet/modules# lsb_release -irc
 Distributor ID:Debian
 Release:6.0.7
 Codename:squeeze
 #
 root@ip-10-0-3-82:/etc/puppet/modules# ruby -v
 ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
 #
 root@ip-10-0-3-82:/etc/puppet/modules# puppet -V
 3.1.1



Only workaround, for me, so far is to delete the node from the puppet 
database. Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Puppet Users] Puppet is always trying 'service start' instead of 'restart' - how to force restart?

2013-10-06 Thread Sans
Thanks Trevor!
Although I was wondering about it but never thought that's actually causing 
this problem. On Debian/Ubuntu, the name of the init.d script 
(ganglia-monitor) is different than the daemon (gmond). Fixed now. Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] Puppet is always trying 'service start' instead of 'restart' - how to force restart?

2013-10-05 Thread Sans
Dear all,

As stated in the title, I have a module for ganglia gmond, where puppet is 
always doing '*/etc/init.d/ganglia-monitor start*' instead of '*restart*' 
whenever a 'refresh' is triggered for the service. This is what I have in 
my module:


file { 'gmond_conf':
 name= '/etc/ganglia/gmond.conf',
 ensure  = file, mode= '0644',
 owner   = 'root', group = 'root',
 content = template('ganglia/slv_gmond_conf.erb'),
 require = Package['ganglia-monitor'],
 notify   = Service['ganglia-monitor'],
 } ~

 service { 'ganglia-monitor':
 ensure  = running,
 enable  = true,
 hasrestart = true,
 hasstatus  = false,
 #restart= undef,
 subscribe  = File['gmond_conf'],
 require = [ File['gmond_conf'], Package['ganglia-monitor'] ];
 }


And this is the error I get:


Info: FileBucket adding {md5}ac59a119cca8e15b40e85ea496d39970
 Info: /Stage[main]/Ganglia::Install/File[gmond_conf]: Filebucketed 
 /etc/ganglia/gmond.conf to puppet with sum ac59a119cca8e15b40e85ea496d39970
 Notice: /Stage[main]/Ganglia::Install/File[gmond_conf]/content: content 
 changed '{md5}ac59a119cca8e15b40e85ea496d39970' to 
 '{md5}29218a6ac8b11868c311dcbbf26cdf83'
 Info: /Stage[main]/Ganglia::Install/File[gmond_conf]: Scheduling refresh 
 of Service[ganglia-monitor]
 Info: /Stage[main]/Ganglia::Install/File[gmond_conf]: Scheduling refresh 
 of Service[ganglia-monitor]
 Info: /Stage[main]/Ganglia::Install/File[gmond_conf]: Scheduling refresh 
 of Service[ganglia-monitor]
 Debug: /Stage[main]/Ganglia::Install/File[gmond_conf]: The container 
 Class[Ganglia::Install] will propagate my refresh event
 Debug: Service[ganglia-monitor](provider=debian): Executing 'ps -ef'
 Debug: Executing '/etc/init.d/ganglia-monitor start'
 Error: Could not start Service[ganglia-monitor]: Execution of 
 '/etc/init.d/ganglia-monitor start' returned 1: 
 Error: /Stage[main]/Ganglia::Install/Service[ganglia-monitor]/ensure: 
 change from stopped to running failed: Could not start 
 Service[ganglia-monitor]: Execution of '/etc/init.d/ganglia-monitor start' 
 returned 1: 



As a result, *gmond* never restarted when the config file is changed. In 
fact it actually fails (returns 1) id start' is used whilst the service is 
still running.

 

 root@ip-10-0-24-28:~# /usr/sbin/service ganglia-monitor start; echo $?
 Starting Ganglia Monitor Daemon: /usr/sbin/gmond already running.
 1
 root@ip-10-0-24-28:~# 



Am I missing something here? Or how can I force puppet to use 'restart' 
instead? I'm using Puppet v3.2.3. 
Thanks in advance. Cheers!!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


[Puppet Users] How to iterate over a string to construct nagios_service check as exported resource?

2013-03-14 Thread Sans
Dear all,

I wrote a custom fact, which returns a comma separated list of addr:port, 
like this: 


 sb_intl_conn = 
 sbcms-t:22,sbsql05-wvuk-inst5:1434,sborc07-uk-t:1533,..,..,..


The number of elements in the string varies from node to node. I need to do 
a Nagios tcp-port-check on each of them. I think sb_intl_conn.split(,)will 
turn this string into an array and then how can I iterate over it to 
do something like this? 


@@nagios_service { check_stat_${::fqdn}_${addr}_${port}:
 use = 'generic-service',
 check_command   = remote-nrpe-tcp-check!${addr}!${port},
 service_description = V2::CON: ${addr} [Palms],
 display_name= Connection check: ${addr}:${port},
 servicegroups   = 'batch-worker',
 hostgroup_name  = 'batch-job',
 }


Any help would be greatly appreciated. Cheers!!  

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




Re: [Puppet Users] autometically create nagios_hostgroup only when a member of a group comes up

2013-02-20 Thread Sans
Hi Pete, how you doing?


 You will get duplication if you declare a nagioshost_group with the same 
 name on more than one node...
 I think you may be missing the point of nagios_hostgroup. It is for 
 declaring a hostgroup in nagios not setting the nagios hostgroup for a node.


Yes, I know that I'll get duplication error for obvious reason and that's 
the whole reason for asking this Q. I know what the hostgroup is for 
(using Nagios for a while now) and I'm not trying to setting up hostgroup 
for a node. Perhaps I wasn't clear with my question.
 


 I am guessing you are trying to add a node to a hostgroup?
 You will need to add a hostgroups parameter to your nagios_host 
 declaration and set the hostgroup for the node there.


No - I'm not trying to add a  node to hostgroup but I was trying to 
figure out a way to declare a hostgroup only after at least one  member 
of that particular comes online.  Suppose, I've three nodes - N1, N2, N3 
and two  hostgroups - HG1 and HG2. N1 (which is Nagios-server) is being in 
HG1 and N2  N3 in HG2.  


 I am also reasonably sure you can have empty hostgroups in nagios...


Yes you can (overlooked that point, really) until a service (nagios_service 
type) is defined. I think, my actual question would be, how can I query if 
a host with certain name (property) is up and only include that service if 
the node count is at least one or more. I think I can export some sort of 
resource from a given host and collect it on the master (my Nagios server 
is co-located with Puppet master)? Any idea what might be the best possible 
way of doing that? cheers!!


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




  1   2   3   >