[Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2014-11-06 Thread james . eckersall
Try using the splay config option on the agents.  It should help to 
distribute the agent runs.
https://docs.puppetlabs.com/references/latest/configuration.html#splay

If that fails, you could try running the puppet agent from a cron job 
instead with randomised start times as per the below link.

http://mycfg.net/articles/random-start-times-for-cron-jobs-with-puppet.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/82975c46-fe25-4561-aab5-855d2124daec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2014-11-06 Thread Felix Frank
On 11/06/2014 09:25 AM, james.eckers...@fasthosts.com wrote:
 
 If that fails, you could try running the puppet agent from a cron job
 instead with randomised start times as per the below link.

+1

I have yet to see a disadvantage of cron vs. the background agent.

-- 
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/545B3130.90007%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2014-11-06 Thread james . eckersall
I used to have issues with the agent leaking memory over time.  This is 
going back to 2.6 days.
I implemented a cron job back then to restart the agent every night and 
never removed the job (even though I'm now running 3.6), so I don't know if 
there are still memory issues with the agent daemon.

If you were aiming for a smaller resource footprint on the server, the cron 
route would likely be better as it's one less daemon running 24-7 on each 
node.

-- 
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/2dc3d340-3643-46d0-bebe-45254f1912a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Variable interpolation failing with structured facts

2014-11-06 Thread Thomas Hager

On 2014-11-05 15:53, jcbollinger wrote:

Well no, Puppet IS interpolating. It is interpolating the string value
of the whole hash. What it is not doing is interpreting the index as
an index. Try this:

notice(${os[family]})

I make it a general rule to _always_ use braces around variable
references in quoted strings, even where not strictly necessary. It is
harmless to do so, and it saves having to determine on a case by case
basis whether braces are needed.

Yes, of course, stupid me. Thanks for the heads up.

I wrote the test manifest properly and now the result is as expected.

Thx,
Tom.

--
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/1df81fdbb775053f652272d7d9e41e27%40sigsegv.at.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Pitching an apache use-case

2014-11-06 Thread Dan White

My workplace finally decided to automate down past the basic operating system 
level.
Multiple web sites are stacked on single physical servers and that practice 
threatens to extend into the upcoming virtualization.

I made a test-sandbox run with the puppetlabs-apache module from The Forge and 
it will not do what I need without serious modification.

The reason I am posting this to the list is to see how many other folks could 
use similar functionality.  If few, then I will not devote too much time 
customizing.

Here's what I need to manage that diverges from puppetlabs-apache:  Multiple 
sites, each running a uniqe instance of their binaries, each needing its own 
customized startup scripts and configuration files.  My plan would be to pull 
all the necessary configuration down into the vhost class/define from the main 
class and allow for multiple, customized configs and scripts.

If enough folks like this idea, then I feel it worth pushing mods back up to 
The Forge, either as a direct contribution to puppetlabs-apache or as a 
cloned/expanded module with a new name.

“Sometimes I think the surest sign that intelligent life exists elsewhere in the 
universe is that none of it has tried to contact us.”  (Bill Waterson: Calvin  
Hobbes)

--
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/63bb3f60-e1a6-4496-89be-d3192885c349%40me.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Environments with Hiera

2014-11-06 Thread jcbollinger


On Wednesday, November 5, 2014 8:48:01 AM UTC-6, Mark Rosedale wrote:

 Sorry I guess I was confused I thought Hiera is an ENC...am I wrong about 
 that? 


Yes, you are wrong.  Hiera is an external data service with special Puppet 
integration, not an ENC.  Hiera can be used to serve *almost* all the same 
purposes as an ENC, albeit by different means, but assigning nodes to 
environments is one ENC function that Hiera cannot serve.

You can find out more about ENCs here: 
https://docs.puppetlabs.com/guides/external_nodes.html.


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/a1a811a4-507c-4250-89dd-fd73cce7186b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Puppet Environments with Hiera

2014-11-06 Thread jcbollinger


On Thursday, November 6, 2014 8:17:28 AM UTC-6, jcbollinger wrote:


 Hiera is an external data service with special Puppet integration, not an 
 ENC.



That turns out to be very important, by the way, because a master can have 
only one ENC configured at a time.  Masters that use an ENC do not thereby 
foreclose the possibility of using Hiera.


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/6cada760-4adb-4686-8bcb-061bc0b3e51a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet Environments with Hiera

2014-11-06 Thread R.I.Pienaar


- Original Message -
 From: jcbollinger john.bollin...@stjude.org
 To: puppet-users puppet-users@googlegroups.com
 Sent: Thursday, November 6, 2014 3:21:18 PM
 Subject: [Puppet Users] Re: Puppet Environments with Hiera

 On Thursday, November 6, 2014 8:17:28 AM UTC-6, jcbollinger wrote:


 Hiera is an external data service with special Puppet integration, not an
 ENC.

 
 
 That turns out to be very important, by the way, because a master can have
 only one ENC configured at a time.  Masters that use an ENC do not thereby
 foreclose the possibility of using Hiera.
 

should be pretty simple to write a node indirector that fetches the environment 
from hiera :)

not sure if that would still allow node blocks to be used in addition but to 
replace
the usual node default { include(hiera_array(klasses)) } should be real easy 
to do
which would then support setting the environment too.

-- 
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/1496970892.15327.1415284066171.JavaMail.zimbra%40devco.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: schedule metaparameter

2014-11-06 Thread jcbollinger


On Wednesday, November 5, 2014 2:46:57 PM UTC-6, Mark Rosedale wrote:

 One other question. Can you apply schedules to classes? It seems that you 
 cannot, but I just wanted to confirm that. 



I have not tried it, but it is not documented to work.  The 'noop' 
metaparameter is known *not* to work on classes, with no current intention 
to change that, so there is no particular reason to suppose that the 
'schedule' metaparameter should work.  Contrast that with defined type 
instances, for which the effect of metaparameters *is* documented, and 
remember always that *classes are not resources*.  Even if you found that 
'schedule' happened to work for classes, it would be unwise to rely on an 
undocumented behavior such as that.


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/66f68be2-13b0-44db-a65b-a41a0466ac32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: install directory for package, and other basic questions

2014-11-06 Thread jcbollinger


On Friday, October 10, 2014 10:50:34 PM UTC-5, Matyas A. Sustik wrote:

 I am new to Puppet. I hoped someone in this group could get me on the 
 right track with some questions I have.

 1. I would appreciate an example demonstrating how to tell puppet to 
 install a specific package in a specific location? For example, how to 
 write that python2.7 should be installed in /usr/local/bin?



Note that although there may be a Python 2.7 package for your system, 
Python 2.7 is not in itself a 'package' in the sense that term is used in 
Puppet.  A 'package' in Puppet is an RPM, or a DEB, or even a Python pip or 
Ruby gem.  These sorts of packages generally get installed to whatever 
location the packaging system chooses.  On a package by package basis, 
however, and depending on package type, you may be able to influence 
installation location via the 'install_options' parameter of the Package 
resource type.

 


 2. How to install a python module, for example pandas? From the command 
 line one could use pip. Does puppet know about pip?



Puppet does know about pip, but generally speaking, it's bad news to use 
different package management systems on the same system.  You really should 
use packages of the native packaging type, managed by the system's package 
manager, even if you have to create the needed packages and keep them in a 
local repository within your organization.  (Though plenty of people do 
ignore this policy advice.)

 

 3. How to install a package from the tarballs and specify some parameters 
 to the install process?



You can use Exec resources to do this if for some reason it is not feasible 
to build a *bona fide* package in the package management sense.  I don't 
like it, but I have done it.  From an individual system perspective, it has 
all the negative consequences of a manual source install, but it at least 
has the advantage of repeatability.


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/ce971b71-16ce-4d23-8e56-3a8792fb317b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: HIera Debugging Tool

2014-11-06 Thread Mike Skint
Nice stuff Lee,

giving it a look now.

On Tuesday, November 4, 2014 5:23:15 AM UTC-8, Lee Lowder wrote:

 All,

 I've been working on a Hiera debugging tool, and it's now at the point 
 where I consider it to be a minimally viable product.

 Currently it will work with Puppet Enterprise and Open Source Puppet, and 
 you can supply identity for nodes by supplying YAML, JSON or a user (which 
 will be used to get data from MCollective).

 When invoked, it will give you a list of all hiera(), hiera_array() and 
 hiera_hash() calls and as of recently, also will do a lookup on all class 
 params. These look ups will be done for every node the master is aware of.

 The current version is 0.2.1, and is available at 
 https://github.com/llowder/glowing-octo-ninja

 The next set of features I am considering adding are:

  - Ability to look up the value of a single key across all nodes
  - Ability to lookup the value of all keys for a specific node

 I'll be adding both, but I wanted to see which would be considered more 
 useful so I know which to add first. I'll be working on improving 
 performance, error handling and unit/regression tests.

 Comments and suggestions are much welcome, and hopefully this will be a 
 useful tool.

  - Lee


-- 
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/d107dad2-7365-4814-bbf5-2b114f9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: many agents connecting at same time and 100+ nodes failed.

2014-11-06 Thread Christopher Wood
On Thu, Nov 06, 2014 at 09:28:32AM +0100, Felix Frank wrote:
 On 11/06/2014 09:25 AM, james.eckers...@fasthosts.com wrote:
  
  If that fails, you could try running the puppet agent from a cron job
  instead with randomised start times as per the below link.
 
 +1
 
 I have yet to see a disadvantage of cron vs. the background agent.

(Apparently I enjoy splitting tiny hairs in a thread branch. Possibly 
rhubarbing on, but here goes.)

Cultural...

In my experience, it is easier to tell people that any host where an agent is 
running is a puppetized host. I don't understand why it's more difficult to 
read /etc/motd or grep root's crontab but that's probably my view of things and 
not shared elsewhere. (This is more for the transition period as everything 
goes under puppet management.)

And then a manager might go and tell everybody that a host with an agent 
running is a puppetized host and it's hard to go and change puppet methods 
without requiring retraining. Your puzzlement at the difficulty level of 
changing from agent to cron likely matches mine.

Technological...

The fqdn_rand() function doesn't necessarily spread things as evenly as we 
might expect given randomness over large ranges. To illustrate, fictional 
example:

$ for x in `seq 1 1`; do echo notice(fqdn_rand(60, 
'host${x}.cwood.com')); done /tmp/xx.pp
$ puppet apply --color=false /tmp/xx.pp | grep Scope | awk '{print $3}' | sort 
| uniq -c | sort -rn /tmp/yy
$ head -5 /tmp/yy
199 1
195 51
188 52
184 55
184 48
$ tail -5 /tmp/yy 
151 9
150 46
145 5
144 2
141 19

Obviously using cron I might choose something different than 
run-on-a-random-minute, but I will still be a bit suspicious about this.

Also, cron isn't necessarily good at running things intermittently over less 
clock-friendly periods. If I'd like something to run every 47 minutes, just to 
pick, that's going to bit a bit harder to express with cron.



 -- 
 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/545B3130.90007%40alumni.tu-berlin.de.
 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/20141106172204.GA26122%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet invoking yum with a proxy inconsistently

2014-11-06 Thread merlin
Greetings

This is my first post here, so hi everyone!

I have been using puppet to manage our fleet of 120 Macs for a few years 
now and have recently decided to setup a new TheForeman installation to 
manage our Linux servers...

The problem I have is yum refusing to download updated packages on some of 
these machines.
Some of our machines need to use a proxy to access the Internet while 
others don't.
When I run 'puppet agent --test' (as root) on the command-line all of my 
clients work as expected.
Initially all servers are running CentOS 6.5 and have Puppet 3.7.2 (from 
the puppetlabs repo).
I was attempting to upgrade the clients to Puppet 3.7.3 when I realised I 
had this issue - (I have since updated some of them manually).

I will now only be talking about the machines that need a proxy..
I have http_proxy, https_proxy (and uppercase variants) configured in the 
.bash_profile for root and I am also able to use yum on the command-line of 
all these machines.

As I said, they are able apply new packages if I invoke the puppet command 
manually - but some of these servers will not get packages when run from 
the daemon. I get a classic, can't get on the network error:

Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install 
puppet-3.7.3-1.el6' returned 1: Error Downloading Packages: 
puppet-3.7.3-1.el6.noarch: failure: puppet-3.7.3-1.el6.noarch.rpm from 
puppetlabs: [Errno 256] No more mirrors to try. Wrapped exception: 
Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-3.7.3-1.el6' 
returned 1: Error Downloading Packages: puppet-3.7.3-1.el6.noarch: failure: 
puppet-3.7.3-1.el6.noarch.rpm from puppetlabs: [Errno 256] No more mirrors 
to try.

I have now added the proxy configuration to yum.conf on one of the machines 
affected and this has fixed the problem. But I am perplxed as to the fact 
that this is only affecting some of my proxied machines.
I have looked in /etc/profile.d and not found any proxy entries (I also did 
a 'grep -r proxyserver /etc/' to find anything configured with our 
server).

Can anyone think of anywhere else I should look to work out why it **does** 
work on some of my machines?

I imagine it is something very simple that I have overlooked!

Thanks all


Merlin

-- 
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/0a1e92b0-9b18-4173-b545-b8b73d08e070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet invoking yum with a proxy inconsistently

2014-11-06 Thread Walid
could it be the version of yum on these nodes? why not have the proxy
configuration ( user, password, and url) managed by puppet  too. i am
assuming you are using yumrepo resource.

On 6 November 2014 20:57, mer...@mrc-mbu.cam.ac.uk wrote:

 Greetings

 This is my first post here, so hi everyone!

 I have been using puppet to manage our fleet of 120 Macs for a few years
 now and have recently decided to setup a new TheForeman installation to
 manage our Linux servers...

 The problem I have is yum refusing to download updated packages on some of
 these machines.
 Some of our machines need to use a proxy to access the Internet while
 others don't.
 When I run 'puppet agent --test' (as root) on the command-line all of my
 clients work as expected.
 Initially all servers are running CentOS 6.5 and have Puppet 3.7.2 (from
 the puppetlabs repo).
 I was attempting to upgrade the clients to Puppet 3.7.3 when I realised I
 had this issue - (I have since updated some of them manually).

 I will now only be talking about the machines that need a proxy..
 I have http_proxy, https_proxy (and uppercase variants) configured in the
 .bash_profile for root and I am also able to use yum on the command-line
 of all these machines.

 As I said, they are able apply new packages if I invoke the puppet command
 manually - but some of these servers will not get packages when run from
 the daemon. I get a classic, can't get on the network error:

 Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install
 puppet-3.7.3-1.el6' returned 1: Error Downloading Packages:
 puppet-3.7.3-1.el6.noarch: failure: puppet-3.7.3-1.el6.noarch.rpm from
 puppetlabs: [Errno 256] No more mirrors to try. Wrapped exception:
 Execution of '/usr/bin/yum -d 0 -e 0 -y install puppet-3.7.3-1.el6'
 returned 1: Error Downloading Packages: puppet-3.7.3-1.el6.noarch: failure:
 puppet-3.7.3-1.el6.noarch.rpm from puppetlabs: [Errno 256] No more mirrors
 to try.

 I have now added the proxy configuration to yum.conf on one of the
 machines affected and this has fixed the problem. But I am perplxed as to
 the fact that this is only affecting some of my proxied machines.
 I have looked in /etc/profile.d and not found any proxy entries (I also
 did a 'grep -r proxyserver /etc/' to find anything configured with our
 server).

 Can anyone think of anywhere else I should look to work out why it **does**
 work on some of my machines?

 I imagine it is something very simple that I have overlooked!

 Thanks all


 Merlin

 --
 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/0a1e92b0-9b18-4173-b545-b8b73d08e070%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/0a1e92b0-9b18-4173-b545-b8b73d08e070%40googlegroups.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/CAN4dcto1MnLtaefN9xbcTPB%3D8FD_7L7Nf62z9QUh2AvxCTnHXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: facter-1.7.3 and puppet-3.3.1 on OS X Mavericks 10.9

2014-11-06 Thread keith . staley


On Wednesday, October 30, 2013 12:50:59 PM UTC-4, Paul Tötterman wrote:

 Hi,

 Is anyone else getting this:

 $ facter
 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
  
 `require': cannot load such file -- facter/application (LoadError) 
 from 
 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
  
 `require' 
 from /usr/bin/facter:72:in `main'

 $ puppet
 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
  
 `require': cannot load such file -- puppet/util/command_line (LoadError)
 from 
 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
  
 `require'
 from /usr/bin/puppet:3:in `main'

 Both installed from packages which were downloaded from 
 http://downloads.puppetlabs.com/mac/

 Cheers,
 Paul





Initially had this error, currently running factor 1.7.6 and puppet 3.6.2. 
fixed the ruby issue on the puppetmaster end (fedora 19) added 
foreman(1.6), been stable since Aug. OSX 10.9.5 currently no issues with 
puppet

hth
Keith

-- 
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/117ece79-d3e3-4e4c-ad26-91ad903af9f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] creating hashes from other hashes

2014-11-06 Thread Tim Mooney


All-

We're using puppet (opensource) 3.4.2 master and clients.  We've been
using puppet a few years, including create_resources, but this is my
first foray into creating complicated nested hashes.

I've boiled the problem I'm running into down to this example:

$ cat /tmp/foo.pp
class foo {
  foo::bar { 'somevalue':
stuff = {
  'one' = 'doesnt_matter',
  'two' = 'doesnt_matter',
}
  }
}

define foo::bar (
  $stuff = {},
) {

  #
  # not valid: fails with a parser validation error on the key $name:
  #
  # Error: Could not parse for environment production: Syntax error at
  # 'name';
  # expected '}' at /tmp/foo.pp:21
  #
  $new_hash = {
$name = $stuff,
  }

  #
  # this works, using a constant key
  #
  $new_hash = {
'a_constant' = $stuff,
  }
}


This comes from a larger, more complicated example, but what I'm trying to
do is

- take a hash ($stuff) that has all the parameters I need
- create a new hash with a single key that's the $name/$title for the define,
  and a value that contains the hash $stuff that I was passed.

As you might guess, this is to make $new_hash suitable for passing
to create_resources.

Is there some other way to create a new hash, give it a single top-level
key that is a variable, and assign a separate (passed-in as a parameter)
hash as the value for that key?  I would be fine with using stdlib::merge,
but I don't see any obvious way to accomplish this task with stdlib::merge
either.

Thanks,

Tim
--
Tim Mooney tim.moo...@ndsu.edu
Enterprise Computing  Infrastructure  701-231-1076 (Voice)
Room 242-J6, Quentin Burdick Building  701-231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

--
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/alpine.SOC.2.11.1411061531150.12196%40dogbert.cc.ndsu.NoDak.edu.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppet 3.6.2, parse time error about storeconfigs

2014-11-06 Thread Tristan Smith
Thanks, I failed to find it in Jira. Glad to know it's something already in
the roadmap.

On Wed, Nov 5, 2014 at 5:10 PM, Henrik Lindberg 
henrik.lindb...@cloudsmith.com wrote:

 On 2014-06-11 1:30, Tristan Smith wrote:

 So, I'm trying to be a good citizen and use more forge code. I run
 puppet parser validate across all manifests as part of this - which
 results in much hilarity and tears.

 The latest one was when I pulled in puppetlabs/apache.

 .../modules/apache/manifests$ puppet parser validate balancer.pp
 --parser=future
 Warning: You cannot collect exported resources without storeconfigs
 being set; the collection will be ignored at
 .../modules/apache/manifests/balancer.pp:65:5
 .../modules/apache/manifests$ puppet parser validate balancer.pp
 --parser=future --storeconfigs=true
 Error: Could not parse application options: needless argument:
 --storeconfigs=true

 In general, warnings have been about things that I should care about,
 and I enforce them, but this one's just plain improper.

  The warning is issues because the code contains collection of exported
 resources. It is a known issue that this should not be a parse time warning
 since the environment where parsing/validation takes place does not have to
 have storeconfigs set at all (the result is the same anyway, the difference
 is when running that code).

 The future parser has the same warning to be compatible.

 We will fix this during the 4x series if it does not make it in time for
 Puppet 4.0

 If you really want to not see the error, you have to configure
 storeconfigs: http://projects.puppetlabs.com/projects/1/wiki/using_
 stored_configuration - which as you can see in that information is
 deprecated if you want to use Rails and ActiveRecord, in favor of PuppetDB.
 This means you have to have a PuppetDb set up when you are validating...
 (and the lines of yaks requiring a haircut keeps piling up).


  Am I off base, or should this be a bug report against puppet's parser?
 (btw: future or not future, same result.)


 No need, it is a known issue (if you are referring to the pointless
 warning about storeconfigs when there is a collection of exported resources
 in the code).

 Regards
 - henrik

 --

 Visit my Blog Puppet on the Edge
 http://puppet-on-the-edge.blogspot.se/

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Puppet Users group.
 To unsubscribe from this topic, visit https://groups.google.com/d/
 topic/puppet-users/EKlG7O_S6PE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/puppet-users/m3ehqq%24hev%241%40ger.gmane.org.

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


[Puppet Users] Puppet 3 scoping question

2014-11-06 Thread whm
In puppet 2.7 we use the following construct.

define some::fun(
  ensure = present,
  sname = 'some.server.com'
) {
  include some::fun_setup
  # Template uses sname
  file {/path/$name:
content = template(${name}.erb),
  }
}

class some::fun_setup {
  file{/etc/ssl/certs/${sname}:
source = puppet:///modules/some-files/${sname}.ca.pem
  }
}

The reference to sname in some::fun_setup does not work in puppet 3.  Not 
surprising given the scoping changes.  The problem is I am not sure how to 
reference sname defined in the resource from the class some::fun_setup.  In 
reading the documentation I think something like $some::fun::sname should 
work, but it doesn't.  What is the correct way to reference sname from 
some::fun_setup?

The goal is to be able to have manifests that use some::fun as follows:

  some::fun{'fragment1': ensure = present}
  some::fun{'fragment2': ensure = present}
  ...

The fragments are unique, but the ca cert only needs to be installed once.

Thanks in advance,

Bill

-- 
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/affc1a19-64fa-4393-8b17-2b5773eec1ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3 scoping question

2014-11-06 Thread Walid
it would be some::fun_setup::sname or more specifically
:: some::fun_setup::sname or $:: some::fun_setup::sname

On 7 November 2014 05:30, w...@stanford.edu wrote:

 In puppet 2.7 we use the following construct.

 define some::fun(
   ensure = present,
   sname = 'some.server.com'
 ) {
   include some::fun_setup
   # Template uses sname
   file {/path/$name:
 content = template(${name}.erb),
   }
 }

 class some::fun_setup {
   file{/etc/ssl/certs/${sname}:
 source = puppet:///modules/some-files/${sname}.ca.pem
   }
 }

 The reference to sname in some::fun_setup does not work in puppet 3.  Not
 surprising given the scoping changes.  The problem is I am not sure how to
 reference sname defined in the resource from the class some::fun_setup.  In
 reading the documentation I think something like $some::fun::sname should
 work, but it doesn't.  What is the correct way to reference sname from
 some::fun_setup?

 The goal is to be able to have manifests that use some::fun as follows:

   some::fun{'fragment1': ensure = present}
   some::fun{'fragment2': ensure = present}
   ...

 The fragments are unique, but the ca cert only needs to be installed once.

 Thanks in advance,

 Bill

 --
 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/affc1a19-64fa-4393-8b17-2b5773eec1ab%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/affc1a19-64fa-4393-8b17-2b5773eec1ab%40googlegroups.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/CAN4dctoehFMp4njoQ7kEDL5KBLfvAXho9_LxDMeHCLqJdLwsVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3 scoping question

2014-11-06 Thread whm
But that doesn't make sense to me and in my test didn't work.  What your 
syntax does is to reference the variable sname in the class from the class. 
 That is, the class would become:

class some::fun_setup {
  file{/etc/ssl/certs/${::some::fun_setup::sname}:
source = puppet:///modules/some-files/
${::some::fun_setup::sname}.ca.pem
  }
}

But, what I am attempting to do is to pull the value of the sname parameter 
from the resource type some::fun.

Bill

On Thursday, November 6, 2014 10:38:00 PM UTC-8, Walid Shaari wrote:

 it would be some::fun_setup::sname or more specifically 
 :: some::fun_setup::sname or $:: some::fun_setup::sname

 On 7 November 2014 05:30, w...@stanford.edu javascript: wrote:

 In puppet 2.7 we use the following construct.

 define some::fun(
   ensure = present,
   sname = 'some.server.com'
 ) {
   include some::fun_setup
   # Template uses sname
   file {/path/$name:
 content = template(${name}.erb),
   }
 }

 class some::fun_setup {
   file{/etc/ssl/certs/${sname}:
 source = puppet:///modules/some-files/${sname}.ca.pem
   }
 }

 The reference to sname in some::fun_setup does not work in puppet 3.  Not 
 surprising given the scoping changes.  The problem is I am not sure how to 
 reference sname defined in the resource from the class some::fun_setup.  In 
 reading the documentation I think something like $some::fun::sname should 
 work, but it doesn't.  What is the correct way to reference sname from 
 some::fun_setup?

 The goal is to be able to have manifests that use some::fun as follows:

   some::fun{'fragment1': ensure = present}
   some::fun{'fragment2': ensure = present}
   ...

 The fragments are unique, but the ca cert only needs to be installed once.

 Thanks in advance,

 Bill

 -- 
 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 javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/affc1a19-64fa-4393-8b17-2b5773eec1ab%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/affc1a19-64fa-4393-8b17-2b5773eec1ab%40googlegroups.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/6c7c36b5-f7ab-422c-b2eb-dac5acc36413%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.