[Puppet Users] using heredoc in an erb template with hiera

2015-02-18 Thread Mark Rosedale
Hello,

I'm using hiera with puppet 3.7. What I need to do is pass in a formatted 
string to puppet to be used inside an erb template. What I'd really like is 
to use heredoc, but it doesn't seem like that is going to work. Does anyone 
have information on this and whether it is possible or not? 

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/b3462d5f-b0a9-4c02-9266-6f64beef3458%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet augeas is appying twice everytime

2015-02-18 Thread estev
Hi 

I have a problem , I've tried everything but I can't resolve it yet, every 
time that I run puppet agent it is applying my augeas resources twice

basically I have this array in hiera:

augeas_views:
 - 'defnode user 
hudson/views/au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView[id/#text=VIEWNAMEREPLACE]
 
'
 - 'set $user/#attribute/plugin  build-pipeline-plugin@1.4.5'
 - 'set $user/owner/#attribute/class hudson'
 - 'set $user/owner/#attribute/reference ../../..'
 - 'set $user/name/#text  VIEWNAMEREPLACE'
 - 'set $user/filterExecutors/#text false'
 - 'set $user/filterQueue/#text false'
.

this is my puppet code:

augeas { Pipeline view for $project:
  lens= 'Xml.lns',
  incl= '/home/ubuntu/config.xml',
  changes = $array,
}

and when I run puppet:

: Opening augeas with root /, lens path , flags 64
: Augeas[Pipeline view for testss](provider=augeas): Augeas version 1.1.0 
is installed
: Augeas[Pipeline view for testss](provider=augeas): Will attempt to save 
and only run if files changed
: Augeas[Pipeline view for testss](provider=augeas): sending command 
'defnode' with params [user, 
/files/home/ubuntu/config.xml/hudson/views/au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView[id/#text=\TESTT
 
Pipeline\], ]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/#attribute/plugin, build-pipeline-plugin@1.4.5]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/owner/#attribute/class, hudson]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/owner/#attribute/reference, ../../..]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/name/#text, TESTT Pipeline]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/filterExecutors/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/filterQueue/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/gridBuilder/#attribute/class, 
au.com.centrumsystems.hudson.plugin.buildpipeline.DownstreamProjectGridBuilder]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/gridBuilder/firstJob/#text, testss-build]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/noOfDisplayedBuilds/#text, 100]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/buildViewTitle/#text,  ]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/consoleOutputLinkStyle/#text, Lightbox]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/cssUrl/#text,  ]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/triggerOnlyLatestJob/#text, true]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/alwaysAllowManualTrigger/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/showPipelineParameters/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/showPipelineParametersInHeaders/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/startsWithParameters/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/refreshFrequency/#text, 3]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/showPipelineDefinitionHeader/#text, false]
: Augeas[Pipeline view for testss](provider=augeas): Files changed, should 
execute

..
: Opening augeas with root /, lens path , flags 64
: Augeas[Pipeline view for testss](provider=augeas): Augeas version 1.1.0 
is installed
: Augeas[Pipeline view for testss](provider=augeas): Will attempt to save 
and only run if files changed
: Augeas[Pipeline view for testss](provider=augeas): sending command 
'defnode' with params [user, 
/files/home/ubuntu/config.xml/hudson/views/au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView[id/#text=\TESTT
 
Pipeline\], ]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/#attribute/plugin, build-pipeline-plugin@1.4.5]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/owner/#attribute/class, hudson]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/owner/#attribute/reference, ../../..]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with params [$user/name/#text, TESTT Pipeline]
: Augeas[Pipeline view for testss](provider=augeas): sending command 'set' 
with 

Re: [Puppet Users] using heredoc in an erb template with hiera

2015-02-18 Thread Christopher Wood
I tend to go for the lazy way, create my complicated string in something like a 
perl data structure where the language understand here docs and then dump it 
out to yaml. That way I have a set of yaml that I can copy into my hiera data.

It ends up hideous but usable (note line breaks):

--- 
key: this is the value of a key
long: really really long really really long really really long really really 
long really really long really really long really really long \n\nreally really 
long really really long really really long really really long really really 
long really really long really really long really really long \n\n\nreally 
really long really really long really really long 

Otherwise I might encrypt it via hiera-eyaml, using the encryption as a 
fake-base64. 

Or maybe store it like you would binary data in yaml, aka base64 itself? Not 
tried this one myself.

http://yaml.org/type/binary.html

On Wed, Feb 18, 2015 at 10:08:37AM -0800, Mark Rosedale wrote:
Hello,
I'm using hiera with puppet 3.7. What I need to do is pass in a formatted
string to puppet to be used inside an erb template. What I'd really like
is to use heredoc, but it doesn't seem like that is going to work. Does
anyone have information on this and whether it is possible or not? 
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/b3462d5f-b0a9-4c02-9266-6f64beef3458%40googlegroups.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/b3462d5f-b0a9-4c02-9266-6f64beef3458%40googlegroups.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/20150218192650.GA18520%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Weird puppetmaster issue.

2015-02-18 Thread Peter Berghold
I've been banging my head against the wall with this one.  Probably a
simple fix but I'm not seeing it at the moment.

I have a proof of concept setup in our lab where I have a central
Foreman/Puppet server.  The Puppet server on the Foreman box has the
responsibility of keeping things straight on subordinate remote servers
that in production will be located in the same data center as the client
base they will server.

To get the POC remote server set up I manually load the Puppet client
software on the host (later it will come pre-loaded on a VM template) and I
run the Puppet client manually.  That first run is all about the certs and
getting the Foreman ENC aware of the host.  Adding a couple of config
groups the the host and next we run puppet agent -t-test --server=foreman
host fqdn and all the configuration files get loaded and then things go
sideways.

The Puppet Master daemon will not run on the host.  What I'm seeing in
/var/log/messages is as follows:

Feb 18 19:48:20 hostname puppet-master[32593]: Could not prepare for
execution: The certificate retrieved from the master does not match the
agent's private key.
Feb 18 19:48:20 hostnamepuppet-master[32593]: Certificate
fingerprint: 
BC:0C:19:83:62:F8:A6:AD:ED:85:B7:19:B6:AD:75:FE:36:62:D7:43:C9:5B:76:64:E8:A1:F5:C1:FE:1F:39:21
Feb 18 19:48:20 hostnamepuppet-master[32593]: To fix this, remove the
certificate from both the master and the agent and then start a puppet run,
which will automatically regenerate a certficate.
Feb 18 19:48:20 hostname puppet-master[32593]: On the master:
Feb 18 19:48:20 hostname puppet-master[32593]:   puppet cert clean agent
host FQDN
Feb 18 19:48:20 hostname puppet-master[32593]: On the agent:
Feb 18 19:48:20 hostname puppet-master[32593]:   1a. On most platforms:
find /var/lib/puppet/ssl -name agent host FQDN -delete
Feb 18 19:48:20 hostnamepuppet-master[32593]:   1b. On Windows:
del /var/lib/puppet/ssl/agent host FQDN.pem /f
Feb 18 19:48:20 hostname puppet-master[32593]:   2. puppet agent -t

Here is my puppet.conf (sanitized) from my clent system

[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet

# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet

# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl

# Allow services in the 'puppet' group to access key (Foreman + proxy)
privatekeydir = $ssldir/private_keys { group = service }
hostprivkey = $privatekeydir/$certname.pem { mode = 640 }

# Puppet 3.0.x requires this in both [main] and [master] - harmless on
agents
autosign   = $confdir/autosign.conf { mode = 664 }

show_diff = false

hiera_config = $confdir/hiera.yaml

### Next part of the file is managed by a different template ###
## Module:   'puppet'

[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuration.  Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$statedir/classes.txt'.
classfile = $vardir/classes.txt

# Where puppetd caches the local configuration.  An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig

# Disable the default schedules as they cause continual skipped
# resources to be displayed in Foreman - only for Puppet = 3.4
default_schedules = false

report= true
pluginsync= true
masterport= 8140
environment   = production
certname  = agent host fqdn
server= puppet host fqdn
listen= false
splay = false
splaylimit= 1800
runinterval   = 1800
noop  = false
configtimeout = 600

[master]
storeconfigs = true
storeconfigs_backend = puppetdb
autosign   = $confdir/autosign.conf { mode = 664 }
reports= foreman
external_nodes = /etc/puppet/node.rb
node_terminus  = exec
ca = true
ssldir = /var/lib/puppet/ssl
certname   = agent host FQDN
strict_variables = false

environmentpath  = /etc/puppet/environments
basemodulepath   =
/etc/puppet/environments/common:/etc/puppet/modules:/usr/share/puppet/modules


Just to be clear:  puppet host FQDN is the central Foreman/Puppet
Master's FQDN not the agent FQDN that where a remote Puppet master is
trying to start.

Thoughts?  Am I going about this wrong?

-- 

Peter L. Berghold   salty.cowd...@gmail.com

h http://blog.berghold.netttp://science-fiction.berghold.net

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

Re: [Puppet Users] Design help: django deployment

2015-02-18 Thread Pete Brown
Hi Jonathan,

The puppetboard module uses stankevich/python to get it's underlying python
bits setup so it might give you some ideas.
https://forge.puppetlabs.com/nibalizer/puppetboard

I haven't deployed python apps much myself but the ideas you had would be
where I would start.

If you can't find anything decent I would see that as an opportunity to add
your resulting module to puppet forge. :)
 On 10 Feb 2015 20:13, Jonathan Gazeley jonathan.gaze...@bristol.ac.uk
wrote:

  Hi folks,

 The developers at my place are designing a new set of webapps, which will
 be written in Python/Django. This is new to us (our old stuff is nasty
 Perl) and I've been asked to look at how to deploy these new apps using
 Puppet.

 The Django apps will be developed in Git repos and releases will be tagged
 so I am envisaging using puppetlabs/vcsrepo to deploy releases of the apps
 to the web server's filesystem. The developers want to use virtualenv to
 handle dependencies in their apps. Is there are a recommended method among
 other Puppet admins to deploy Django apps from git with virtualenv and have
 them served preferably with Apache or Nginx?

 I can't find a monolithic module to do this on the Forge so if nobody has
 a wiser suggestion, I will probably write something using
 puppetlabs/vcsrepo, stankevich/python and puppetlabs/apache.

 Thanks,
 Jonathan

 --
 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/54D9D9B0.2080804%40bristol.ac.uk
 https://groups.google.com/d/msgid/puppet-users/54D9D9B0.2080804%40bristol.ac.uk?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/CAM8R_x_nwhBvNPF742uKiqSYt9txhvxoTQ324XWwvfZmRLo0tQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Continuous Availability

2015-02-18 Thread Rajesh Kunwar
I am trying to setup CA environment or puppet. How do i approach for the 
solution and what are the options available?

Thank you in advance.

-- 
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/b4218d30-717a-429e-8b8a-4967b7e46ef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] run code in a new puppet agent window (windows server)

2015-02-18 Thread Helen Paterson
Hi,

I set windows environment variables using puppet, but you must close the 
puppet agent window and open a new one to be able to use these variables. 

Can i do this programaticaly ?

(i need git use git via puppet but you must set windows env git paths first 
)

-- 
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/4e95895d-2eb2-4a9e-bda2-b931d4f7c868%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Environment with multiple subdirectories

2015-02-18 Thread Henrik Lindberg

On 2015-17-02 17:56, hans...@nd.edu wrote:

I'm attempting to switch over from using configuration directories to
using environments.  Right now, we have various directories with puppet
classes and the puppet server might look in all directories for the
class it needs.  So, we have a modulepath which lists the places to look:

modulepath =
$confdir/modules:$confdir/modules/subdir1:$confdir/modules/subdir2:/global/commondir

I would like to migrate over to environments but would like to keep some
of the structure.  So, for instance, if I had a production environment,
I'd like to have that environment still have a set of subdirectories to
look in for classes.  I don't want to have to put all of my classes in
one big environment directory.

I've tried a number of ways to do this but in every case the clients no
longer can find the classes.  I've only been able to get environments
working if all classes end up directly in the
environment/production/modules directory.

How can I set things up to break up a single environment into multiple
directories?

The documentation is here; 
https://docs.puppetlabs.com/puppet/latest/reference/dirs_modulepath.html


Does that help?

- henrik


Thanks,
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
mailto:puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/4b18ebc9-0474-405d-8e95-0e183a8924f1%40googlegroups.com
https://groups.google.com/d/msgid/puppet-users/4b18ebc9-0474-405d-8e95-0e183a8924f1%40googlegroups..com?utm_medium=emailutm_source=footer.
For more options, visit https://groups.google.com/d/optout.



--

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

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


Re: [Puppet Users] puppet agent is not reflecting my changes

2015-02-18 Thread Dirk Heinrichs
Am 18.02.2015 um 14:19 schrieb Raj Raju:
 I created the manifest file /etc/puppetlabs/puppet/manifests/sites.pp
 with the following content on puppet server.||
 |[...]|
 ||Puppet node does not pick any changes from master.

Because it needs to be named site.pp, not sites.pp.

HTH...

Dirk
-- 

*Dirk Heinrichs*, Senior Systems Engineer, Engineering Solutions
*Recommind GmbH*, Von-Liebig-Straße 1, 53359 Rheinbach
*Tel*: +49 2226 159 (Ansage) 1149
*Email*: d...@recommind.com mailto:d...@recommind.com
*Skype*: dirk.heinrichs.recommind
www.recommind.com http://www.recommind.com

-- 
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/54E49501.3090802%40recommind.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppet agent is not reflecting my changes

2015-02-18 Thread Raj Raju
I have installed puppet enterprise 3.7.2 on centos 7.Both Puppet master and 
agent is working .I can able to view the node from puppet enterprise 
console and attached screen shot.

https://lh6.googleusercontent.com/-MQdSTQQFadQ/VOSRJYoQZ-I/AIw/HlQsa5C_sY4/s1600/puppet-node.PNG


I created the manifest file /etc/puppetlabs/puppet/manifests/sites.pp with 
the following content on puppet server.

node 'puppet.client.net' {
  file { '/tmp/hello':
content = Hello, world\n,
  }
}

After I executed the following command on master:

 #puppet agent apply  sites.pp

And then Executed the following command on client node :

#puppet agent -t
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppet.client.net
Info: Applying configuration version '1424179235'
Notice: Finished catalog run in 2.12 seconds

Puppet node does not pick any changes from master.

-- 
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/70df6301-a96a-4f6c-86af-4e5a8f1b2fb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Two questions about custom facts

2015-02-18 Thread jcbollinger


On Tuesday, February 17, 2015 at 1:13:13 PM UTC-6, Salty Old Cowdawg wrote:



 On Tue, Feb 17, 2015 at 11:31 AM, Raphink rap...@gmail.com javascript: 
 wrote:


 Facts are computed before each Puppet run. If Puppet installs a package 
 and your fact returns the version of that package, then the fact value will 
 be available after the second Puppet run.



 OK that's what I suspected.  So there is now way to get the facts to run 
 again during the Puppet run I would take it. darn! 



The fact values relevant to any given catalog run describe the state of the 
target machine immediately prior to its corresponding catalog request.  
This reflects the Puppet operational cycle:

   1. The agent syncs plugins with the master.
   2. The agent collects fact values (including for any custom facts it 
   just synced).
   3. The agent submits a catalog request to the master, including all its 
   computed fact values
   4. The master builds a catalog for the requester, based on its identity 
   and facts.  All fact references in manifests and Hiera data are resolved to 
   their corresponding values as part of this process.
   5. The master provides the complete catalog to the agent.  There are no 
   fact references in the catalog, though there may be data derived from fact 
   values.
   6. The agent applies the catalog, which may involve additional 
   communication with the master to retrieve the content of 'source'd files.

Always keep in mind how coarse-grained this interaction is.  Generally 
speaking, your modules need to be able to compute the desired target state 
from a machine's *initial* state, not from some intermediate state 
occurring transiently during catalog application.  Moreover, no Puppet 
variable, including fact variables, can take a different value once its 
value is first set.  These characteristics may be constraining in some 
ways, but it they are essential for consistent catalogs.


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/e470dacd-7bb2-4f68-a628-fedc4d30ab92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.