Re: [Puppet Users] Passing data between hosts

2015-08-06 Thread Matthew Ceroni
Not sure what you mean?

Part of configuring DNS master is to list the slaves. Therefore I need a way on 
the master to determine the IPs of the slaves. Dynamically is what I am hoping 
to do. Instead of having to place data statically in a hiera file for example

-- 
You received this message because you are subscribed to the Google Groups 
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/dd3c8ea4-a88d-4af4-ab0e-6703daac3c3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Passing data between hosts

2015-08-06 Thread Daniel Dreier
On Thu, Aug 6, 2015 at 5:23 PM, Matthew Ceroni matthewcer...@gmail.com
wrote:

 Scenario:

 Managing DNS via Puppet. On the master I need to be aware of slave NS
 servers so that the NS record can be put into the zone file.

 Creating a zone you supply an array with the name of all the name servers.
 Hard coding this into a hiera file (as an example) doesn't scale well as
 new servers come online.

 Also, on the slaves I need to be aware of the masters to allow for zone
 transfer (again this is passed in via an array to the class that create the
 zone).

 Is there a way I can pass, lets say a variable (ie: dns_slave = SLAVE-IP
 and dns_master = MASTER-IP) between slaves and masters? That way on the
 slaves I can compose my array of masters and pass that to the class and
 vice verse on the masters.

 I know I can use exported resources but I am not really exporting a
 resource just some data? Or would I encapsulate this in some sort of
 resource and then export that?


One option for doing this type of service discovery with puppetdb is
puppetdbquery (https://github.com/dalen/puppet-puppetdbquery). For example,
if your slave NS servers are configured using a profile called
profile::nameserver::slave and the master is configured using a profile
called profile::nameserver::master, the slave profile might query for
something like:

$dns_masters = query_nodes(Class[Profile::Nameserver::Master], ipaddress)

Conversely, the master profile might query for

$dns_slaves = query_nodes(Class[Profile::Nameserver::Slave], ipaddress)

The $dns_masters variable would end up as an array of ipaddresses, listing
all nodes which include the profile::nameserver::master profile. The
$dns_slaves array would similarly contain a list of ipaddresses listing
nodes which include profile::nameserver::slave.

There are two big caveats with this approach:

1) you have a circular dependency; when you boot new infrastructure, you'll
need to run puppet a few times in order for all the nodes to discover each
other.
2) if a node drops out of puppetdb, it will be removed from your
configuration. For example, if you configure a puppetdb node ttl and then
somebody disables puppet on one of the DNS servers, after the node ttl
expires the node will disappear from puppetdb and will consequently be
de-configured. If somebody assumes that puppetdb data is ephemeral and does
a node deactivate on a bunch of nodes it will cause configuration changes.
If you somehow generate empty catalogs, you will also have nodes drop out
of configuration.

The only workaround I'm aware of is to explicitly check the results and
either fail() if you get back an unexpectedly low number of results, or to
make management of the config files in question conditional upon the size
of the returned array. For example, you may decide that you do not wish to
manage config files for DNS slaves when there are zero masters. The
advantage of this approach is that you can still bootstrap, whereas if you
fail you have a more complicated question around bootstrapping a cluster.


-- 
Daniel Dreier
Technical Operations Engineer
GPG: BA4379FD

-- 
You received this message because you are subscribed to the Google Groups 
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/CAGk8suZ0TQ%3D2_y%2Bjbbu08r_ZpRdh2oj3a5DUi5PdRKsiWTJKFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Passing data between hosts

2015-08-06 Thread Peter Kristolaitis
One possible solution is to have your ENC do a discovery for the 
slaves/masters and build the list dynamically.   There are a few 
possible ways that you could do that;  the 2 approaches I would look at 
first would be:


- Use 'mco find' to list all the currently-online nodes, or
- Examine the list of certs issued by Puppet and parse the certificate names

If you're running mcollective, the 'mco find' option might be preferable 
because it represents current state -- that is, here is a list of 
nodes that are online right now that you can talk to.   If a node goes 
offline, it gets removed from the list for all the other nodes on their 
next agent run, and it would get re-added when it comes back online.   
That may or may not be desired behaviour in your environment, however.


The main downside to examining the cert list is that unless you're 
conscientious about removing certs for decommissioned hosts, it may not 
be accurate.


- Peter


On 8/6/2015 8:23 PM, Matthew Ceroni wrote:

Scenario:

Managing DNS via Puppet. On the master I need to be aware of slave NS 
servers so that the NS record can be put into the zone file.


Creating a zone you supply an array with the name of all the name 
servers. Hard coding this into a hiera file (as an example) doesn't 
scale well as new servers come online.


Also, on the slaves I need to be aware of the masters to allow for 
zone transfer (again this is passed in via an array to the class that 
create the zone).


Is there a way I can pass, lets say a variable (ie: dns_slave = 
SLAVE-IP and dns_master = MASTER-IP) between slaves and masters? That 
way on the slaves I can compose my array of masters and pass that to 
the class and vice verse on the masters.


I know I can use exported resources but I am not really exporting a 
resource just some data? Or would I encapsulate this in some sort of 
resource and then export that?


Thanks
--
You received this message because you are subscribed to the Google 
Groups Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to puppet-users+unsubscr...@googlegroups.com 
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CA%2BNsY5iB2oP1ub_H7moRRBnLr_mW9bxFCEiumTMiYBJ_aH%3DwSQ%40mail.gmail.com 
https://groups.google.com/d/msgid/puppet-users/CA%2BNsY5iB2oP1ub_H7moRRBnLr_mW9bxFCEiumTMiYBJ_aH%3DwSQ%40mail.gmail.com?utm_medium=emailutm_source=footer.

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


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


[Puppet Users] Puppet 3.8.2 available

2015-08-06 Thread Kylo Ginsberg
Puppet 3.8.2 is a bug fix release (with future parser changes) in the Puppet
3.8 series.

The main focus of this release is to make sure the 3.8 future parser is
forward-compatible with the Puppet language as of Puppet 4.2. It also add
some new reserved keywords (if using the future parser) and it fixes
several bugs.

Check out the release notes for more information:

https://docs.puppetlabs.com/puppet/3.8/reference/release_notes.html#puppet-382

You can see the full list of changes on the release's JIRA page:

https://tickets.puppetlabs.com/jira/secure/ReleaseNote.jspa?projectId=10102version=13415


If you're installing Puppet for the first time, follow the Installation
Guide: https://docs.puppetlabs.com/guides/install_puppet/pre_install.html

-- 
Kylo Ginsberg | k...@puppetlabs.com | irc: kylo | twitter: @kylog

*PuppetConf 2015 http://2015.puppetconf.com/ is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Bird discount
https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyBird
*
*—**save $249!*

-- 
You received this message because you are subscribed to the Google Groups 
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/CALsUZFHf%3D3q4%3DF3BzrKHo-q6Phu4p%2BABMyNyYuaevRZCjf444Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Passing data between hosts

2015-08-06 Thread Christopher Wood
Rather than reimplement master/slave replication, why not use Puppet to 
configure one of the DNS servers that already do this?

This is along the lines of don't configure thousands of users in puppet, 
configure ldap authentication.

On Thu, Aug 06, 2015 at 05:23:39PM -0700, Matthew Ceroni wrote:
Scenario:
Managing DNS via Puppet. On the master I need to be aware of slave NS
servers so that the NS record can be put into the zone file.
Creating a zone you supply an array with the name of all the name servers.
Hard coding this into a hiera file (as an example) doesn't scale well as
new servers come online.
Also, on the slaves I need to be aware of the masters to allow for zone
transfer (again this is passed in via an array to the class that create
the zone).
Is there a way I can pass, lets say a variable (ie: dns_slave = SLAVE-IP
and dns_master = MASTER-IP) between slaves and masters? That way on the
slaves I can compose my array of masters and pass that to the class and
vice verse on the masters.
I know I can use exported resources but I am not really exporting a
resource just some data? Or would I encapsulate this in some sort of
resource and then export that?
Thanks
 
--
You received this message because you are subscribed to the Google Groups
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [1]puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit

 [2]https://groups.google.com/d/msgid/puppet-users/CA%2BNsY5iB2oP1ub_H7moRRBnLr_mW9bxFCEiumTMiYBJ_aH%3DwSQ%40mail.gmail.com.
For more options, visit [3]https://groups.google.com/d/optout.
 
 References
 
Visible links
1. mailto:puppet-users+unsubscr...@googlegroups.com
2. 
 https://groups.google.com/d/msgid/puppet-users/CA%2BNsY5iB2oP1ub_H7moRRBnLr_mW9bxFCEiumTMiYBJ_aH%3DwSQ%40mail.gmail.com?utm_medium=emailutm_source=footer
3. https://groups.google.com/d/optout

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


[Puppet Users] Array of tags not applying to resource

2015-08-06 Thread Robert Davidson
First of all: I'm running puppet 3.6.2, as we are not in a position to move to 
Puppet 4 yet/

When I try to apply an array of tags to an exported resource, as I should be 
able to according to docs 
(https://docs.puppetlabs.com/puppet/3.6/reference/lang_tags.html#the-tag-metaparameter),
 the tags simply do not apply, and thus collectors fail to function correctly. 
If I apply only a single tag, it works fine.

This works:
@@module::hostentry{ $::fqdn:
   tag = 'host.example.com', 
}   
  
Module::Hostentry | tag != 'host.example.com' |

This does not - fails with duplicate resource errors, because we already have a 
host entry for the machine defined elsewhere:
@@module::hostentry{ $::fqdn:
   tag = ['host.example.com'], 
}   
  
Module::Hostentry | tag != 'host.example.com' |


My actual code is trying to use more than one tag, and looks more like this, 
which again, works if I cut it down to a single tag on the resource:

@@module::hostentry{ $::fqdn:
   tag = [$::fqdn, $::site], 
}   
  
Module::Hostentry | tag ==$::site and tag != $::fqdn|


I must be doing  *something* wrong here, since I haven't been able to turn up 
anyone else complaining about this, and something that is so contrary to what 
the documentation says would surely have hit someone else before now! 


-- 
Robert Davidson


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


[Puppet Users] Passing data between hosts

2015-08-06 Thread Matthew Ceroni
Scenario:

Managing DNS via Puppet. On the master I need to be aware of slave NS
servers so that the NS record can be put into the zone file.

Creating a zone you supply an array with the name of all the name servers.
Hard coding this into a hiera file (as an example) doesn't scale well as
new servers come online.

Also, on the slaves I need to be aware of the masters to allow for zone
transfer (again this is passed in via an array to the class that create the
zone).

Is there a way I can pass, lets say a variable (ie: dns_slave = SLAVE-IP
and dns_master = MASTER-IP) between slaves and masters? That way on the
slaves I can compose my array of masters and pass that to the class and
vice verse on the masters.

I know I can use exported resources but I am not really exporting a
resource just some data? Or would I encapsulate this in some sort of
resource and then export that?

Thanks

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


[Puppet Users] How to add user in centos 6.6 from puppetserver to puppetAgent

2015-08-06 Thread Huynh Tran
I want add user from PuppetMaster to PuppetAgent with authorities root or 
user use. I'll have to configure or code ,how?

-- 
You received this message because you are subscribed to the Google Groups 
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/63651e2a-55ea-4de3-8cf2-091ba0bfd2d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] How to define own data types in Puppet 4?

2015-08-06 Thread Martin Alfke
Hi,

is there the possibility in Puppet 4 to provide own data types.

e.g. 
Fullpath $path

instead of
Regexp[/\/.*/] $path
or
Pattern[/\/.*/] $path

thanks,
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/EF3326F0-2196-4E49-A9E3-EECA66E5ADF9%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Virtual resources not refreshing, how to clean out and re-do?

2015-08-06 Thread jcbollinger


On Wednesday, August 5, 2015 at 3:24:33 PM UTC-5, Steve Wray wrote:

 Oh thanks, that worked. 

 I guess I was confused with the semantics of 'clean' and 'deactivate' and 
 thought 'deactivate' would... deactivate the node not just 'clean' out its 
 virtual resources :)

 It would be nice if there was a curl interface for puppetdb to delete 
 specific virtual resources! So far as I can tell it doesn't work with -X 
 DELETE at all.



For future reference, the term you are looking for is *exported* resource.  
Virtual resources are a different, albeit related, thing.  Exported 
resources are primarily for collection and application on nodes different 
from the one that declares them.  Virtual resources can be collected / 
realized and applied only to the same node that declares them.


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/e34f46c7-f938-4605-a059-102cdfbc6545%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Mixing hiera and site.pp

2015-08-06 Thread jcbollinger


On Wednesday, August 5, 2015 at 7:25:09 AM UTC-5, Alexander Dacre wrote:

 Hi,

 I'm going through an initial deployment of Puppet and was looking to use 
 hiera as much as possible, but it seems that many existing modules do not 
 have hiera support.

 The question I have is, is it 'OK' to have some bits of configuration for 
 a node defined in hiera, and others in site.pp?



What do you mean about existing modules not having Hiera support?  Modules 
do not need special support for Hiera because *every* parameterized class's 
parameters can be provided via Hiera.  This is Puppet's automatic data 
binding feature, and it is by far the most common way that Hiera is used.  
It is the only way that parameterized classes' parameters should be 
assigned from outside their modules.

It is also possible for DSL code to perform explicit data lookups, in which 
case a module might document specific Hiera keys (different from those 
corresponding to class parameters) by which module users can provide data.  
This is not much done any more, however.


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/3eb2d50b-a3ed-42c3-9ff5-c3da04b84494%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid tag '' on node

2015-08-06 Thread Patrick Goedhart
Hi,

When running puppet agent -t I get

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Invalid tag '' on node serverone.local.

But where is this tag?

reg. Patrick.

-- 
You received this message because you are subscribed to the Google Groups 
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/170b75a2-89ad-49f7-8c11-c41f8511db7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Announce: Puppet Enterprise 3.8.2 is available

2015-08-06 Thread Geoff Nichols
Dear Puppet Enterprise Users,

Puppet Enterprise 3.8.2 is now available.

Puppet Enterprise 3.8.2 is a bug-fix and security release of Puppet
Enterprise. All users of Puppet Enterprise 3.x are encouraged to upgrade
when possible to Puppet Enterprise 3.8.2.

For information on the fixes in this release, please see
https://puppetlabs.com/security and
https://docs.puppetlabs.com/pe/3.8/release_notes.html.

As a current Puppet Enterprise user, you can upgrade to this new version as
part of your annual subscription. If upgrading, it is recommended to
upgrade your master and console servers first.

As always, we want to hear about your experiences with Puppet Enterprise.
If you have any questions about upgrading, be sure to get in touch with
Puppet Labs Support.


Geoff Nichols
Release Engineer, Puppet Labs

*PuppetConf 2015 http://2015.puppetconf.com/ is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Bird discount
https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyBird
*
*—**save $249!*

-- 
You received this message because you are subscribed to the Google Groups 
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/CADjnYBwgLrZz7dLXPsfK8X%2B8PWP6dcW1idbFZ-rY1nO%2B%2BZtdfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.