puppet

Can I install puppet modules through puppet manifest?

别来无恙 提交于 2019-12-04 16:29:45
问题 Primary goal is to add all puppet modules automatically, so that all dev-env's and prod-env could be started with one command. How can I install puppet modules through puppet manifest? 回答1: We've been happily using librarian-puppet to sync all 3rd party modules, it supports setting the modules' locations and versions. So production and dev run the exact same code. The usage is one liner librarian-puppet install In other cases we have a shell script that runs puppet two times, one time a

Puppet - test if a package already defined?

≯℡__Kan透↙ 提交于 2019-12-04 15:56:21
问题 I'm writing some puppet modules and have a package defined in two modules hence get the following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Package[gnome-session-fallback] is already defined in file /etc/puppet/modules/vnc4server/manifests/init.pp at line 3; cannot redefine at /etc/puppet/modules/vino/manifests/init.pp:7 on node l Hence want to ensure that the package has not already been defined but the following does not work: if !

Where is “Jenkins URL” configuration stored?

独自空忆成欢 提交于 2019-12-04 15:36:49
问题 I'm trying to set up a non-default URL as part of a puppet script that installs Jenkins. I know how to edit the value via the web UI but I can't seem to find where the value is actually stored. I've looked through the jenkins_home folder and apache and have yet to find it. 回答1: It stores it in a rather unlikely place: hudson.tasks.Mailer.xml in Jenkins home folder. 回答2: If you don't find the URL when grepping Jenkins home, it's because you didn't saved the configuration. If not set, Jenkins

How to include a subtemplate in a Puppet template

左心房为你撑大大i 提交于 2019-12-04 13:45:37
I'm trying to include a subtemplate in a template for one of my Puppet modules. Here's how I do the include in my base template: <% def import(fname) erb = File.open(File.dirname(__FILE__) + "/" + fname) { |fp| ERB.new(fp.read) } erb.run end %> <%= import("subtemplate.erb") %> This works fine if I render it with erb command-line tool. However, during the Puppet run the import is silently ignored, i.e. the base template is rendered with a blank line where the rendered subtemplate should be. There are no errors generated. What am I doing wrong? Thanks! how about: <%= scope.function_template(

conditional within define in puppet

一世执手 提交于 2019-12-04 12:59:30
Running Puppet 3.8 I have two defines: define desktop::vinstall () { package { $title: ensure => installed, allow_virtual => true, configfiles => keep, } } and define desktop::vinstallwseeds () { package { $title: ensure => installed, allow_virtual => true, configfiles => keep, require => File["/var/cache/debconf/pkg-${title}.seeds"], responsefile => "/var/cache/debconf/pkg-${title}.seeds", } file { "/var/cache/debconf/pkg-${title}.seeds": source => "puppet:///modules/desktop/pkg-${title}.seeds", ensure => present, } } Would like to turn these into one define statement with an optional boolean

How do I change the puppet version installed by vagrant

耗尽温柔 提交于 2019-12-04 11:45:02
问题 I use vagrant 1.0.1 on a precise32 base box to play with puppet. Provisioning works fine, my manifests are being executed. By default vagrant installs puppet 2.7.14 under /opt/vagrant_ruby/bin/puppet on the guest. How can I configure vagrant (or who ever installs puppet on the guest) to use a more recent version like puppet 3.0 or 3.1? 回答1: You need to rebuild the basebox that you are using in vagrant and install whatever version of Puppet you want. I did the same for Cent 6.3 w/puppet 3.0.

Auto setting xdebug.remote_host ip address with vagrant/puppet

此生再无相见时 提交于 2019-12-04 11:41:20
问题 I'm in the process of setting up a Vagrant environment using puppet for provisioning. I'm stuck with one issue, I would like xdebug to 'just work' when running vagrant up however I need to specify the host machines ip address in the php.ini file xdebug.remote_host , obviously this is going to be different on each machine the config is used so I would like a way to automatically update that value when issuing vagrant up . VagrantFile: config.vm.network :forwarded_port, guest: 9000, host: 9000

Calling puppet defined resource with multiple parameters, multiple times

萝らか妹 提交于 2019-12-04 11:33:25
问题 I've got a simple puppet defined resource that looks like this: define mything($number, $device, $otherthing) { file{"/place/${number}": ensure => directory } mount { "/place/${number}": device => $device, ensure => mounted, require => File["/place/${number}"] } file {"/place/${number}/${otherthing}": ensure => directory, require => Mount['/place/${number}'] } } I need to call this resource a number of times with different parameters, but can't figure out how to do this without explicitly

how to test the result of applying a puppet template to given test parameters

本秂侑毒 提交于 2019-12-04 09:46:39
I have the following puppet template file solr.json.erb: { "servers" : [ { "port" : "<%= jmx_port %>", "host" : "localhost", "queries" : [ <% @markets.each do |market| -%> { "outputWriters" : [ { "@class" : "com.googlecode.jmxtrans.model.output.StdOutWriter", } ], "obj" : "solr/market_<%= market %>:type=queryResultCache,id=org.apache.solr.search.LRUCache", "attr" : [ "hits","hitratio"] }, <% end -%> ], "numQueryThreads" : 2 } ] } and I want to test the result of applying the template to some test parameters before executing this in puppet. how can I do that? before, I tried with a script like

puppet node hostname

ぃ、小莉子 提交于 2019-12-04 08:27:45
问题 I'm using puppet to configure servers. I want to print current machine (node) name in *.erb template. There is hostname variable, but this holds puppetmaster hostname. Is there any good reference/list regarding to this topic? 回答1: Seems like I have miss-looked somewhere. I can get(print) node-hostname simply by invoking following code in *.erb template: <%= @hostname %> Edit: As of Puppet 3, using local variables (i.e. hostname is deprecated; Puppet 4 will remove support for them entirely.