Re: [Puppet Users] Managing Chocolatey sources with File resource and Template on Windows 7 x64 SP1

2015-10-27 Thread Fredrik Nilsson
Should have replied earlier, to much to do I guess.

Anyways what seems to have solved the issue in our case was an update of 
chocolatey to the latest stable release in the form of 0.9.9.11, updating 
the template of the configuration handled by puppet and also updating the 
chocolatey puppet module, I'm unaware of the version in that case, but that 
quieted it all down and now we're back to business as usual...

-- 
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/9e2501d3-04d6-4943-b5ba-9e6f3c2b2391%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Passing 'undef' as a class parameter value

2015-10-27 Thread DEGREMONT Aurelien

Hello

When using class parameters I often face the same issue regarding undef 
usage.

Let's say I got this simple class:

class foo (
  $service_ensure = 'running',
) {
  service { 'foo':
 ensure => $service_ensure;
  }
}


include foo # will set the service running


class { 'foo':
  service_ensure => 'stopped'; # will set the service stopped
}


And now, I would like to say 'do not care about ensure'. Do not touch it.
For that, I need that ensure is set to 'undef'

But I cannot use:

class { 'foo':
  service_ensure => undef;
}

because in this case, Puppet will use the default value of the 
parameter, in this case: running.


I have this problem for a lot of different modules and I looking for a 
simple way to do this.

I would like to avoid adding an if/else in all my classes.


Thanks in advance

Aurélien

--
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/562F3DD7.8010008%40cea.fr.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Manage group resource

2015-10-27 Thread shashank
Hi all,

I am writing module to manage user groups as group resource doesn't have 
attribute called 'Password'. So, how can I manage or assign the group 
passwords to each individual groups by using group resource or any custom 
approach.
Refrence : 
https://docs.puppetlabs.com/references/latest/type.html#group-attributes

Shashank

-- 
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/377f1d4a-4d9c-4e53-908a-4b40625e5e97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet + puppetdb: No Catalog received

2015-10-27 Thread em
Hi,

I have a running puppet installation (version 3.8.3)
I installed and configured a puppetdb node (2.3.8 with postgresql).
Configured puppet master to user the new puppetdb node.

When I run puppet agent from any of the nodes I get a 'Invalid 
relationship Class doesn't seem to be in the catalog'
When I run puppet node status I get:
root@puppet:/etc/puppet# puppet node status test.local
test.local
Currently active
No catalog received
Last facts: 2015-10-27T10:40:49.778Z

In the puppetdb logs I see '[replace facts]', but no '[replace catalog]' 
like mentioned in the documentation.

any idas?

-- 
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/215a44ca-79d7-4a4f-be29-ed3266e07bb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Passing 'undef' as a class parameter value

2015-10-27 Thread Christopher Wood
Unless there have been any developments of which I am unaware, you would need 
to handle this in the code+hiera. Here's where I dribbled all over this thing a 
few months ago:

https://groups.google.com/forum/#!msg/puppet-users/0l3m4VCHjOg/KKlz5LNpCgYJ

On Tue, Oct 27, 2015 at 10:03:19AM +0100, DEGREMONT Aurelien wrote:
> Hello
> 
> When using class parameters I often face the same issue regarding undef
> usage.
> Let's say I got this simple class:
> 
> class foo (
>   $service_ensure = 'running',
> ) {
>   service { 'foo':
>  ensure => $service_ensure;
>   }
> }
> 
> 
> include foo # will set the service running
> 
> 
> class { 'foo':
>   service_ensure => 'stopped'; # will set the service stopped
> }
> 
> 
> And now, I would like to say 'do not care about ensure'. Do not touch it.
> For that, I need that ensure is set to 'undef'
> 
> But I cannot use:
> 
> class { 'foo':
>   service_ensure => undef;
> }
> 
> because in this case, Puppet will use the default value of the parameter, in
> this case: running.
> 
> I have this problem for a lot of different modules and I looking for a
> simple way to do this.
> I would like to avoid adding an if/else in all my classes.
> 
> 
> Thanks in advance
> 
> Aurélien
> 
> -- 
> 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/562F3DD7.8010008%40cea.fr.
> For more options, visit https://groups.google.com/d/optout.

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


[Puppet Users] Manage Group Password

2015-10-27 Thread shashank
Hi all,

I am writing a module to manage user groups,but as the group resource 
doesn't have attribute called 'Password'. So, how can I manage or assign 
the group passwords to each individual groups by using group resource or 
any custom approach.
Refrence : 
https://docs.puppetlabs.com/references/latest/type.html#group-attributes

Shashan

-- 
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/11f0bb54-d29e-4c1c-8bdc-8428778203b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: connecting puppet servers to puppet db

2015-10-27 Thread Felix Barbeira
It happens the same to me.

root@:/etc/puppetlabs/puppet# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will 
continue:
Warning: Error 400 on SERVER: Could not retrieve facts for server.com: 
Failed to find facts from PuppetDB at puppet:8140: Failed to execute 
'/pdb/query/v4/nodes/server.com/facts' on any of the following 
'server_urls': https://puppetdb.server.com:8081
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Failed to execute 
'/pdb/cmd/v1?checksum=08ac7826fda2b64eb59d85ec1f5d2a54da225a03' on any of 
the following 'server_urls': https://puppetdb.server.com:8081
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
root@:/etc/puppetlabs/puppet#


El viernes, 2 de octubre de 2015, 16:31:16 (UTC+2), Svan escribió:
>
> Hi. I need help connecting a puppet server to puppetdb.
>
> I installed puppetdb from packages (debian wheezy) following a guide from 
> https://docs.puppetlabs.com/puppetdb/latest/install_from_packages.html
>
> The install went fine :
> 1) before installing puppetdb, puppet was configured on the puppetdb host 
> and 'puppet agent -t' finished successfully.
> 2) postgresql and puppetdb were installed and configured. service puppetdb 
> status returns :
> [ ok ] puppetdb is running.
>
> But I can't get my puppet server to use puppet db.
> I followed this guide 
> https://docs.puppetlabs.com/puppetdb/latest/connect_puppet_master.html
>
> Here are the config files that were modified :
>
> /etc/puppetlabs/puppet/puppet.conf
> [main]
> server = puppetmaster.virt.mydomain.com
> certname = puppetmaster.virt.mydomain.com
>
> [master]
> dns_alt_names = puppetmaster
> vardir = /opt/puppetlabs/server/data/puppetserver
> logdir = /var/log/puppetlabs/puppetserver
> rundir = /var/run/puppetlabs/puppetserver
> pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
> codedir = /etc/puppetlabs/code
> storeconfigs = true
> storeconfigs_backend = store,puppetdb
> reports = puppetdb
>
>
>
> /etc/puppetlabs/puppet/puppetdb.conf 
> [main]
> server_urls = https://puppetdb.virt.mydomain.com:8081
>
>
>
> /etc/puppetlabs/puppet/routes.yaml
> ---
> master:
>   facts:
> terminus: puppetdb
> cache: yaml
>
>
> I changed the ownership of all files and directories under 
> /etc/puppetlabs/puppet to puppet:puppet
>
>
> But when I run 'puppet agent -t' on any host, I get the following error :
>
> $ puppet agent -t
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Failed to submit 'replace facts' command for ftp.virt.mydomain.com to 
> PuppetDB at puppetdb:8081: Error executing http request
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
>
> /var/log/puppetlabs/puppetserver/puppetserver.log shows this error :
>
> 2015-10-02 10:40:10,530 ERROR [c.p.h.c.i.PersistentSyncHttpClient] Error 
> executing http request
> javax.net.ssl.SSLException: hostname in certificate didn't match: 
>  != 
>
>
> It seems that puppet server tries to establish a connexion with puppetdb 
> instead of puppetdb.virt.mydomain.com.
> But puppetdb.conf points to puppetdb.virt.mydomain.com
> I don't get it.
>
> puppetdb is reachable from puppet server
>
> svan@puppetmaster:/etc/puppetlabs/puppet# telnet 
> puppetdb.virt.mydomain.com 8081
> Trying 10.10.0.8...
> Connected to puppetdb.virt.mydomain.com.
> Escape character is '^]'.
> ^CConnection closed by foreign host.
>
> svan@puppetmaster:/etc/puppetlabs/puppet# telnet puppetdb 8081
> Trying 10.10.0.8...
> Connected to puppetdb.virt.mydomain.com.
> Escape character is '^]'.
> ^CConnection closed by foreign host.
>
> Any help would be appreciated.
>
> Thanks.
>
> Svan.
>

-- 
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/b2296050-1139-4aec-9040-b0c7ca0420fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: RHEL 7 - Satellite 6.1 - Puppet Locally

2015-10-27 Thread jcbollinger


On Monday, October 26, 2015 at 9:03:41 AM UTC-5, Tom Zurita wrote: 

> [root@rhel7-test2 manifests]# puppet module list
>
> /etc/puppet/modules
>
> ├── cis-puppet (???)
>
> ├── duritong-sysctl (v0.0.11)
>
> └── puppetlabs-stdlib (v4.9.0)
>
> /usr/share/puppet/modules (no modules installed)
>
>
> puppet apply --modulepath=/etc/puppet/modules 
> /etc/puppet/modules/cis-puppet/manifests/test.pp
>
>
> I don't get errors just doesn't change a thing, nor does it show it 
> running that script.
>
>
>

Giving the --debug option on the 'puppet agent' command line should give 
you more console output describing what's going on.  Giving the 
--detailed-exitcodes option will make puppet's exit code more informative 
about what happened during the run.  The results of both of those (you can 
use them together) may help you diagnose the problem, and probably *will* 
help us do so.


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/29d538a7-cb70-4eb1-aa60-abb6eef508cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Passing 'undef' as a class parameter value

2015-10-27 Thread Christopher Wood
Using undef in a class declaration... appears to be the subject of a bunch of 
documents I am ill-qualified to interpret.

https://docs.puppetlabs.com/puppet/latest/reference/lang_data_undef.html

"Puppet’s special undef value is roughly equivalent to nil in Ruby; it 
represents the absence of a value", implying that using undef in a class 
parameter is like not having that class parameter in the first place. I thought 
of hiera because when hiera returns nil it is interpreted as "value not 
present" per that thread.

https://docs.puppetlabs.com/puppet/latest/reference/lang_classes.html#overriding-resource-attributes

https://projects.puppetlabs.com/issues/16221

So yes, absolutely doesn't work.


On Tue, Oct 27, 2015 at 12:07:26PM +0100, DEGREMONT Aurelien wrote:
> Le 27/10/2015 11:12, Christopher Wood a écrit :
> >Unless there have been any developments of which I am unaware, you would 
> >need to handle this in the code+hiera. Here's where I dribbled all over this 
> >thing a few months ago:
> >
> >https://groups.google.com/forum/#!msg/puppet-users/0l3m4VCHjOg/KKlz5LNpCgYJ
> 
> I think it is different. In my example, there is no hiera involved.
> My problem is :
> I want my class param value to be 'undef', and not it being 'use the default
> value'
> 
> There is no way to set a class param value to undef if there is default
> value for it different from undef.
> 
> Thanks anyway
> 
> >
> >On Tue, Oct 27, 2015 at 10:03:19AM +0100, DEGREMONT Aurelien wrote:
> >>Hello
> >>
> >>When using class parameters I often face the same issue regarding undef
> >>usage.
> >>Let's say I got this simple class:
> >>
> >>class foo (
> >>   $service_ensure = 'running',
> >>) {
> >>   service { 'foo':
> >>  ensure => $service_ensure;
> >>   }
> >>}
> >>
> >>
> >>include foo # will set the service running
> >>
> >>
> >>class { 'foo':
> >>   service_ensure => 'stopped'; # will set the service stopped
> >>}
> >>
> >>
> >>And now, I would like to say 'do not care about ensure'. Do not touch it.
> >>For that, I need that ensure is set to 'undef'
> >>
> >>But I cannot use:
> >>
> >>class { 'foo':
> >>   service_ensure => undef;
> >>}
> >>
> >>because in this case, Puppet will use the default value of the parameter, in
> >>this case: running.
> >>
> >>I have this problem for a lot of different modules and I looking for a
> >>simple way to do this.
> >>I would like to avoid adding an if/else in all my classes.
> >>
> >>
> >>Thanks in advance
> >>
> >>Aurélien
> >>
> >>-- 
> >>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/562F3DD7.8010008%40cea.fr.
> >>For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/562F5AEE.8040007%40cea.fr.
> For more options, visit https://groups.google.com/d/optout.

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


Re: [Puppet Users] Passing 'undef' as a class parameter value

2015-10-27 Thread DEGREMONT Aurelien

Le 27/10/2015 11:12, Christopher Wood a écrit :

Unless there have been any developments of which I am unaware, you would need 
to handle this in the code+hiera. Here's where I dribbled all over this thing a 
few months ago:

https://groups.google.com/forum/#!msg/puppet-users/0l3m4VCHjOg/KKlz5LNpCgYJ


I think it is different. In my example, there is no hiera involved.
My problem is :
I want my class param value to be 'undef', and not it being 'use the 
default value'


There is no way to set a class param value to undef if there is default 
value for it different from undef.


Thanks anyway



On Tue, Oct 27, 2015 at 10:03:19AM +0100, DEGREMONT Aurelien wrote:

Hello

When using class parameters I often face the same issue regarding undef
usage.
Let's say I got this simple class:

class foo (
   $service_ensure = 'running',
) {
   service { 'foo':
  ensure => $service_ensure;
   }
}


include foo # will set the service running


class { 'foo':
   service_ensure => 'stopped'; # will set the service stopped
}


And now, I would like to say 'do not care about ensure'. Do not touch it.
For that, I need that ensure is set to 'undef'

But I cannot use:

class { 'foo':
   service_ensure => undef;
}

because in this case, Puppet will use the default value of the parameter, in
this case: running.

I have this problem for a lot of different modules and I looking for a
simple way to do this.
I would like to avoid adding an if/else in all my classes.


Thanks in advance

Aurélien

--
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/562F3DD7.8010008%40cea.fr.
For more options, visit https://groups.google.com/d/optout.


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


Re: [Puppet Users] puppet + puppetdb: No Catalog received

2015-10-27 Thread em
Hi Ken,

The actual error is:
# puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Invalid relationship: Apt::Source[puppetlabs] { notify => 
Class[apt::update] }, because Class[apt::update] doesn't seem to be in the 
catalog
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

This works fine if I don't use puppetdb (remove the routes.yaml and comment 
the storeconfig files:
#storeconfigs   = true
#thin_storeconifgs = false
#storeconfigs_backend = puppetdb



On Tuesday, October 27, 2015 at 12:35:11 PM UTC+1, Ken Barber wrote:
>
> > I have a running puppet installation (version 3.8.3) 
> > I installed and configured a puppetdb node (2.3.8 with postgresql). 
> > Configured puppet master to user the new puppetdb node. 
> > 
> > When I run puppet agent from any of the nodes I get a 'Invalid 
> > relationship Class doesn't seem to be in the catalog' 
>
> This is the error we should be focusing on. Can you post the full 
> error in context with the surrounding agent log? Can you double check 
> the relationship its pointing out in the error, and check for any 
> upper/lower case issues and ensure the name in the relationship is 
> 100% correct, I've seen this kind of thing before and sometimes its 
> down to a typo. Try removing the relationship and seeing if it solves 
> it at least for test purposes perhaps. 
>
> > When I run puppet node status I get: 
> > root@puppet:/etc/puppet# puppet node status test.local 
> > test.local 
> > Currently active 
> > No catalog received 
> > Last facts: 2015-10-27T10:40:49.778Z 
> > 
> > In the puppetdb logs I see '[replace facts]', but no '[replace catalog]' 
> > like mentioned in the documentation. 
>
> The first error above means the catalog does not compile correctly, so 
> no catalog is ever submitted to PuppetDB. 
>
> ken. 
>
> > 
> > any idas? 
> > 
> > -- 
> > 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/215a44ca-79d7-4a4f-be29-ed3266e07bb8%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

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


Re: [Puppet Users] puppet + puppetdb: No Catalog received

2015-10-27 Thread em
Sorry, I was missing one 'upper/lower case' Class.

I fixed all of them and now it's working.

thanks! :)

On Tuesday, October 27, 2015 at 1:43:03 PM UTC+1, em wrote:
>
> Hi Ken,
>
> The actual error is:
> # puppet agent -t
> Info: Retrieving pluginfacts
> Info: Retrieving plugin
> Info: Loading facts
> Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
> Invalid relationship: Apt::Source[puppetlabs] { notify => 
> Class[apt::update] }, because Class[apt::update] doesn't seem to be in the 
> catalog
> Warning: Not using cache on failed catalog
> Error: Could not retrieve catalog; skipping run
>
> This works fine if I don't use puppetdb (remove the routes.yaml and 
> comment the storeconfig files:
> #storeconfigs   = true
> #thin_storeconifgs = false
> #storeconfigs_backend = puppetdb
>
>
>
> On Tuesday, October 27, 2015 at 12:35:11 PM UTC+1, Ken Barber wrote:
>>
>> > I have a running puppet installation (version 3.8.3) 
>> > I installed and configured a puppetdb node (2.3.8 with postgresql). 
>> > Configured puppet master to user the new puppetdb node. 
>> > 
>> > When I run puppet agent from any of the nodes I get a 'Invalid 
>> > relationship Class doesn't seem to be in the catalog' 
>>
>> This is the error we should be focusing on. Can you post the full 
>> error in context with the surrounding agent log? Can you double check 
>> the relationship its pointing out in the error, and check for any 
>> upper/lower case issues and ensure the name in the relationship is 
>> 100% correct, I've seen this kind of thing before and sometimes its 
>> down to a typo. Try removing the relationship and seeing if it solves 
>> it at least for test purposes perhaps. 
>>
>> > When I run puppet node status I get: 
>> > root@puppet:/etc/puppet# puppet node status test.local 
>> > test.local 
>> > Currently active 
>> > No catalog received 
>> > Last facts: 2015-10-27T10:40:49.778Z 
>> > 
>> > In the puppetdb logs I see '[replace facts]', but no '[replace 
>> catalog]' 
>> > like mentioned in the documentation. 
>>
>> The first error above means the catalog does not compile correctly, so 
>> no catalog is ever submitted to PuppetDB. 
>>
>> ken. 
>>
>> > 
>> > any idas? 
>> > 
>> > -- 
>> > 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/215a44ca-79d7-4a4f-be29-ed3266e07bb8%40googlegroups.com.
>>  
>>
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>

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


Re: [Puppet Users] RHEL 7 - Satellite 6.1 - Puppet Locally

2015-10-27 Thread Trevor Vaughan
Hi Tom,

What's the content of test.pp?

Thanks,

Trevor

On Mon, Oct 26, 2015 at 9:47 AM, Tom Zurita  wrote:

> We deploy our servers and use Puppet using Satellite 6.1.  I deployed a
> server and am trying to test modules locally and it NEVER works.
>
> cat /etc/puppet/puppet.conf
>
>
> [main]
>
> vardir = /var/lib/puppet
>
> logdir = /var/log/puppet
>
> rundir = /var/run/puppet
>
> ssldir = $vardir/ssl
>
>
> [agent]
>
> pluginsync  = true
>
> report  = true
>
> ignoreschedules = true
>
> daemon  = false
>
> ca_server   = blah
>
> certname= rhel7-test2.blah.edu
>
> environment = KT_SI_Org_Default_RHEL7_Prod_RHEL7_comp_CV_14
>
> # server  = blah
>
>
> [root@rhel7-test2 manifests]#  puppet config print modulepath
>
> /etc/puppet/modules:/usr/share/puppet/modules
>
>
> [root@rhel7-test2 manifests]# puppet module list
>
> /etc/puppet/modules
>
> ├── cis-puppet (???)
>
> ├── duritong-sysctl (v0.0.11)
>
> └── puppetlabs-stdlib (v4.9.0)
>
> /usr/share/puppet/modules (no modules installed)
>
>
> puppet apply --modulepath=/etc/puppet/modules
> /etc/puppet/modules/cis-puppet/manifests/test.pp
>
>
> I don't get errors just doesn't change a thing, nor does it show it
> running that script.
>
>
> --
> 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/f7a79794-97d8-49d2-8a03-f64f847fef38%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



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

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

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


Re: [Puppet Users] puppet + puppetdb: No Catalog received

2015-10-27 Thread Ken Barber
> I have a running puppet installation (version 3.8.3)
> I installed and configured a puppetdb node (2.3.8 with postgresql).
> Configured puppet master to user the new puppetdb node.
>
> When I run puppet agent from any of the nodes I get a 'Invalid
> relationship Class doesn't seem to be in the catalog'

This is the error we should be focusing on. Can you post the full
error in context with the surrounding agent log? Can you double check
the relationship its pointing out in the error, and check for any
upper/lower case issues and ensure the name in the relationship is
100% correct, I've seen this kind of thing before and sometimes its
down to a typo. Try removing the relationship and seeing if it solves
it at least for test purposes perhaps.

> When I run puppet node status I get:
> root@puppet:/etc/puppet# puppet node status test.local
> test.local
> Currently active
> No catalog received
> Last facts: 2015-10-27T10:40:49.778Z
>
> In the puppetdb logs I see '[replace facts]', but no '[replace catalog]'
> like mentioned in the documentation.

The first error above means the catalog does not compile correctly, so
no catalog is ever submitted to PuppetDB.

ken.

>
> any idas?
>
> --
> 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/215a44ca-79d7-4a4f-be29-ed3266e07bb8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


[Puppet Users] Puppet agent and XCP-XAPI collision in Debian Wheezy

2015-10-27 Thread Andrey Karadimov
Hi all,

I want to share my experience with puppet agent installed in Dom0 managed 
by xapi.
Just to mention that the problem exist in puppet updates after Feb 2015 - 
Sorry I can't be more precise. Before that date, puppet agent and xcp-xapi 
works fine together.
Generally speaking xapi stop working if the puppet agent is running as well.

OS: Debian Wheezy (amd64) with latest updates (kernel: 3.2.68-1+deb7u4) 
(xcp-xapi: 1.3.2-15)
Puppet agent version: 3.8.3-1puppetlabs1 from repository: deb 
http://apt.puppetlabs.com wheezy main

No specific log from puppet side.
Xapi error:
Oct 26 16:12:51 observer xapi: [ info|observer|0 thread_zero||watchdog] 
(Re)starting xapi...
Oct 26 16:13:23 observer xapi: [ warn|observer|0 thread_zero|server_init 
D:d41f8aa4b48c|startup] task [Listening localhost] exception: 
Failure("Repeatedly failed to bind: INET 127.0.0.1:80")
Oct 26 16:13:23 observer xapi: [error|observer|0 thread_zero||xapi] Caught 
exception at toplevel: 'Failure("Repeatedly failed to bind: INET 
127.0.0.1:80")'
Oct 26 16:13:23 observer xcp-fe: 11825 (/usr/sbin/xapi -nowatchdog list) 
exitted with code 2
Oct 26 16:13:23 observer xapi: [ info|observer|0 thread_zero||watchdog] 
received exit code 2
Oct 26 16:13:23 observer xapi: [ info|observer|0 thread_zero||watchdog] 
Received bad exit, retrying
Oct 26 16:13:23 observer xapi: [ info|observer|0 thread_zero||watchdog] 
(Re)starting xapi...

The only possible way to restore the working condition of xcp-xapi is to 
restart it. But fails again ones the puppet agent is running.

Can somebody share similar experience and any resolution in order to keep 
the both services running together?

Puppet agent configuration:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter

[master]
# These are needed when the puppetmaster is run by passenger
# and can safely be removed if webrick is used.
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY

[agent]
report=true
server=[puppet_master_host]



-- 
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/7f9bceee-b6b5-470f-9034-ce6b4ba7120e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Passing Powershell Variables into Puppet manifest

2015-10-27 Thread tom . swaby
Hi all

Im having difficulty passing powershell variables into Puppet, while using 
the Powershell module.

What I need to achieve is this in powershell. It is basically a script that 
executes a check to see if a windows module is installed, and if not, 
copies it from a source directory. 

*This is the powershell script*

$check = Get-WindowsFeature -name Net-Framework-Core
$source = "\\server\directory\directory2\directory3"
$destination = "C:\source3"
if ($check.Installed -ne "True") {
Copy-Item $source -Destination $destination -Recurse
Install-WindowsFeature Net-Framework-Core
Remove-Item $destination -Recurse
}

*This is my puppet manifest*

class profiles::dotnetrun {


$check = "Get-WindowsFeature -name Net-Framework-Core"

$source = "server\\directory\\directory2\\directory3"

$destination = "C:\source3"


exec { 'dotnet':

command => 'Copy-Item \$source -Destination \$destination -Recurse',

onlyif => '\$check.Installed -ne "True"',

provider => powershell,


}

}

-- 
 

ITV plc (Registration No. 4967001) (ITV) is incorporated in England and 
Wales with its registered office at The London Television Centre, Upper 
Ground, London SE1 9LT. Please visit www.itv.com for further information.

This email and any attachments are intended solely for the addressee and 
may contain confidential, copyrighted and/or privileged information.  If 
you have received this message in error, please notify us and delete it.  
Recipients should scan the email and any attachments for their own 
protection. 

This email does not conclude a binding agreement.  The views or opinions 
presented in this email do not necessarily represent those of ITV.

-- 
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/5672654e-6c18-4fdd-a2c7-d4c62cba1a03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: puppetlabs/apache module and changin the default port

2015-10-27 Thread jcbollinger


On Monday, October 26, 2015 at 8:41:02 AM UTC-5, tobias...@gmail.com wrote:
>
> As far as I have read it's not possible to change the default port for 
> Apache
>
> class 
> { 'apache': default => 8080, } 
>
> apache::listen 
> { '8080': } 
>
> will just add the port 8080 but the port 80 is still available.
>
>
> Is this a bug? If not does somebody know how to do that?
>


As far as I can tell from the module's source, only the Listen directives 
you explicitly declare are recorded in the apache configuration 
(specifically, in ports.conf).  According to the apache docs, the server 
listens only to those addresses/ports you explicitly configure.  The module 
source appears to indicate that by default, puppet will restart the httpd 
service if it modifies apache configuration, thereby making it read and use 
the new configuration.

Therefore, I am inclined to believe either that you are using a (very) old 
version of the module, or that your report is inaccurate (perhaps puppet 
has not or cannot apply the configuration you specify?).  What version of 
the module are you in fact using?  How do you reproduce and substantiate 
this issue?


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/253b2712-a005-4d1d-b617-fa67d2a33de3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Passing 'undef' as a class parameter value

2015-10-27 Thread jcbollinger


On Tuesday, October 27, 2015 at 4:03:33 AM UTC-5, Aurélien Degrémont wrote:
>
> Hello 
>
> When using class parameters I often face the same issue regarding undef 
> usage. 
> Let's say I got this simple class: 
>
> class foo ( 
>$service_ensure = 'running', 
> ) { 
>service { 'foo': 
>   ensure => $service_ensure; 
>} 
> } 
>
>
> include foo # will set the service running 
>
>
> class { 'foo': 
>service_ensure => 'stopped'; # will set the service stopped 
> } 
>
>
> And now, I would like to say 'do not care about ensure'. Do not touch it. 
>
 

> For that, I need that ensure is set to 'undef' 
>


The easiest way to approach the problem is to default to not managing 
whether the service foo is running, or else to avoid declaring class foo at 
all on machines where you don't care about the state of the resources it 
manages.

 

>
> But I cannot use: 
>
> class { 'foo': 
>service_ensure => undef; 
> } 
>
> because in this case, Puppet will use the default value of the 
> parameter, in this case: running. 
>
> I have this problem for a lot of different modules and I looking for a 
> simple way to do this. 
> I would like to avoid adding an if/else in all my classes. 
>
>

Bad news: undef is not a value, so you cannot pass it or assign it.  
Accepted forms that look like assigning or passing undef have the effect of 
undefining an existing definition or affirming that none is given.  If you 
want such behavior to be available, but not to be the default, then you 
pretty much need conditional logic.  The traditional form of this usually 
goes the other way, but here's how you could apply it to your situation:

class foo ($service_ensure = 'running') {
  service { 'foo':
ensure => $service_ensure ? { 'UNDEF' => undef, default => 
$service_ensure }
  }
}

On the other hand, there are ways to shift around the location of the 
conditionality.  The forms most likely to suit you involve overriding 
resource properties 
.
  
You can do that anywhere, for any resource, via a resource collector, but 
I'm a fan employing a bit of discipline and using classification to control 
such things.  That requires using class inheritance (and this is the 
original and most appropriate use case for class inheritance).  To approach 
the problem that way, you would add a class alongside to your original one:

class foo ( 
   $service_ensure = 'running', 
) { 
   service { 'foo': 
  ensure => $service_ensure; 
   } 
} 

class foo::unmanaged inherits foo { 
   Service['foo'] { 
  ensure => undef 
   } 
}

Declaring class foo::unmanaged either instead of or in addition to class foo 
will then have all the effects of declaring class foo, except that the 
ensure property of Service['foo'] will be as if never declared.  In this 
case, the conditionality is pulled up to wherever you decide whether to 
declare class foo::unmanaged, and that can be all the way to the ENC / node 
block selector, so that it does not correspond to any explicit conditional 
in your DSL code.

There are other ways to approach the problem as well, mostly revolving 
around using Hiera for binding data to your class parameters (which is 
absolutely the only way you should *ever* assign non-default parameters to 
your modules' public classes).  It's not straightforward in Hiera, however, 
because as far as I know, Hiera does not provide a means to override a 
property mapping with absence of any mapping.


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/5543f502-4498-436c-80af-0bf695eaab4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.