[Puppet Users] Re: is there anyway to merge two facts into single one

2014-11-21 Thread jcbollinger


On Thursday, November 20, 2014 12:21:09 PM UTC-6, Spriya wrote:

 Hi ,

 Is there any way to merge two facts into single facts.

 Here is my facts
 java_known_weblogic_version11.7.0_72java_known_weblogic_version1_path
 /u01/java/jdk1.7.0_72/jre/bin/java

 I want to merge these two facts into single one 

 I mean 

 java_known_weblogic_version1 = 1.7.0_72//u01/java/jdk1.7.0_72/jre/bin/java

 Like this

 Anyone please help me



In what context, for what purpose?

Generally speaking, I'd say you should just concatenate the two fact values 
in the scope where the aggregate value is wanted, as opposed to modifying 
fact implementations to change what facter reports.  Is that unsuitable for 
some reason?


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/e9b8dcd1-901b-4819-9fef-1d1be3541a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet variable with a custom fact

2014-11-21 Thread jcbollinger


On Thursday, November 20, 2014 11:22:29 AM UTC-6, Wil Cooley wrote:


 (Aside: Does anyone have a link to a diagram of the dance the master and 
 agent do? I've been meaning to try to make one on websequencediagrams.com 
 but not gotten around to it.)


There is a diagram and accompanying descriptive text that looks pretty 
comprehensive here: 
https://docs.puppetlabs.com/puppet/3/reference/subsystem_agent_master_comm.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/1a49fab2-29b3-4cbe-a6ee-241e1408da88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: is there anyway to merge two facts into single one

2014-11-21 Thread Spriya

Hi,

The purpose  is i want to compare using the value to a txt file which 
contains 1.7.0_72//u01/java/jdk1.7.0_72/jre/bin/java this reason for that i 
want to concatenate.

Let me know your thoughts
On Friday, November 21, 2014 8:58:53 AM UTC-5, jcbollinger wrote:



 On Thursday, November 20, 2014 12:21:09 PM UTC-6, Spriya wrote:

 Hi ,

 Is there any way to merge two facts into single facts.

 Here is my facts
 java_known_weblogic_version11.7.0_72java_known_weblogic_version1_path
 /u01/java/jdk1.7.0_72/jre/bin/java

 I want to merge these two facts into single one 

 I mean 

 java_known_weblogic_version1 = 1.7.0_72/
 /u01/java/jdk1.7.0_72/jre/bin/java

 Like this

 Anyone please help me



 In what context, for what purpose?

 Generally speaking, I'd say you should just concatenate the two fact 
 values in the scope where the aggregate value is wanted, as opposed to 
 modifying fact implementations to change what facter reports.  Is that 
 unsuitable for some reason?


 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/bacbed8a-9019-4682-98a0-bd0572287d7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Q: Maintaining installation profiles and privisioning using puppet

2014-11-21 Thread Tomasz Kloczko
Hi,

I just stated looking closer on the puppet so please forgive me if my 
questions or dilemmas would be a little not accurate in context of puppet.

I'm trying to solve couple of problems with install infrastructure for more 
than one OS. Let's say that initially would be rpm based Linux and Solaris.
Generally installation infrastructure across many hosts shares some set of 
stages like a choosing set of software which needs to be installed, 
authentication setup, choosing devices(s) used on install etc.
In case Linux to perform such set of operation you must have kickstart 
profile which will do all what is needed. In case Solaris you must have 
personalized AI profile and manifest.
Updating install profiles it is modifying set of KS profiles and for 
example files with PXE bootloader configuration files in pxelinux.cfg/ 
directory served by TFTP server. In case AI installer profiles and 
manifests must be updated and imported to AI database.
Additionally on higher level it would be good to keep track some additional 
settings like guarantee that none of two hosts will be sharing the same 
addresses, updating DNS records, updating firewall settings or switches 
ACLs.

In this case I'm not talking about automate simple installation but whole 
multistage provisioning process which should be not started if some 
dependence will be not fulfilled and/or even committing some new change in 
setup should be refused if some inconsistencies will be not fulfilled.

I know that I can solve such set of problems using quattor and pan 
language. Problem is that IMO quattor community has IMO real problems with 
lack of understanding present days large scale installations in 
heterogeneous envs which makes choosing this software in long term a bit 
risky.
Puppet seems has much healthier community and such risk is IMO way lower.

Questions only is am I will be able to solve all my above problems with 
install infrastructure using puppet using set of templates, with per host 
parameters, dependency rules and checking automatically on updating host(s) 
install settings automatically to start whole cascade of updates in 
provisioning process set of additional actions to update DNS, other files 
on some hosts easier than using quattor?
If such answer would be positive can I ask someone to point on  some needed 
here documentation(s) to dig by myself for necessary details? :) 

I'll be really appreciated any comments or advice If anyone is using puppet 
or other software solving something similar :)

Regards

Tomasz

-- 
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/3f749ea3-5e85-4f7b-88d0-61fe00af9041%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet Agent fails; Could not retrieve local facts - but Manually runs successfully

2014-11-21 Thread hendri
This is on Amazon Linux on EC2 - Puppet Agent and master are at 2.7.25

Manual runs of facter and puppet `puppet agent -t` complete successfully 
and produce no errors. how were if puppet runs either as service daemon or 
cron I get the above error in the log.

Here is the error

/var/log/messages
Nov 17 21:47:36 servername puppet-agent[123]: Starting Puppet client 
version 2.7.25
Nov 17 21:47:36 servername puppet-agent[123]: Could not run Puppet 
configuration client: *Could not retrieve local facts: private method 
`scan' called for nil:NilClass*








This is the custom fact which is producing the error
Any reason why this code would run successfully manually but fail a daemon?



cat /usr/lib/ruby/site_ruby/1.8/facter/ec2tags.rb

require 'facter'


if Facter.value(ec2_instance_id) != nil
  instance_id = Facter.value(ec2_instance_id)
  region = Facter.value(ec2_placement_availability_zone)[0..-2]
  tags = Facter::Util::Resolution.exec(ec2dtag -O key -W secret_key 
--filter \resource-id=#{instance_id}\ --region #{region} | cut -f 4-|awk 
'BEGIN{FS=\ \;OFS=\|\} {$1=$1; print $0}')
  tags.scan(/(.*)\|+(.*)/) do |key, value|
   fact = ec2_tag_#{key}
   Facter.add(fact) { setcode { value } }
  end
end



-- 
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/fb903886-e6ed-4d32-a1a2-7aed6e465fdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Unable to install Puppet Master

2014-11-21 Thread KB_puppet
I've been trying to install Puppet on my Centos 6.5 system since yesterday 
but to no avail. At first I installed the puppetmaster-passenger but got a 
lot of errors during installation. I ended up purging it and today tried a 
fresh install of just the puppetmaster. There were no errors but I cannot 
see the puppet.conf or the site.pp file. They are not created during 
installation. 

ubuntu:/etc$ ll puppet
total 16
drwxr-xr-x   4 root   root   4096 Nov 20 14:49 ./
drwxr-xr-x 106 root   root   4096 Nov 20 14:49 ../
drwxr-xr-x   2 root   root   4096 Nov 20 14:49 manifests/
drwxrwx--x   8 puppet puppet 4096 Nov 20 14:49 ssl/

When I try to start the service, the error I get is

ubuntu:/$ sudo puppet master --verbose --no-daemonize
Notice: Starting Puppet master version 3.7.3
Error: Could not run: Could not create PID file: 
/var/lib/puppet/run/master.pid

Where am I going wrong? I followed the steps 
in https://docs.puppetlabs.com/guides/install_puppet/install_debian_ubuntu.html
Please help 

-- 
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/e1c89141-8e96-4e17-800d-d5155c5512dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: syncronizing many files ( more than 100,000 ) with puppet agent -t is slow

2014-11-21 Thread waz0wski
+1 on using a VCS system like GIT. Puppet is not the tool for doing this 
kind of operation.


The vcsrepo puppet module can be used to checkout / update a repo of 
files, and as jcbollinger said, that will scale well with changed files 
individually versus re-deploy or rsync of all files.


https://forge.puppetlabs.com/puppetlabs/vcsrepo


On 2014-11-18 06:55, jcbollinger wrote:

On Monday, November 17, 2014 12:32:44 PM UTC-6, Seokhee Kim wrote:


Hi,
We have some special case to use Puppet which need to sync many and
many files but just few files are updated ( delete, created or
updated ).
Is there any way to sync just for changed files? now I am syncing
whole dir with purge option.
And I realized it's getting slower and slower based on number of
files.
So it looks like syncing changed list would be good idea.


The cost of such an operation must scale with the number of files,
unless you know in advance of each run, through some out-of-band
mechanism, what updates need to be performed. If you don't know that
then you have no alternative but to touch or at least examine every
one, either to determine whether it needs to be updated or to blindly
overwrite it. You can make that *cheaper* by various means, such as
changing the Files' 'checksum' parameter or managing the files via
rsync instead, but such options still scale the same way.

There is in fact a way to scale with the number of changes instead of
with the number of files, however: manage the files via a
version-control system (git, svn, mercurial, etc.) instead of directly
via Puppet. This has overhead in the form of disk space, of course,
and Puppet will not be able to report as precisely on changes
performed. Also you will not be able to have Puppet relationships with
individual files from the collection, because they are not represented
to Puppet as individual resources.

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/36570a8e81889db502bb94016c06eab1%40mass-distortion.net.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] configure puppet master and puppet agent

2014-11-21 Thread fauzi . profitera
Hi, im very new using linux and I need to make connection between puppet 
master and puppet agent. I already success to make httpd port 8140 listen 
after that I continues to make a connection between puppet master and agent 
but failed. I cant send request from agent to master. Can someone here help 
me? Im using CentOS 5. I already attach the documentation that I followed. 
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/6a5fd72a-9207-4644-acba-351116ebeb6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to install puppet in CentOS.docx
Description: MS-Word 2007 document


[Puppet Users] puppetdoc readme markdown ignored

2014-11-21 Thread ubuntu811
Hi

I'm pretty new to puppet and trying to create the documentation for a newly 
created puppet module.

How do I tell Puppet that the README File in the Project is in markdown 
language? Right now any markdown syntax as documented in
https://docs.puppetlabs.com/puppet/latest/reference/modules_documentation.html 
seems to get ignored. (As well if I name the thing README.md). 

I'm running Puppet 3.5.1. 

Regards,
Mirjam

-- 
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/02c756e8-2972-4b9a-b587-19e6caf3be8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdoc readme markdown ignored

2014-11-21 Thread Spencer Krum
For what it's worth, the community is trying to migrate to the puppet
strings tool at this point.

https://github.com/puppetlabs/puppetlabs-strings


On Fri, Nov 21, 2014 at 2:52 PM, ubuntu811 ubuntu...@gmail.com wrote:

 Hi

 I'm pretty new to puppet and trying to create the documentation for a
 newly created puppet module.

 How do I tell Puppet that the README File in the Project is in markdown
 language? Right now any markdown syntax as documented in
 https://docs.puppetlabs.com/puppet/latest/reference/modules_documentation.html
 seems to get ignored. (As well if I name the thing README.md).

 I'm running Puppet 3.5.1.

 Regards,
 Mirjam

  --
 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/02c756e8-2972-4b9a-b587-19e6caf3be8d%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/02c756e8-2972-4b9a-b587-19e6caf3be8d%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
Spencer Krum
(619)-980-7820

-- 
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/CADt6FWNojo-QPMub_AEWD4J7JpE52_Nj2zpw8QX1530NrS%2BNuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB errors

2014-11-21 Thread Wyatt Alt

Paul,

Thanks for that. It looks like 22128 has not been cleaned up properly 
for some reason, and it's likely being skipped over in the gc process 
because the facts cleanup identifies values to delete from that column 
in the facts table.


Are there failed commands in your /var/lib/puppetdb/mq/discarded 
directory you can tie this to? I'd like to take a look at that if you 
can send me a tarball.


This issue would likely disappear if you dropped and recreated the 
puppetdb database and allowed the nodes to repopulate it, but that could 
take some maneuvering depending on your situation/data needs.


Wyatt

On 11/20/14 12:29 AM, Paul Seymour wrote:



On Wednesday, 19 November 2014 17:56:23 UTC, Wyatt Alt wrote:

Hey Paul,

That's some kind of DB corruption. Shouldn't be happening. Do you
have
any sense of when this started or whether it was tied to a recent
upgrade? Is there a stacktrace in your logs that you could gist?
Does it
happen on every agent run or only occasionally? Is it always the same
path_id like in the other ticket?

Also would you mind reporting the output of this?

select * from facts where fact_value_id in (50319,22128);


Thanks Wyatt,

I cannot be sure if this is tied to an upgrade specifically but I just 
happened to be keeping an eye
on the logs a little more lately (working on an ELK thing to 
monitoring them).


A stack trace is available at 
https://gist.github.com/PsychoSid/b1a479d7d6fec7477263


The output from the select is:-
$ psql
psql (9.3.5)
Type help for help.

postgres=# \c puppetdb
You are now connected to database puppetdb as user postgres.
puppetdb=# select * from facts where fact_value_id in (50319,22128);
 factset_id | fact_value_id
+---
 22 | 50319
(1 row)

Hope this helps.

Cheers
Paul
--
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/7baf1653-d0b4-4fcf-8bcb-039b43af99a5%40googlegroups.com 
https://groups.google.com/d/msgid/puppet-users/7baf1653-d0b4-4fcf-8bcb-039b43af99a5%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/546F6EF0.6060402%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] PuppetDB errors

2014-11-21 Thread Wyatt Alt
Manually deleting that row (id=22128) in fact_values might also do the
trick if it's only one affected node/value, but wouldn't tell much about
how you got to this state so could be leaving something broken.  It would
be interesting to get the discarded tarball in any case.

On Fri, Nov 21, 2014 at 8:57 AM, Wyatt Alt wy...@puppetlabs.com wrote:

  Paul,

 Thanks for that. It looks like 22128 has not been cleaned up properly for
 some reason, and it's likely being skipped over in the gc process because
 the facts cleanup identifies values to delete from that column in the facts
 table.

 Are there failed commands in your /var/lib/puppetdb/mq/discarded directory
 you can tie this to? I'd like to take a look at that if you can send me a
 tarball.

 This issue would likely disappear if you dropped and recreated the
 puppetdb database and allowed the nodes to repopulate it, but that could
 take some maneuvering depending on your situation/data needs.

 Wyatt


 On 11/20/14 12:29 AM, Paul Seymour wrote:



 On Wednesday, 19 November 2014 17:56:23 UTC, Wyatt Alt wrote:

 Hey Paul,

 That's some kind of DB corruption. Shouldn't be happening. Do you have
 any sense of when this started or whether it was tied to a recent
 upgrade? Is there a stacktrace in your logs that you could gist? Does it
 happen on every agent run or only occasionally? Is it always the same
 path_id like in the other ticket?

 Also would you mind reporting the output of this?

 select * from facts where fact_value_id in (50319,22128);


  Thanks Wyatt,

  I cannot be sure if this is tied to an upgrade specifically but I just
 happened to be keeping an eye
 on the logs a little more lately (working on an ELK thing to monitoring
 them).

  A stack trace is available at
 https://gist.github.com/PsychoSid/b1a479d7d6fec7477263

  The output from the select is:-
 $ psql
 psql (9.3.5)
 Type help for help.

  postgres=# \c puppetdb
 You are now connected to database puppetdb as user postgres.
 puppetdb=# select * from facts where fact_value_id in (50319,22128);
  factset_id | fact_value_id
 +---
  22 | 50319
 (1 row)

  Hope this helps.

  Cheers
 Paul
  --
 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/7baf1653-d0b4-4fcf-8bcb-039b43af99a5%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/7baf1653-d0b4-4fcf-8bcb-039b43af99a5%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/CAJDiH3EtXEdC-5MvuC-aOZxAYAvk9ja3ZOShtd6p5J6nPKoT_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Anyone made parser = future working on CentOS 6.5 Ruby 1.8.x?

2014-11-21 Thread Larry Liu
Hi everyone,

According to puppetlab's doc, parser=future is supposed to work with puppet 
version 3.5 or higher. I'm on 3.7.1 which falls under 
https://docs.puppetlabs.com/puppet/latest/reference/experiments_future.html, 
but it has not worked for me at all. Interestingly it works fine if I run 
just CLI puppet apply --parser=future xyz.pp. Once I enable it on my puppet 
masters, clients just keep getting 'Error: Could not retrieve catalog from 
remote server: Error 400 on SERVER: Could not parse for environment 
production: Do not add methods to model classes directly, add them to the 
ClassModule instead on node xx'. The ruby version on both masters and 
clients is ruby-1.8.7.352-13.el6.x86_64.

Anyone know why?

-- 
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/aa16b8e8-c503-42f2-9c41-26ea6e027023%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: is there anyway to merge two facts into single one

2014-11-21 Thread Zachary Stern
If you have a fact called factA and a fact called factB, and you need factC 
to be a combination of both values, sure, that can be done.

I don't know what version of Facter you're using, but if you're using PE 
3.7 + Facter 2.2.0, you can simply use Facter.value.

E.g:

Facter.add(:factC) do
  setcode do
factC = #{Facter.value('factA')}#{Facter.value('factB')}
factC
  end
end

That would return a factC that was the combined values of factA and factB.

For more, see the 
docs https://docs.puppetlabs.com/facter/2.2/custom_facts.html#using-other-facts

You could of course just combine the fact values in your puppet code as 
well, if that's appropriate...

`$value = ${one}${two}` is perfectly valid Puppet code.

On Friday, November 21, 2014 6:40:44 AM UTC-8, Spriya wrote:


 Hi,

 The purpose  is i want to compare using the value to a txt file which 
 contains 1.7.0_72//u01/java/jdk1.7.0_72/jre/bin/java this reason for that 
 i want to concatenate.

 Let me know your thoughts
 On Friday, November 21, 2014 8:58:53 AM UTC-5, jcbollinger wrote:



 On Thursday, November 20, 2014 12:21:09 PM UTC-6, Spriya wrote:

 Hi ,

 Is there any way to merge two facts into single facts.

 Here is my facts
 java_known_weblogic_version11.7.0_72java_known_weblogic_version1_path
 /u01/java/jdk1.7.0_72/jre/bin/java

 I want to merge these two facts into single one 

 I mean 

 java_known_weblogic_version1 = 1.7.0_72/
 /u01/java/jdk1.7.0_72/jre/bin/java

 Like this

 Anyone please help me



 In what context, for what purpose?

 Generally speaking, I'd say you should just concatenate the two fact 
 values in the scope where the aggregate value is wanted, as opposed to 
 modifying fact implementations to change what facter reports.  Is that 
 unsuitable for some reason?


 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/062f08f2-2f63-4e5b-ac8f-7f53f99374b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] is there a way to search for a line except the other line

2014-11-21 Thread Spriya
Hi,

I have a txt file which contains

*/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java -version *
*/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java -version *
*/opt/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -version *
*/opt/oracle/agent12c/core/12.1.0.4.0/jdk/jre/bin/java -version *
*/opt/itm/v6.2.2/JRE/lx8266/bin/java -version *
*/u01/java/jdk1.7.0_72/jre/bin/java -version *
*/u01/java/jdk1.7.0_72/bin/java -version *
*/u01/java/jdk1.7.0_65/jre/bin/java -version*
*/u01/java/jdk1.7.0_65/bin/java -version *


I am trying to search for lines except /u01. Is there a way i can do it.

Here is how trying to write with line.include

*log.each_line do |line|*
*   if line.include?('/java').except!('/u01')-- i am trying to read 
lines except the line which contains /u01*


*Please anyone help me*

-- 
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/4ffbbac7-8a18-4108-8f63-0a39fd51760f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: is there anyway to merge two facts into single one

2014-11-21 Thread Spriya
Thank you

On Friday, November 21, 2014 1:41:16 PM UTC-5, Zachary Stern wrote:

 If you have a fact called factA and a fact called factB, and you need 
 factC to be a combination of both values, sure, that can be done.

 I don't know what version of Facter you're using, but if you're using PE 
 3.7 + Facter 2.2.0, you can simply use Facter.value.

 E.g:

 Facter.add(:factC) do
   setcode do
 factC = #{Facter.value('factA')}#{Facter.value('factB')}
 factC
   end
 end

 That would return a factC that was the combined values of factA and factB.

 For more, see the docs 
 https://docs.puppetlabs.com/facter/2.2/custom_facts.html#using-other-facts

 You could of course just combine the fact values in your puppet code as 
 well, if that's appropriate...

 `$value = ${one}${two}` is perfectly valid Puppet code.

 On Friday, November 21, 2014 6:40:44 AM UTC-8, Spriya wrote:


 Hi,

 The purpose  is i want to compare using the value to a txt file which 
 contains 1.7.0_72//u01/java/jdk1.7.0_72/jre/bin/java this reason for 
 that i want to concatenate.

 Let me know your thoughts
 On Friday, November 21, 2014 8:58:53 AM UTC-5, jcbollinger wrote:



 On Thursday, November 20, 2014 12:21:09 PM UTC-6, Spriya wrote:

 Hi ,

 Is there any way to merge two facts into single facts.

 Here is my facts
 java_known_weblogic_version11.7.0_72java_known_weblogic_version1_path
 /u01/java/jdk1.7.0_72/jre/bin/java

 I want to merge these two facts into single one 

 I mean 

 java_known_weblogic_version1 = 1.7.0_72/
 /u01/java/jdk1.7.0_72/jre/bin/java

 Like this

 Anyone please help me



 In what context, for what purpose?

 Generally speaking, I'd say you should just concatenate the two fact 
 values in the scope where the aggregate value is wanted, as opposed to 
 modifying fact implementations to change what facter reports.  Is that 
 unsuitable for some reason?


 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/1e2a786a-e735-440e-9532-4d0142f08313%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Q: Maintaining installation profiles and privisioning using puppet

2014-11-21 Thread James A. Peltier
| Hi,

| I just stated looking closer on the puppet so please forgive me if my
| questions or dilemmas would be a little not accurate in context of puppet.

| I'm trying to solve couple of problems with install infrastructure for more
| than one OS. Let's say that initially would be rpm based Linux and Solaris.
| Generally installation infrastructure across many hosts shares some set of
| stages like a choosing set of software which needs to be installed,
| authentication setup, choosing devices(s) used on install etc.
| In case Linux to perform such set of operation you must have kickstart
| profile which will do all what is needed. In case Solaris you must have
| personalized AI profile and manifest.
| Updating install profiles it is modifying set of KS profiles and for example
| files with PXE bootloader configuration files in pxelinux.cfg/ directory
| served by TFTP server. In case AI installer profiles and manifests must be
| updated and imported to AI database.
| Additionally on higher level it would be good to keep track some additional
| settings like guarantee that none of two hosts will be sharing the same
| addresses, updating DNS records, updating firewall settings or switches
| ACLs.

| In this case I'm not talking about automate simple installation but whole
| multistage provisioning process which should be not started if some
| dependence will be not fulfilled and/or even committing some new change in
| setup should be refused if some inconsistencies will be not fulfilled.

| I know that I can solve such set of problems using quattor and pan language.
| Problem is that IMO quattor community has IMO real problems with lack of
| understanding present days large scale installations in heterogeneous envs
| which makes choosing this software in long term a bit risky.
| Puppet seems has much healthier community and such risk is IMO way lower.

| Questions only is am I will be able to solve all my above problems with
| install infrastructure using puppet using set of templates, with per host
| parameters, dependency rules and checking automatically on updating host(s)
| install settings automatically to start whole cascade of updates in
| provisioning process set of additional actions to update DNS, other files on
| some hosts easier than using quattor?
| If such answer would be positive can I ask someone to point on some needed
| here documentation(s) to dig by myself for necessary details? :)

| I'll be really appreciated any comments or advice If anyone is using puppet
| or other software solving something similar :)

| Regards

| Tomasz

You are talking about merging provisioning and management of machines in such a 
way that Puppet would control all aspects of the infrastructure, including what 
OS would be provisioned on the bare metal and then how it would be maintained 
throughout its lifecycle using Puppet.  It sounds like you're interested in 
Puppet Razor (https://docs.puppetlabs.com/pe/latest/razor_intro.html).

-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices
Twitter : @sfu_rcg
Powering Engagement Through Technology

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


[Puppet Users] rspec-puppet failures when calling none standard types

2014-11-21 Thread Danny Roberts
I am working on adding testing to a module I write 
(https://github.com/kemra102/puppet-zabbix).

I am currently writing the tests for the 'zabbix::repo' class and I am 
getting the following error:

  1) zabbix on ubuntu systems 
 Failure/Error: it { should contain_apt__source('ubuntu-zabbix') }
 Puppet::Error:
   Ubuntu  is not supported by this module. at 
/home/kemra102/projects/puppet-zabbix/spec/fixtures/modules/zabbix/manifests/params.pp:143
 
on node iacon.cybertron.local
 # ./spec/classes/zabbix_repo_spec.rb:16:in `block (3 levels) in top 
(required)'

Here is the test:

require 'spec_helper'

describe 'zabbix', :type = :class do
  it { should contain_class('zabbix::repo') }

  context 'on redhat family systems' do
let (:facts) { { :osfamily = 'RedHat' } }

it { should contain_yumrepo('zabbix') }
it { should contain_yumrepo('zabbix-non-supported') }
  end

  context 'on ubuntu systems' do
let (:facts) { { :osfamily = 'Debian', :operatingsystem = 'Ubuntu' } }

it { should contain_apt__source('ubuntu-zabbix') }
  end

end

I find it strange that the apt::source test for Ubuntu is failing given 
that the yumrepo ones pass absolutely without error. I can give the missing 
'::operatingsystemmajrelease' it is looking for but then it just asks for 
other variables in a seemingly never ending list.

Any ideas why only the apt repo is failing?

-- 
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/ef715a15-713f-43dd-a42f-aebbd333c99e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: is there a way to search for a line except the other line

2014-11-21 Thread Spriya
I think i found the solution
Here is the answer

unless line.include?('/u01')

On Friday, November 21, 2014 2:06:48 PM UTC-5, Spriya wrote:

 Hi,

 I have a txt file which contains

 */usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java -version *
 */usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/bin/java -version *
 */opt/oracle/agent12c/core/12.1.0.4.0/jdk/bin/java -version *
 */opt/oracle/agent12c/core/12.1.0.4.0/jdk/jre/bin/java -version *
 */opt/itm/v6.2.2/JRE/lx8266/bin/java -version *
 */u01/java/jdk1.7.0_72/jre/bin/java -version *
 */u01/java/jdk1.7.0_72/bin/java -version *
 */u01/java/jdk1.7.0_65/jre/bin/java -version*
 */u01/java/jdk1.7.0_65/bin/java -version *


 I am trying to search for lines except /u01. Is there a way i can do it.

 Here is how trying to write with line.include

 *log.each_line do |line|*
 *   if line.include?('/java').except!('/u01')-- i am trying to read 
 lines except the line which contains /u01*


 *Please anyone help me*



-- 
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/ac69b22d-0954-42d1-bde7-bf8bae7e6d0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: rspec-puppet failures when calling none standard types

2014-11-21 Thread Gavin Williams
You need to add an 'operatingsystemmajrelease' fact, as you're using it in 
a case statement in params.pp[1].
The error you're getting points you at the cause :) 

Gav

[1] 
https://github.com/kemra102/puppet-zabbix/blob/master/manifests/params.pp#L137-L144

On Friday, 21 November 2014 19:15:30 UTC, Danny Roberts wrote:

 I am working on adding testing to a module I write (
 https://github.com/kemra102/puppet-zabbix).

 I am currently writing the tests for the 'zabbix::repo' class and I am 
 getting the following error:

   1) zabbix on ubuntu systems 
  Failure/Error: it { should contain_apt__source('ubuntu-zabbix') }
  Puppet::Error:
Ubuntu  is not supported by this module. at 
 /home/kemra102/projects/puppet-zabbix/spec/fixtures/modules/zabbix/manifests/params.pp:143
  
 on node iacon.cybertron.local
  # ./spec/classes/zabbix_repo_spec.rb:16:in `block (3 levels) in top 
 (required)'

 Here is the test:

 require 'spec_helper'

 describe 'zabbix', :type = :class do
   it { should contain_class('zabbix::repo') }

   context 'on redhat family systems' do
 let (:facts) { { :osfamily = 'RedHat' } }

 it { should contain_yumrepo('zabbix') }
 it { should contain_yumrepo('zabbix-non-supported') }
   end

   context 'on ubuntu systems' do
 let (:facts) { { :osfamily = 'Debian', :operatingsystem = 'Ubuntu' } 
 }

 it { should contain_apt__source('ubuntu-zabbix') }
   end

 end

 I find it strange that the apt::source test for Ubuntu is failing given 
 that the yumrepo ones pass absolutely without error. I can give the missing 
 '::operatingsystemmajrelease' it is looking for but then it just asks for 
 other variables in a seemingly never ending list.

 Any ideas why only the apt repo is failing?


-- 
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/b3b1de50-e0de-485c-bd66-d8beab13a1e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet variable with a custom fact

2014-11-21 Thread Eric Sorenson

On Thursday, November 20, 2014 9:22:29 AM UTC-8, Wil Cooley wrote:

 (Aside: Does anyone have a link to a diagram of the dance the master and 
 agent do? I've been meaning to try to make one on websequencediagrams.com 
 but not gotten around to it.)

I made one for the SSL bootstrapping sequence 
here: 
http://ask.puppetlabs.com/question/25/how-can-i-troubleshoot-problems-with-puppets-ssl-layer/

And one for the agent/master communication which I haven't found a good 
place for on ask: 
https://dl.dropboxusercontent.com/u/18472980/puppet-agent-timeseq.png 

-- 
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/e08c76c9-3e45-4b16-907c-c5fc3f2d931a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: workarounds for ruby segfaults on puppet master

2014-11-21 Thread Eric Sorenson


On Wednesday, November 19, 2014 9:02:00 AM UTC-8, Tim.Mooney wrote:


 Since RHEL 6.x has alternate versions of some packages (including ruby) 
 available via its Software Collections Library (SCL), I'm tempted to 
 try switching our puppet master to use the ruby193-* packages from 
 SCL.  A minor downside is that I won't be able to use the Puppet Labs 
 packages 
 anymore, at least on the master. 


Hi Tim, why is it that you wouldn't be able to use the packages on the 
master?

I think you should be able to point your apache 'PassengerRuby' directive 
at the SCL ruby and be good to go.

Another alternative that I'd recommend is to use the new puppetserver 
package, which runs the master under JRuby and replaces the whole 
Apache+Passenger+MRI ruby part of the stack.
 

 The big concern I have relates to how advisable it is to use a different 
 version of ruby on the master vs. all of the clients?  Have other RHEL 
 users tried this, with any success? 


It's generally fine as the execution paths are quite different for agent 
code vs master.

That's why it's been possible to move to JRuby under Puppet Server and 
leave the agents as they are on MRI.

--eric0

 

-- 
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/696d901f-b007-481c-b082-127bfca8e78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: workarounds for ruby segfaults on puppet master

2014-11-21 Thread John Julien

On Nov 21, 2014, at 3:04 PM, Eric Sorenson eric.soren...@puppetlabs.com wrote:

 
 
 On Wednesday, November 19, 2014 9:02:00 AM UTC-8, Tim.Mooney wrote:
 
 Since RHEL 6.x has alternate versions of some packages (including ruby) 
 available via its Software Collections Library (SCL), I'm tempted to 
 try switching our puppet master to use the ruby193-* packages from 
 SCL.  A minor downside is that I won't be able to use the Puppet Labs 
 packages 
 anymore, at least on the master. 
 
 
 Hi Tim, why is it that you wouldn't be able to use the packages on the master?
 
 I think you should be able to point your apache 'PassengerRuby' directive at 
 the SCL ruby and be good to go.
 
If you point Passenger at the SCL ruby (1.9.3) it will not be able to find 
Puppet, since Puppet is installed in the system ruby path (1.8.7).

-- 
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/1FB60192-0728-4D79-B98D-2649017261BC%40julienfamily.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] [puppet apply --ordering = manifest] is not working as expected

2014-11-21 Thread Kyle Purdon
TL:DR Using the --ordering = manifest option does not seem to apply to 
module commands.

Using this parameter I would expect puppet to apply my manifest (site.pp) 
in the order it is written (script like execution).

It appears to do so for everything except module commands. The following 
commands get executed after all done even though they are commands in the 
middle of the manifest. Both are module commands.

rbenv::plugin { sstephenson/ruby-build: latest = true }
rbenv::build { $EDB_RUBY_VERSION: global = true }

nsidc_nfs::sharemount { /disks/backups: project = backups, options = 
ro }

Below is my manifest for reference.

include nsidc_nfs

# ==
# EDB VM PUPPET CONFIGURATION
# ==

# TODO: REPLACE WITH YAML FILE CONFIGS
# USER VARIABLES
$EDB_RUBY_VERSION = 1.9.3-p194
$INSTALL_EMACS = false
$FULL_DATABASE_RECREATE = true
$EDB_DATABASE_USERNAME = kpurdon


# SET GLOBAL EXEC PATH
Exec { path = [ /usr/local/rbenv/shims/, /usr/local/rbenv/bin/, 
/usr/local/sbin/, /usr/local/bin/, /usr/sbin/, /usr/bin/, /sbin/, 
/bin/ ] }


# INSTALL EMACS BECAUSE IT'S THE BEST EDITOR
notify { installing emacs: }
if str2bool($INSTALL_EMACS) {
  package { [emacs24]: ensure = present }
}

# INSTALL RBENV+RUBY-BUILD AND EDB RUBY VERSION
# this is using jdowning/rbenv
notify { installing rbenv: }
class { rbenv: latest = true }
rbenv::plugin { sstephenson/ruby-build: latest = true }
rbenv::build { $EDB_RUBY_VERSION: global = true }


# INSTALL POSTGRESQL+LIBPQDEV
notify { installing postgres: }
package { [postgresql-9.3, libpq-dev]: ensure = present }


# INSTALL SQLITE+SPATIALITE
notify { installing sqlite: }
package { [sqlite3, libsqlite3-dev]: ensure = present }
package { [spatialite-bin, libspatialite5, libspatialite-dev]: ensure 
= present }


# INSTALL PROJECT GEMS
notify { installing edb gems: }
exec { install edb project gems:
  cwd = /vagrant,
  command = bundle install --path=.gems
}


# MOUNT DISKS/BACKUPS FOR EDB BACKUP ACESS
# /disks/backups/databases/mukluk/pgsql/edb_prod_snapshot_with_granules.DMP
notify { mounting disks: }
nsidc_nfs::sharemount { /disks/backups: project = backups, options = 
ro }

notify { setting database user: }
file_line { export database user env:
  path = /home/vagrant/.bashrc,
  line = export DATABASE_ENV=${EDB_DATABASE_USERNAME}
}

notify { recreating the database: }
if str2bool($FULL_DATABASE_RECREATE) {
  #exec { rake recreate database full:
  #  cwd - /vagrant,
  #  command = rake db:recreate_db['full']
  #}
}

notify { all done: }



-- 
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/fe184242-1987-44be-af6c-2eeea34ad2a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: [puppet apply --ordering = manifest] is not working as expected

2014-11-21 Thread Kyle Purdon
Here is my Vagrantfile if that helps:

Vagrant.configure(2) do |config|
  config.vm.provision :shell, :inline =
  cd /vagrant/puppet/librarian; 
librarian-puppet clean --verbose; librarian-puppet update --verbose
  config.vm.provision :shell, :inline = puppet apply --ordering=manifest 
--modulepath=/vagrant/puppet/librarian/modules:/vagrant/puppet/modules 
/vagrant/puppet/manifests
end




On Friday, November 21, 2014 2:46:19 PM UTC-7, Kyle Purdon wrote:

 TL:DR Using the --ordering = manifest option does not seem to apply to 
 module commands.

 Using this parameter I would expect puppet to apply my manifest (site.pp) 
 in the order it is written (script like execution).

 It appears to do so for everything except module commands. The following 
 commands get executed after all done even though they are commands in the 
 middle of the manifest. Both are module commands.

 rbenv::plugin { sstephenson/ruby-build: latest = true }
 rbenv::build { $EDB_RUBY_VERSION: global = true }

 nsidc_nfs::sharemount { /disks/backups: project = backups, options = 
 ro }

 Below is my manifest for reference.

 include nsidc_nfs

 # ==
 # EDB VM PUPPET CONFIGURATION
 # ==

 # TODO: REPLACE WITH YAML FILE CONFIGS
 # USER VARIABLES
 $EDB_RUBY_VERSION = 1.9.3-p194
 $INSTALL_EMACS = false
 $FULL_DATABASE_RECREATE = true
 $EDB_DATABASE_USERNAME = kpurdon


 # SET GLOBAL EXEC PATH
 Exec { path = [ /usr/local/rbenv/shims/, /usr/local/rbenv/bin/, 
 /usr/local/sbin/, /usr/local/bin/, /usr/sbin/, /usr/bin/, /sbin/, 
 /bin/ ] }


 # INSTALL EMACS BECAUSE IT'S THE BEST EDITOR
 notify { installing emacs: }
 if str2bool($INSTALL_EMACS) {
   package { [emacs24]: ensure = present }
 }

 # INSTALL RBENV+RUBY-BUILD AND EDB RUBY VERSION
 # this is using jdowning/rbenv
 notify { installing rbenv: }
 class { rbenv: latest = true }
 rbenv::plugin { sstephenson/ruby-build: latest = true }
 rbenv::build { $EDB_RUBY_VERSION: global = true }


 # INSTALL POSTGRESQL+LIBPQDEV
 notify { installing postgres: }
 package { [postgresql-9.3, libpq-dev]: ensure = present }


 # INSTALL SQLITE+SPATIALITE
 notify { installing sqlite: }
 package { [sqlite3, libsqlite3-dev]: ensure = present }
 package { [spatialite-bin, libspatialite5, libspatialite-dev]: 
 ensure = present }


 # INSTALL PROJECT GEMS
 notify { installing edb gems: }
 exec { install edb project gems:
   cwd = /vagrant,
   command = bundle install --path=.gems
 }


 # MOUNT DISKS/BACKUPS FOR EDB BACKUP ACESS
 # /disks/backups/databases/mukluk/pgsql/edb_prod_snapshot_with_granules.DMP
 notify { mounting disks: }
 nsidc_nfs::sharemount { /disks/backups: project = backups, options = 
 ro }

 notify { setting database user: }
 file_line { export database user env:
   path = /home/vagrant/.bashrc,
   line = export DATABASE_ENV=${EDB_DATABASE_USERNAME}
 }

 notify { recreating the database: }
 if str2bool($FULL_DATABASE_RECREATE) {
   #exec { rake recreate database full:
   #  cwd - /vagrant,
   #  command = rake db:recreate_db['full']
   #}
 }

 notify { all done: }





-- 
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/2d5b37e5-b56d-4708-9b9c-d66b43f18c12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: [puppet apply --ordering = manifest] is not working as expected

2014-11-21 Thread Eric Sorenson
Hi Kyle -- 

On Friday, November 21, 2014 1:46:19 PM UTC-8, Kyle Purdon wrote:

 TL:DR Using the --ordering = manifest option does not seem to apply to 
 module commands.

 Using this parameter I would expect puppet to apply my manifest (site.pp) 
 in the order it is written (script like execution).

 It appears to do so for everything except module commands. The following 
 commands get executed after all done even though they are commands in the 
 middle of the manifest. Both are module commands.

 rbenv::plugin { sstephenson/ruby-build: latest = true }
 rbenv::build { $EDB_RUBY_VERSION: global = true }

 nsidc_nfs::sharemount { /disks/backups: project = backups, options = 
 ro }


Hmm, I think you need to use the 'contain' function in conjunction with the 
ordering so that these classes work the way you expect. 

https://docs.puppetlabs.com/references/3.7.latest/function.html#contain

There's a great blog post by Zachary Stern about 
this: http://puppetlabs.com/blog/class-containment-puppet
 


 # INSTALL EMACS BECAUSE IT'S THE BEST EDITOR
 notify { installing emacs: }
 if str2bool($INSTALL_EMACS) {
   package { [emacs24]: ensure = present }
 }


Aha, here's your real problem :)

--eric0 

-- 
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/afd4ce04-ae12-46d3-b1c2-dc023499319b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: rspec-puppet failures when calling none standard types

2014-11-21 Thread Danny Roberts
That's what I thought (though it leads to a long string of other facts it
wants, one of which my class does not ask for). The thing that makes no
sense though is that the statement in params.pp requires
'operatingsystemmajrelease' is also required for the RedHat serversbut my
test does not fail there even though I don't provide
the 'operatingsystemmajrelease' for the yumrepo tests.

On 21 November 2014 20:42, Gavin Williams fatmc...@gmail.com wrote:

 You need to add an 'operatingsystemmajrelease' fact, as you're using it in
 a case statement in params.pp[1].
 The error you're getting points you at the cause :)

 Gav

 [1]
 https://github.com/kemra102/puppet-zabbix/blob/master/manifests/params.pp#L137-L144

 On Friday, 21 November 2014 19:15:30 UTC, Danny Roberts wrote:

 I am working on adding testing to a module I write (
 https://github.com/kemra102/puppet-zabbix).

 I am currently writing the tests for the 'zabbix::repo' class and I am
 getting the following error:

   1) zabbix on ubuntu systems
  Failure/Error: it { should contain_apt__source('ubuntu-zabbix') }
  Puppet::Error:
Ubuntu  is not supported by this module. at
 /home/kemra102/projects/puppet-zabbix/spec/fixtures/
 modules/zabbix/manifests/params.pp:143 on node iacon.cybertron.local
  # ./spec/classes/zabbix_repo_spec.rb:16:in `block (3 levels) in
 top (required)'

 Here is the test:

 require 'spec_helper'

 describe 'zabbix', :type = :class do
   it { should contain_class('zabbix::repo') }

   context 'on redhat family systems' do
 let (:facts) { { :osfamily = 'RedHat' } }

 it { should contain_yumrepo('zabbix') }
 it { should contain_yumrepo('zabbix-non-supported') }
   end

   context 'on ubuntu systems' do
 let (:facts) { { :osfamily = 'Debian', :operatingsystem = 'Ubuntu'
 } }

 it { should contain_apt__source('ubuntu-zabbix') }
   end

 end

 I find it strange that the apt::source test for Ubuntu is failing given
 that the yumrepo ones pass absolutely without error. I can give the missing
 '::operatingsystemmajrelease' it is looking for but then it just asks for
 other variables in a seemingly never ending list.

 Any ideas why only the apt repo is failing?

  --
 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/Q5zwTl9Zt1E/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/b3b1de50-e0de-485c-bd66-d8beab13a1e6%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/b3b1de50-e0de-485c-bd66-d8beab13a1e6%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
Kind Regards
Danny R

Website: http://danny-roberts.info/

-- 
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/CAMAFyt%3DUSt8p1R2JWEY91qG-mSUiz6dmAyDXD4o%3DVs2Gc31DYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] What can I do with erb templates in Puppet?

2014-11-21 Thread Renu Chuppala
Please provide me steps to modify the config files using templates in 
*WINDOWS*

-- 
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/45e3f9da-31e0-4311-8a9f-931918547ce8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: workarounds for ruby segfaults on puppet master

2014-11-21 Thread treydock
FWIW here's what I put in /etc/puppet/rack/config.ru that has resolved it 
for me:

ARGV  --confdir  /etc/puppet
ARGV  --vardir   /var/lib/puppet
*ARGV  --debug*
*ARGV  --trace*
*ARGV  --profile*
ARGV  --logdest  /var/log/puppet/puppetmaster.log

If I remove the lines the segfaults become a problem.  I'm now on Puppet 
3.6.2 and this is still an issue that requires the above work around.

I have a second Puppetmaster that's on EL7 and I don't have to add this 
workaround thankfully.  They serve the same clients and use the same 
modules as the masters are load balanced using round-robin DNS, so it's 
definitely an EL6 issue.

Just be sure if you use that work-around to update logrotate to clean out 
puppetmaster.log as that file will get very large very quickly.  The 
--logdest portion I used to keep the logs out of syslog and so they could 
be cleaned up more easily using logrotate.

- Trey

On Wednesday, November 19, 2014 11:02:00 AM UTC-6, Tim.Mooney wrote:


 All- 

 For those of you that are using puppet on RHEL 6.x (/CentOS/Oracle 
 Linux/Scientific Linux/etc.) and have experienced ruby segfaults on 
 your puppet master(s), what workaround or workarounds have you been 
 using? 

 We have been using puppet 3.4.2 (from Puppet Labs repos) for some time, 
 with a RHEL 6.x puppetmaster under mod_passenger.  RHEL 6.x currently 
 has ruby 1.8.7 patchlevel 374 as its default ruby version. 

 In the past couple weeks we've started to see a couple of different 
 clients that are triggering segfaults in ruby on the master during a 
 puppet agent run.  Examples include: 

 /usr/lib/ruby/site_ruby/1.8/puppet/util/profiler.rb:30: [BUG] Segmentation 
 fault ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] 

 /usr/lib/ruby/site_ruby/1.8/puppet/parser/type_loader.rb:110: [BUG] 
 Segmentation fault ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux] 

 Web searches related to this issue turned up a thread from puppet-users 
 earlier this year started by treydock: 

  https://groups.google.com/forum/#!topic/puppet-users/qWN6j-eNiZ0 

 Unfortunately, I've tried a lot of the workarounds suggested in that 
 thread, and none of them seem to reliably avoid the problem. 

 - I tried back-porting the small patch from PUP-1592 to our 3.4.2 
puppet master.  No luck. 

 - Yesterday, I bit the bullet and upgraded our entire puppet 
infrastructure from 3.4.2 to 3.7.3.  We still see the same 
segfaults on the master, both under mod_passenger and when 
running the master in standalone mode for testing. 

 Since RHEL 6.x has alternate versions of some packages (including ruby) 
 available via its Software Collections Library (SCL), I'm tempted to 
 try switching our puppet master to use the ruby193-* packages from 
 SCL.  A minor downside is that I won't be able to use the Puppet Labs 
 packages 
 anymore, at least on the master. 

 The big concern I have relates to how advisable it is to use a different 
 version of ruby on the master vs. all of the clients?  Have other RHEL 
 users tried this, with any success? 

 Thanks, 

 Tim 
 -- 
 Tim Mooney tim.m...@ndsu.edu 
 javascript: 
 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/c7c531ce-3598-471f-befa-51867c3abf89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Ensure rows in a mysql table

2014-11-21 Thread Abhijeet Rastogi
Hi everyone,

I've this unique requirement where I have to manage rows in a
database using puppet. Well, these rows actually represent dns
entries. (I'm using powerdns witih mysql
http://doc.powerdns.com/html/generic-mypgsql-backends.html ).

What do you guys thing is the right way to approach this? Below are
the couple of things I can think of:-

1. First write various command line scripts like show_rows, add_rows 
delete_rows. And then call exec with conditionals to alter these
rows.
2. Write a custom type/resource which connects to mysql instance and
does it's job.

Although, second option is the most optimal way to do, it also
requires more man hours. I would be happy to choose something that's
already built and tested. Any ideas?


-- 
Cheers,
Abhijeet Rastogi (shadyabhi)

-- 
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/CACXxYfxzz1fCYim-xG6-WxUeWu3BREgLC-quzagjyL%3DUy2TvUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.