[Puppet Users] Re: starting hiera + ntp module

2014-06-01 Thread Sans


On Wednesday, October 9, 2013 4:11:46 PM UTC+1, TimV wrote:


 Inside hieradata, I have a simple common.yaml file, and in that file I 
 have:

 ---
 testmsg : 'Tim was here'
 ntp::restrict : false,
 ntp::autoupdate : true,
 ntp::enable : false,
 ntp::servers : [
   ntp.example.org iburst,
   0.us.pool.ntp.org iburst,
   1.us.pool.ntp.org iburst,
   2.us.pool.ntp.org iburst
   ]


One this noticed about your ntp::servers here: I don't know if you can do 
that way but normally I define an array in hiera like this: 

ntp::servers:
 - ntp.example.org iburst
 - 0.us.pool.ntp.org iburst
 - 1.us.pool.ntp.org iburst
 - 2.us.pool.ntp.org iburst

 

In that case, the error message: Error 400 on SERVER: false, is not an 
Array - seems right. Best!


-- 
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/1898c642-2820-4e57-acc9-37a5be285584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Windows exe fork

2014-06-01 Thread Bill N
Hi,

Just wrote my first puppet module for Windows  provisioning. All is working 
well except I am having a problem running a windows exe file in that Puppet 
appears to wait for the exe to complete. At least this is the case when I 
run Puppet agent --test from the Windows Server command line.

What I want to do here is install a set of files for a Riemann monitoring 
client on several Windows Server 2008 R1 VMs. These files include an exe, 
which I want to start and run in perpetuity. I don't want Puppet to wait 
for this process to complete. It appears I could run the exe in a separate 
shell using cmd.exe, but when I try that on the command line I do not see 
the named process running in the Resource Monitor. I only see cmd.exe 
running. This is not very informative.

My question is, what is the best way to run this executable via Puppet? 
Should I convert the exe to a Windows service, install that and run it as a 
service? Should I use shell cmd and live with the unhelpful Resource 
Monitor listing? Or should I use Power Shell to fork the process like I 
would in linux?

Any help would be most appreciated.  

-- 
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/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] future parser changes undef to string inside create_resources (tested on puppet 3.5.1 and puppet 3.6.1)

2014-06-01 Thread Robert
I've stumbled upon this very annoying bug with the future parser where it's 
replacing undef with empty strings when passed inside a hash to 
create_resources().

test.pp
=
define test($var = undef) {
  notice inline_template(%= @name % is % if @var %true% else 
%false% end % and of type %= @var.class %)
}

$config = {
  from_create_resources = {
var = undef
  }
}

create_resources('test', $config)
=

$ puppet apply ./test.pp
Notice: Scope(Test[from_create_resources]): from_create_resources is false 
and of type NilClass

$ puppet apply --parser future ./test.pp
Notice: Scope(Test[from_create_resources]): from_create_resources is true 
and of type String

Breaks most of my templates since I use % if @var % everywhere...

-- 
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/f943395e-81a5-48f2-a2d8-c2ebe5ae3ef1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3.6.1 Virtual Packages, and unrelated facts questions...

2014-06-01 Thread Garrett Honeycutt
On 5/23/14, 4:31 AM, Paul Seymour wrote:
 Hello,
 
 Just updated the test environment to 3.6.1 and I know the changes have
 been made for virtual packages. But now each agent output displays this:-
 
 Warning: The package type's allow_virtual parameter will be changing its
 default value from false to true in a future release. If you do not want
 to allow virtual packages, please explicitly set allow_virtual to false.
(at /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:816:in `set_default')
 
 I know we can set a top level default but does that really have to come
 out constantly ?
 
 Now this may be related to 3.6.x but I cannot say for sure. A couple of
 facts we use are now throwing some errors.
 
 First is:-
 Could not retrieve fact='concat_basedir', resolution='anonymous':
 uninitialized constant Puppet
 
 Which comes from:-
 Facter.add(concat_basedir) do
 setcode do
 File.join(Puppet[:vardir],concat)
 end
 end
 
 The second is:-
 Error converting value for param 'config': Could not find value for $confdir
 
 Which comes from this extract:-
   if Puppet.version.to_i = 3
 Puppet.settings.initialize_global_settings(Puppet[:config])
 unless Puppet.settings.global_defaults_initialized?
   else
 Puppet.parse_config
   end
 
 If I set it with:-
 Puppet.settings.initialize_global_settings([--config=/etc/puppet/puppet.conf])
 
 Then it works fine.
 
 So it seems they may be related in facter not reading from the
 puppet.conf file correctly ?
 
 Any help would be appreciated.
 
 Thanks
 Paul

Hi,

Don't mean to move the thread away from the logging issue, just wanted
to post a potential fix for others who want this solved, especially if
all of your nodes are not upgraded at the same time. To do so, I added
the following to my site.pp

  if versioncmp($::puppetversion,'3.6.1') = 0 {

$allow_virtual_packages = hiera('allow_virtual_packages',false)

Package {
  allow_virtual = $allow_virtual_packages,
}
  }

Best regards,
-g

-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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/538B838C.6030203%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-06-01 Thread Brian Mathis
On Sat, May 31, 2014 at 4:46 PM, Robin Bowes robin.bo...@yo61.com wrote:

 On Sat, 2014-05-31 at 07:12 -0700, Daniele Sluijters wrote:
   - Don't use automatic hiera lookups.  This removes the magic and
  makes it more clear to everyone that the data is coming from hiera.
 
 
  Hold on a sec; if you mean data bindings with 'automatic hiera
  lookups', most certainly use them. Do not ever hardcode hiera()
  functions in parameter lookups in your module as you module can now
  _only_ work with Hiera and not everyone uses or wants to use hiera.
  Instead let data bindings take care of it so that everyone can benefit
  from your code, Hiera, ENC or by explicitly passing data in.

 I think the most important thing is to not hardcode hiera() functions in
 modules. That gives the flexibility for the users of the modules to
 either rely on automatic parameter lookup (APL) or explicitly pass in
 the parameters.

 My own preference is to use explicit hiera lookups in profiles and
 pass in the data to modules. APL is just a bit too magic, in my
 experience, and avoiding it makes it easier to work out where data comes
 from.

 R.



Yes, this is what I mean.  Don't use or access hiera from with *component*
modules.  You do need to use it from profile modules.  This assumes that
one is using the profile/roles pattern, which seems to be the current best
practice anyway.


❧ Brian Mathis
@orev

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


Re: [Puppet Users] puppetdb '[replace catalog]' postgresql errors with index 'catalog_resources_pkey'

2014-06-01 Thread Ken Barber
 It would be very hard to create a large resource type, but not
 impossible. Whats more likely is that the title of one of your
 resources is excessively large. This is possible most likely with an
 exec {} or something similar that uses a very large command as the
 title of the exec, instead of putting it in the command parameter like
 so:
 http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-command.
 Either that, or something very similar.


 Thank you for the quick, thorough, and incredibly helpful reply. You pointed
 me in the right direction. Turns out we had an older module that was doing
 just what you suspected.  There were two titles of over 370 characters
 apiece.  Here is the original module:
 https://github.com/puppet-modules/puppet-common/blob/master/manifests/defines/line.pp

 Command used to troubleshoot:
 cat /var/lib/puppet/client_data/catalog/puppetca.fqdn.json | python
 -mjson.tool | grep title

 I resolved this issue by changing all execs to named execs, differentiated
 by the '${file}' variable passed into the script to avoid duplicate
 declarations. For example, exec { name: d_line_ensure_present_${file}:
 command = ... }

 Checking the logs, I no longer see the errors.

 BTW this might be considered a bug, and might call for better
 normalisation in our schema to avoid this. Having said that, a type
 and title combination this excessive is very abnormal, so it might be
 something we want to stop from happening in Puppet anyway :-). So
 weither this is a bug for puppet or puppetdb we'll have to determine.


 Let me know if you need any more information from my end on this.


 This looks like you haven't upgraded puppetdb-terminus to the latest
 version (2.0.0) on your puppet master. We've bumped the command
 version to 4 now, this looks like its just the old code. Also people
 often forget to restart the Apache process when upgrading the terminus
 code, don't forget to do that.


 puppetdb-terminus was updated along with puppetdb, but httpd had not been
 restarted.

 Thanks again, Ken!

No problem :-).

Can you raise a bug on the original exec {} issue for me?
https://tickets.puppetlabs.com/browse/PDB

ken.

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


[Puppet Users] How do I run a shell script from puppet?

2014-06-01 Thread Tibor Malomsoki
apt-get update is work- 

exec { apt-update:
command = /usr/bin/apt-get update
}

Exec[apt-update] - Package | |


But now I want to run a complicated script (/etc/puppet/script/works.sh)

what do I write the site.pp that I run the script in the client

-- 
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/192595dd-e0bc-4270-b3d1-fb1569a3f3af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Windows exe fork

2014-06-01 Thread Jim Ficarra
I’m not familiar with how the Reimann monitoring client runs – but if you run 
it at the command line and it runs within the shell and requires the command 
shell to run perpetually, you could try “start.exe reimannclient.exe” or 
whatever the name of the exe is.  There are a # of command line switches that 
you can look at in the help by typing start /? at the command line.  This would 
be a kludgey way to do it though to be honest.  You won’t have a very good way 
to control it.

Alternatively, it’s usually better to run these types of things within the 
service control manager as a service if they are supported which will give you 
more control over starting, stopping, and ensuring it starts up when the 
servers reboot, etc.  Hopefully your tool is able to run natively as a service. 
 if not, you can try to set up a service wrapper to run it as a service 
(Unfortunately you can’t just convert any exe natively into a Windows service). 
 SrvAny (the wrapper) and InstSrv (sets up the SrvAny wrapper in the 
registry/service control manager) were tools available in the Windows 2003 
Server Resource Kit.  I’ve recently read that those 2003 tools still work in 
2008, but keep in mind that they are not supported and your mileage may vary.

If your client is available as something that can run as a service that would 
be much better. 

You could use puppet to ensure the components are installed properly and that 
the service is set to run all the time.  

From: Bill N 
Sent: Friday, May 30, 2014 12:27 PM
To: puppet-users@googlegroups.com 
Subject: [Puppet Users] Windows exe fork

Hi,

Just wrote my first puppet module for Windows  provisioning. All is working 
well except I am having a problem running a windows exe file in that Puppet 
appears to wait for the exe to complete. At least this is the case when I run 
Puppet agent --test from the Windows Server command line. 

What I want to do here is install a set of files for a Riemann monitoring 
client on several Windows Server 2008 R1 VMs. These files include an exe, which 
I want to start and run in perpetuity. I don't want Puppet to wait for this 
process to complete. It appears I could run the exe in a separate shell using 
cmd.exe, but when I try that on the command line I do not see the named process 
running in the Resource Monitor. I only see cmd.exe running. This is not very 
informative.

My question is, what is the best way to run this executable via Puppet? Should 
I convert the exe to a Windows service, install that and run it as a service? 
Should I use shell cmd and live with the unhelpful Resource Monitor listing? Or 
should I use Power Shell to fork the process like I would in linux?

Any help would be most appreciated.  
-- 
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/c5d75b7c-531d-40d2-a027-f118910206af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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


[Puppet Users] connect jboss to mysql

2014-06-01 Thread Ankita kumari
how to connect jboss_as to mysql?

-- 
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/3a636708-bf9d-44f7-ba14-0bbf2ba38cf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.