FAQ Database Discussion Community


How do notifications traverse a Puppet resource chain?

puppet
Given this simplified Puppet example, it's clear that any change to my_file will trigger my_service to refresh due to the ~> chaining operator: package { 'my_package': } -> file { 'my_file': } ~> service { 'my_service': } Will a change to my_package also cause my_service to refresh? (That is, will...

Mcollecitve mco shell command is not working

puppet,mcollective
I am using mcollective-2.8.1 version and installed all the related packages, but its seems like shell command is missing. I am not able to find the package/plugin for shell command.

Vagrant: How to set default log level for Puppet?

logging,vagrant,puppet
I use Puppet as provisioner within Vagrant. I'd like to see only "warn" and higher log level output on puppet's console output. Is it possible to configure the default log level [1] for Puppet in Vagrant to "warn"? Does this affect the console output? [1] https://docs.puppetlabs.com/references/latest/configuration.html#loglevel...

php5enmod mcrypt with Puppet

php,nginx,ubuntu-14.04,puppet
Another Puppet related question. As part of my installation with Puppet, I'm installing: - Ubuntu 14.04.2 LTS PHP5-FPM Nginx MySQL etc As part of the PHP class I have the following: - package {[ 'php5-fpm', 'php5-mysql', 'php5-cli', 'php5-mcrypt', 'php5-curl', ]: ensure => present, require => Exec['apt-get update'], } This part...

How do I configure rabbitmq queue via puppet

rabbitmq,puppet,rabbitmq-exchange
I'm trying to install rabbitmq via puppet. I'm using the puppetlabs-rabbitmq module. It also has section to configure queues and exchanges, which are Native Types. I can't figure out how to use these native types. My code for rabbitmq installation: class rabbitmq-concrete{ $tools = ["vim-enhanced","mc"] package { $tools: ensure =>...

puppet detect if a file changed but don't change it

jenkins,puppet,rhel
I want to manage the config.xml file of the jenkins-service with puppet. The problem is that if Puppet changes the config.xml file and than restarts the jenkins service, the config.xml file gets overwritten by the currently loaded configuration of jenkins and the changes made by puppet are lost. That's what...

Puppet agent not using modulepath setting

configuration,puppet,agent
I have installed Puppet Agent 3.7 on an AWS Ubuntu machine. After receiving a 'could not find class' error, I added a modulepath entry to the /etc/puppetlabs/puppet/puppet.conf file. modulepath=/home/ubuntu/repos/puppet-tests/modules However, if I run the following command, I am told that the module path(s) haven't changed. puppet apply --configprint modulepath i.e....

WP-CLI error installing plugins/themes. “Could not create directory”. Permissions error? Ubuntu 14.04 x64

wordpress,ubuntu,vagrant,puppet,puphpet
I've been searching for a few days now trying to figure out a solution to this problem, but I've given up and its time to ask for some help. I'm running Wordpress on an Ubuntu 14.04 x64, using a Vagrant server created with PuPHPet (an automated GUI for creating boxes...

puppet concat::fragment not inserting content in vhost

apache2,puppet,concat,vhosts
So I have a vhost config in my puppet manifest file apache::vhost { 'site.dev': port => '80', docroot => '/home/vagrant/projects/Personal/php/site/public', serveradmin => '[email protected]', options => ['Indexes','FollowSymLinks','MultiViews'], setenv => ["APP_ENV dev"], override => ['All'], } Now I want to add these options EnableSendfile Off EnableMMAP Off I googled and found that...

How to dynamically create an environment variable?

powershell,puppet
I am using powershell script to set some environment variable-- $env:FACTER_Variable_Name = $Variable_Value FACTER is for using these in the puppet scripts. My problem is - the variable name and variable value both are dynamic and getting read from a text file. I am trying to use $env:FACTER_$Variable_Name = $Variable_Value...

Puppet Windows Package Provider Encoding Error

ruby,windows,encoding,puppet
I have a Puppet manifest for Windows that is used (among other things) to download and install Python. It used to work just fine. Now it's giving me strange errors related to string encoding whenever it tries to process an MSI file. The relevant portions of the manifest are: (Note:...

What exactly is the difference between notify function and notice resource in Puppet?

puppet
I can display a custom message in two ways in Puppet, either by notice("My extra information as a function") or by notify{"My extra information as a resource":} Things in common: Both get evaluated on Puppet Master. Both have access to facts. If message is composed from variables, both would display...

How to Dynamically select the path to System folder based on 32/64 bit OS with Puppet

windows,puppet,puppet-enterprise
I am automating the deployment of my web application on Windows 2008 server R2 using Puppet. There are several steps in which I would be accessing the System folder (System32 or SysWOW64 depending on 32/64 bit OS). Let me take one of these steps: I would access 'appcmd.exe' to Start/Stop...

puppet file function doesn't load contents

amazon-web-services,amazon-s3,puppet
I am trying to use the puppet file function (not the type) in the following way class iop_users { include 's3file::curl' include 'stdlib' $secretpath=file('/etc/secret','dev/null') notify { 'show secretpath': message =>"secretpath is $secretpath" } s3file { '/opt/utab.yaml': source => "mybucket/$secretpath/utab.yaml", ensure => 'latest', } exec { 'fix perms': command => '/bin/chmod...

Bash script if statement with multiple conditions

bash,vagrant,puppet,librarian
I'm trying to create a simple bash shell script provisioner for a vagrant puppet dev env which checks that /tmp/puppet-modules-up-to-date exists and was created within a certain timeframe, 14 days to be precise. I'm struggling to progress with this simple script. Any help appreciated. #!/bin/bash if [[ ! -f /tmp/.puppet-modules-up-to-date...

Installing execSync using Puppet

node.js,puppet,system-administration
I am writing a Puppet module to setup an application on our test servers. The testing environment requires us to install a node package called execSync (https://github.com/mgutz/execSync). Since execSync is a native package, it gets compiled on installation. When I try to manually install it on the server, it gets...

Puppet: Set env variables & boot app - variables undefined

linux,environment-variables,vagrant,puppet
I am using Puppet to provision my Vagrant box. Among a few other tasks, the main.pp file is creating the /etc/environments file, then daemonizing the node.js app I'm running. The node app requires a few environment variables, but they're returning undefined. The relevant main.pp snippets: class environment { file {...

Vagrant + puppet + docker

mysql,docker,vagrant,puppet
I'm new with this technologies but I want to learn about automation and containers stuff. I read some documentation about this 3 products and I want to know if is possible to automate almost everything in a large environment using this products. Vagrant for deploy VMs (let's say 10 at...

Do basica math inside of hiera

puppet,hiera
I'm trying to set a crontab's weekday in hiera based on a custom fact and a basic modulo but I can't even figure out if it's possible. I'd like to do something like: cron-job: command: "do something" user: myuser hour: "%{::instance}" minute: "%{::instance}" weekday: "%{::instance}" % 7 Can that even...

Is it possible to use a join-like function either in Hiera or Puppet?

dictionary,puppet,hiera
I got a list of IPs in a yaml file: --- ips: 1.1.1.1 2.2.2.2 3.3.3.3 Furthermore the IPs are used (interpolated) in another variable params: value: "%{hiera('ips')}" This works so far. The content is 1.1.1.1 2.2.2.2 3.3.3.3 In a module I need to join each of these ips with a...

Set mysql root password on Puppet

mysql,puppet,puppetlabs-mysql
I have downloaded puppetlabs-mysql module in its latest version (3.30) and I can not define root password. My OS is Ubuntu 14.04.2 LTS When I try to run: class {'::mysql::server': remove_default_accounts => true, create_root_user => true, create_root_my_cnf => true, root_password => $mysql_server_root_password, } I get the following message: Notice: Compiled...

how to add template file in rspec-puppet

rspec,puppet
I have below manifests for sudo user, loading template file class sudo { if $::operatingsystemmajrelease < 7 { $variable = $::operatingsystemmajrelease ? { '6' => $::fqdn, } file { '/etc/sudoers' : ensure => present, owner => 'root', group => 'root', mode => '0440', content => template('sudo/sudoers.erb'), } } } Below...

Using Ruby to execute arbitrary system calls

ruby,puppet,system-calls,return-code
This problem is to get into an internship within a devops department: "Write a ruby library that executes arbitrary system calls (eg: “dmesg", "ping -c 1 www.google.com”) and provides separated output streams of stderr and stdout as well are providing the final return code of the process. Show your work...

Wrap resources inside custom class and invoke class?

nginx,puppet
I am using Puppet 3.0. I tried to use the existing NGINX module but encountered one issue which no answer seems to exist. I have moved to implementing NGINX module myself which handles my exact requirements. Each package/service/file resource works as expected and now I am moving the code out...

multiple similar files on one host from one template in puppet

templates,puppet
all. This seems like something other people would have already answered, but I couldn't find it, so apologies if this is an old question. I want to make multiple files on one host from the same template. These are dnsmasq hosts files for IPs on an internal vs external network....

puppet staging::deploy is not working on windows and saying unzip command not found

windows,puppet
I am using staging::deploy in my puppet script to download and extract the file as below. And I am trying this on windows. staging::deploy{ "jdk1.7.0_04.zip": source => 'http://sometlocation/jdk1.7.0_04.zip', target => 'E:/PuppetTestData', } File download is happening but when staging::extract is executed, I am getting below error. Error: Could not find...

Using duritong/puppet-shorewall with Puppet and Hiera does not work as expected

puppet,hiera
I am trying to use this module here with puppet: https://github.com/duritong/puppet-shorewall Following the example I got the rules working node xy { class{'config::site_shorewall': startup => "0" # create shorewall ruleset but don't startup } shorewall::rule { 'incoming-ssh': source => 'all', destination => '$FW', action => 'SSH(ACCEPT)', order => 200; 'incoming-puppetmaster':...

Augeas in Puppet for mysql config failing

mysql,nginx,puppet,augeas
I'm currently developing some basic Puppet manifests and modules to install my application dependencies after my server has been deployed. It's a suite of basic stuff: - OS -> Ubuntu 14.04 LTS Nginx PHP5-FPM MySQL Simple, right? Everything is going pretty well for the most part; until I stumbled upon...

How to set environment variables in Ubuntu OS using Puppet

puppet
I have been learning Puppet since two weeks and would like to automate few of our routine tasks. As a part of web application setup, first of all we have to set environment variables for JAVA, ANT etc. in the /homeuser/.bashrc file. I have written the following manifests for it...

Configuring Hiera on Puppet Enterprise

puppet,hiera,puppet-enterprise
I am new to Puppet and Hiera, and having a configuration issue when attempting to apply a module the contains a Hiera lookup to an agent. From /etc/puppetlabs/puppet/hiera.yaml: --- :backends: - yaml :hierarchy: - defaults - "%{clientcert}" - "%{environment}" - global :yaml: :datadir: '/etc/puppetlabs/puppet/hiera' From /etc/puppetlabs/puppet/hiera/develop.yaml: git_client: file_content:here When running...

Puppet syntax error

vagrant,puppet
Receiving the following error Error: Could not parse for environment production: Syntax error at 'conf'; expected '}' at haproxy/manifests/init.pp:4 while trying to puppet parser validate the following init.pp I've looked through my class and it seems all my commas and colons are in order, so I'm not positive what is...

Does puphpet install vm on digitalocean?

vagrant,puppet,digital-ocean
I think I understand puppet and vagrant pretty well however I might have confused myself. So I created a Puppet setup using puphpet.com and I chose Digital Ocean as my deploy target, I then enter my API key and all is well. The final step they say is to run...

Puppet Learning VM with Jenkins CI installation

centos,continuous-integration,puppet
I am trying to set up Jenkins CI in Puppet Learning VM ( CentOS 6.5 x86 ), but I cannot make yum to see openjdk 1.7.0 packages, therefore jenkins puppet fails. I have tried adding epel repo - still yum says no package available. I have changed pluginconf to disable...

Puppet: Server hostname did not match server certificate

certificate,puppet,agent
I installed Puppet Enterprise on two virtual machines (one master and one node). When I try to run my agent manually with puppet agent -t i get the error Server hostname '192.168....' did not match server certificate; expected one of host-192-168-.....localdomain. If i run this by adding --server host-192-168.....localdomain it...

OpenSSL vs GPG for encrypting off-site backups?

ruby,encryption,puppet,ubuntu-14.04,gnupg
Given the option between using GPG and OpenSSL for local encryption before pushing archives to an off-site backup location, what are the benefits and drawbacks of each solution? Background: I currently manage a server infrastructure based on Ubuntu 14.04.1 with all current patches applied as they become available. All of...

Reading from file /etc/resolv.conf and populating in named.conf.options

puppet
I'm using puppet to generate my named.conf.options file, in order to do this I'd like it to use the forwarders defined in /etc/resolv.conf. What's the best way of doing this, I've been doing it like this (where named.conf.options.erb contains ) - but this runs constantly. file { '/etc/bind/named.conf.options': ensure =>...

TDD a Hiera hash in Puppet

hash,rspec,tdd,puppet,hiera
spec/classes/test_spec.rb require 'spec_helper' describe 'test' do let(:hiera_data) { { :a => 'hello' } } it { should contain_file('/tmp/hello') } end manifests/init.pp class test { $a = hiera('a') file {"/tmp/$a":} } results in: [[email protected] test]$ rspec . Finished in 1.11 seconds (files took 3 seconds to load) 1 example, 0 failures...

Using external variable in rspec-puppet test

ruby,rspec,puppet
Have some stuck with using variable in rspec. Here is my params.pp case $::osfamily{ Debian: { $ssh_daemon = "ssh" } Redhat: { $ssh_daemon = "sshd" } In rspec test i need to use variable $ssh_daemon, like this it { should contain_service("${ssh_daemon}").with( :ensure => 'running', :enable => 'true', )} Here is...

correct development flow when using vagrant and puppet

amazon-web-services,vagrant,puppet,digital-ocean
I have done some googling however I couldn't quite find what I wanted. What I am trying to achieve is have a local, development staging and live all using vagrant and puppet/chef. Now I could be totally wrong and missing something but could I for example on my local development...

Module name and directory name conflict?

java,tomcat,puppet,puppet-enterprise
I created a module named 'learn-tomcat' and it has a class named tomcat (in init.pp). When I try to include this class in a node definition, it does not work, all of following combination throw an error, the combinations are: include learn-tomcat::tomcat include learn-tomcat include tomcat include ::tomcat And error...

Puppet configuration for multiple classes in a module

puppet
I'd like to use and configure the puppet-nginx module, although this is a general question about Puppet configuration. Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] } class nginx-setup { class { 'nginx': } } include nginx-setup Works great! Now, if I follow the docs for configuration...

Can a custom Ruby function defined in one Puppet module be called from a .pp file in another module?

ruby,puppet
I have a custom function that I need to call (server-side) from at least two different puppet modules. The calls are to be made in Puppet DSL defined types, not Ruby-based custom types and providers. I know that if I put the definition in a .rb file in the "lib\puppet\parser\functions"...

write puppet config to clone github repo

windows,git,github,puppet,git-clone
PuppetMaster on Linux target = Windows Server I've written a Puppet module to install Git on Windows Is it possible to write a Puppet config to clone a GitHub repo using purely declarative language ( i.e. without a script written in Ruby or other lang ) ? This is a...

How can I avoid “write everything twice” in my hiera data?

puppet,hiera
Is there a better way to format my hiera data? I want to avoid the "write everything twice" problem. Here is what I have now: [[email protected] ~]# cat example.yaml --- controller_ips: - 10.0.0.51 - 10.0.0.52 - 10.0.0.53 controller::horizon_cache_server_ip: - 10.0.0.51:11211 - 10.0.0.52:11211 - 10.0.0.53:11211 I was wondering if there is...

hiera-eyaml undefined method `empty?'

yaml,puppet,hiera
I would like to store my node config in a .eyaml file. "hieradata/node/client.puppetmaster.local.eyaml" --- ntp::restrict: - ntp::autoupdate: false ntp::enable: true ntp::servers: - 0.pool.ntp.org - 1.pool.ntp.org - 2.pool.ntp.org - 3.pool.ntp.org but when I try to read a parameter with hiera ntp::servers ::fqdn=puppet.puppetmaster.local I get this error Messages /var/lib/gems/1.9.1/gems/hiera-eyaml-2.0.7/lib/hiera/backend/eyaml_backend.rb:39:in `block in lookup':...

Unable to set install directory for Python 3 using Puppet

python,puppet
I have inherited a bunch of Puppet scripts and am in the process of updating them. One of my scripts is for installing Python. I want to install it to C:/bin/Python34. However, every time I run the Puppet script I have, it gets installed to C:/Python34. If I run the...

“puppet resource user” shows all users

puppet
If I run puppet resource user on a puppet node, it lists all users defined on the machine (from /etc/password ). All users have ensure => 'present' attribute. Shouldn't it list only the users in the classes that apply to this node ?

Puppet/Ruby: How to use a ruby variable in a bash line?

ruby,bash,centos,puppet
I have a Nagios NRPE module in my Puppet environment. In the nrpe.cfg template I've configured some if statements in order to set specific checks to specific hosts. Example: <% if @hostname =~ /rs\d+/ -%> command[check_smtp]=/usr/lib64/nagios/plugins/check_smtp -H rs01.company.com -p 25 -e rs01.company.com <% end -%> Meaning: If hostname starts with...

Using hiera to set class parameters?

puppet,hiera
I am trying to figure out how to use hiera for setting the values for class parameters. I am testing things out with two simple classes: testhiera and testhiera2 Here are those classes: [[email protected] modules]# cat testhiera/manifests/init.pp class testhiera ( $haproxy_cert_content = 'unknown' , ) { notify {"cert is $haproxy_cert_content":}...

Vagrant Remote Box Setup

vagrant,chef,puppet,ansible
I have a requirement to setup VM boxes across multiple host machines and this has to be initiated from a single master host. To elaborate bit more, I will have VM templates with different configurations (created as say a VgrantFile) and the master host should initiate connection to the child...

Using Ruby to parse and write Puppet node definitions

ruby,puppet
I am writing a helper API in Ruby to automatically create and manipulate node definitions. My code is working; it can read and write the node defs successfully, however, it is a bit clunky. Ruby is not my main language, so I'm sure there is a cleaner, and more rubyesque...

Puppetelabs Vagrant Box password not working

vagrant,puppet
I'm trying to bring up a Puppetlabs vagrant box and the password is not working. Tried 'vagrant' and 'puppet'. Anyone get these working?

Puppet + Jenkins: how to invoke top-level Maven target

maven,jenkins,puppet
I'm trying to set up a Jenkins' job on a virtual machine using Puppet, having this virtual machine as agent and another one as master in Puppet. What I want to do is to make Puppet download and install Jenkins and all the necessary packages to do the job, set...

Puppet fact, list software Windows

windows,puppet,facter
I'm new to puppet and ruby, and just tried to write custom fact but ... Having the following issue Facter.add("vsphere_installed") do confine :operatingsystem => :windows setcode do if Facter::Util::Resolution.exec('c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "Get-WmiObject -Class Win32_Product | Select-Object -DisplayName | ? {$_.DisplayName -Match "vsphere"}"') = true result = "vSphere...

Given an array of hostnames, how can I generate a set of files based on those hostnames in puppet

puppet
I am not sure there is a way to even do this in puppet, but here is what I am trying to do. Given this skeletal puppet class definition ... class make_files ( $rabbit_servers = ['rabbit-1','rabbit-2'], $mongo_servers = ['mongo-1','mongo-2'], ) { ... } ... generate the files ... # pwd...

how to use define resource in init.pp or node.pp when define resource in individual file

class,puppet,define
How can I define some resource in other *.pp and how to use in init.pp ? I wrote a module to test define like this : vsftpd ├── files │ ├── test │ │ ├── 1.txt │ │ ├── 2.txt │ │ ├── 3.txt │ │ └── 4.txt │ └──...

How do I turn a hash to a string in Puppet DSL?

ruby,puppet
I have a hash of hashes that I need to embed in an exec resource command. My thought was to serialize the hash to a string and interpolate it into the exec call. The exec call will be executing ruby code via ruby -e 'ruby code here'. Using irb, I...

Creating a /var/run folder for a PID file, disappears on reboot?

puppet,ubuntu-14.04
I'm creating a folder in /var/run which will house my service's PID file: file { 'service_pid_folder': path => '/var/run/myservice', ensure => directory, owner => $user, group => $group, } This runs without any problems. The strange thing is that when I reboot my machine and re-run puppet apply, it reruns...

Group nodes in hiera by hiera-defined fact

puppet,configuration-files,hiera
I have a hierachy like this: - "nodes/%{::certname}" - (what's here is my question) - common I'd like to assign a group to my nodes in their individual configuration in hiera, like this in nodes/hostname.yaml : --- group: alpha Now, I'd like to have a file alpha.yaml, where I state...

Adding Ruby Gems to my PuPHPet provisioner

rubygems,vagrant,puppet,puphpet
I'm new to Vagrant and Puppet so I'm using the excellent tool provided by PuPHPet (https://puphpet.com/). I'm putting together a fairly straight forward LAMP box. Everything is coming along swimmingly except I can't add Ruby Gems. I need to include sass and compass but I have no idea how and...

Puppet manifest to download java by passing cookies and no certificate

puppet
I am trying to prepare manifests to download java using Puppet. This is my manifest class java { $install_path ="/opt/softwares" $user_home="/home/vidyayug" exec { "download_java": command => "wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u4-b20/jdk-7u4-linux-x64.tar.gz" ", cwd => "$user_home/archives", path => [ "/usr/bin", "/bin"], require => Package["wget"], creates =>...

Run eval `ssh-agent -s` gives errors

ssh,exec,puppet,puppetlabs-apache
Trying to run the command eval `ssh-agent -s with the command option puppet which gives me these error: exec { 'eval' : command => "eval `ssh-agent -s`", } Gives me this error: Error: Validation of Exec[eval] failed: 'eval `ssh-agent -s`' is not qualified and no path was specified. Please qualify...

Replace import 'nodes/*.pp'?

puppet
For those of you who keep individual node files, what did you do (or what are you planning to do) to work around the elimination of the import command in puppet 4?

Am I using puppet contain correctly?

dependencies,puppet,contain
I am trying to create a dependancy relationship so that the phpwebserver profile is run before the silex_api profile. role: class roles::dev{ include profiles::phpwebserver include profiles::silex_api Class ['profiles::phpwebserver'] -> Class ['profiles::silex_api'] } silex_api profile: class profiles::silex_api{ class { '::silex' : package_version => '1.6.2', } class {'::composer' : command_name => 'composer.phar',...

Install mysql with puppet on vagrant vm

mysql,vagrant,puppet
I'm trying to install mysql server on a vagrant vm with puppet ,I've added this line on the Vagrant file config.vm.provision "puppet" in the same Vagrantfile folder I've created the manifests folder and inside it folder it's default.pp with this content class { '::mysql::server': root_password => 'root', remove_default_accounts => false,...

Puppet inline template with puppet:// in URL

puppet
In my Puppet module, I have something like this: file {'myfile': ensure => 'file', path => '/whatever/myfile', content => inline_template(file( "puppet:///modules/my_module/templates/${domain}/${::hostname}_myfile.erb", "puppet:///modules/my_module/templates/${domain}/myfile.erb" )) } And my spec looks like: require 'spec_helper' describe 'my_module' do context 'with defaults for all parameters' do it { should compile } end end If try...

PuPHPet vs Puppet?

vagrant,virtualbox,puppet,puphpet
I've been using PuPHPet to setup development / staging hosting environments and it's made for very simple and efficient deployments. However, I'm running into a situation where I need to provide much more detailed directives in various server conf files (i.e., Nginx and Apache configs, cron jobs, etc) and PuPHPet...

Access to the first element of a Foreman's yaml

ruby,templates,puppet,theforeman
Im trying to get one element from a yaml structure which come from Foreman, the yaml is like this: nodes: host1: ip: xxx.xxx.xxx cdir: bbb.bbb.bbb interface: aaa host2: ip: yyy.yyy.yyy cdir: bbb.bbb.bbb interface: aaa This yaml is declarated on a Foreman,and it uses in a template: <%= @nodes[0][name] %> IPaddr2::<%=...

Puppet does not honor 'require' modules

ruby,puppet
I have created a module to add a user as follows: user { 'test': ensure => 'present', comment => 'Test User', home => '/home/test', shell => '/bin/bash', managehome => 'true', gid => 'postgres', groups => 'users', password => '$1$PIp.c9J6$gdAyd76OhBk7n9asda80wm0', require => [ Package['rubygem-ruby-shadow'], Class['postgres'] ], } It requires the class...

Regex: What is the right regex to use in order to match all proxy servers?

ruby,bash,templates,puppet
I'm writing a puppet template for our proxies farms. We have data centers in Amsterdam, Singapore, NY etc.. The proxies in each geo-location are named accordingly, for example: Proxies in Singapore are named sgproxy01-10 , proxies in Amsterdam are named ams2proxy01-30, etc... While writing this template which will eventually affect...

puppet concat Duplicate declaration

puppet
I get the following error from one of my puppet modules: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Concat[/etc/auto.master] is already declared in file /etc/puppetlabs/puppet/environments/development/modules/autofs/manifests/mount.pp:16; cannot redeclare at /etc/puppetlabs/puppet/environments/development/modules/autofs/manifests/mount.pp:16 on node nbsrvadm-02v.diasemi.com I am quite new to puppet and no idea what I...

Can't figure out how to use puppet apt module

vagrant,puppet
I'm trying to provision debian box with vagrant using puppet. And I want to add postgresql repository to sources list using puppetlabs/apt module. However, whatever I try, I keep getting this error: ==> default: Syntax error at '{'; expected '}' at /etc/puppet/modules/apt/manifests/init.pp:18 on node packer-debian-7 This is what I have...

Error 'invalid parameter include_src' when provisionning RabbitMQ with Puppet on Vagrant

rabbitmq,vagrant,puppet,git-submodules
I am trying to install the RabbitMQ module on my virtual machine. I used : git submodule add https://github.com/puppetlabs/puppetlabs-rabbitmq.git and I installed every dependecy I could find the same way (which are, like listed in this answer : stdlib, epel, staging and erlang). I reduced my manifest to the bare...

puppet: set global timeout for exec

deployment,puppet
I have a puppet manifest with many operations in exec, here an example of two of them: Exec { path => "/bin" } exec { "apt_get_update": timeout => 0, command => "/usr/bin/apt-get update"; "dlmpi": timeout => 0, command => "wget http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.gz", cwd => "/usr/local"; } Is there a way to...

How to generate files based on puppet array contents?

puppet
I'd like to be able to create files based on the contents of an array. Here is what I have tried: class make_files ( $servers = ['server-1','server-2','server-3'], ) { file { $servers : path => '/tmp', content => $servers, } } ... but when I execute this like so ......

Puppet reboot in stages

linux,puppet,centos6
I need to do a two step installation of a CentOS6 host with puppet (currently using puppet apply) and got stuck. Not even sure it's currently possible today. Step 1, setup of base system e.g. setup hosts, ntp, mail and some driver stuff. reboot required Step 2, setup of a...

How do I automate the installation of hyperic with Puppet?

puppet,hyperic
I'm trying to automate the installation of Hyperic using puppet. However instead of prompting the user for inputs, I want to hard code the values into one of the .sh file... I'm having trouble trying to figure out what file should be edited?...

Whats the default password for puppet users?

vagrant,puppet
Say that I make a user resource... user { 'test': ensure => 'present', groups => 'some_group' } If you vagrant ssh into that machine, what would be the default password for test user -> su test?...

Vagrant: executable files are not executable

laravel,phpunit,puppet,laravel-5
I installed vagrant box using https://puphpet.com/ The problem is executable files are not executable: $ ls -la ./vendor/bin/phpunit -rwxrw-r-- 1 www-data www-data 138 Feb 6 11:07 ./vendor/bin/phpunit* I looked in my .vagrant\machines\default\virtualbox in project folder and found there: "mount_options":["dmode=775","fmode=764"]. But this file is generated automatically, so changing it is not...

Basic usage of modules in puppet with hiera

module,puppet,hiera
I want to use puppet to manage some servers. Even after reading dozens of documentation pages, it is not clear to me how to use modules and how to use them with hiera. As first experiment I wanted a user "admin" to be created on one node and found this...

vagrant puppetlabs-mysql Mysql_grant failed

vagrant,puppet,puppetlabs-mysql
I want to use vagrant, and I defined the following puppet file: http://pastebin.com/GfJK1ziS When vagrant tries to install the modules everything works as expected. But when it tries to configure mysql, it always get this error: Error: Validation of Mysql_grant[${username}@%/${db_name}.*] failed: name must match user and table parameters What can...

Can't find rbenv after puppet install

puppet,rbenv
I am using puppet to setup a ruby on rails server (14.04). The install seems to work fine but then I can't find rbenv or bundler and ruby -v reports the system ruby 1.9.3. Install plugin module puppet module install jdowning-rbenv pp file class rails-test_server { include ruby class {...

Puppet: Conditional exec using unless-option

windows,command-line,registry,puppet
Puppet version is 3.7 and OS is Windows 7. I am trying to create Puppet exec that would only execute if certain Windows registry value does not exist. I am trying to use code like this: exec { 'example': path => 'C:\Windows\System32', command => 'something', unless => 'reg query "HKEY_LOCAL_MACHINE\Software\My...

puppet kick and environment variable

linux,ubuntu,puppet
I have the following as puppet steps: file { '/etc/profile.d/spark_submit.sh' : content => "export SPARK_HOME=/var/lib/spark/spark\nexport PATH=\$PATH:\$SPARK_HOME/bin/\n", } -> file_line { 'spark_submit_bashrc': path => '/etc/bash.bashrc', line => "source /etc/profile.d/spark_submit.sh" } The files are correctly generated. The environment variables are present in the command line both as root and non-root. However, if...

Puppet conditional assignment and += operator

string,variables,scope,puppet
In puppet, I want to write a file with a string based on configuration in nodes.pp. nodes.pp defines the $sslClientCertConfig variable, which has a loadBalancerIp property. I want to create a configuration string, we'll call it $config, without repeating the string code. The configuration string should be either A: if...

Trying to use hiera with vagrant and puppet

debian,vagrant,puppet,hiera
So I am trying to use hiera to change how I set up the git user.name and user.email. on my vagrant box. I have this in my default.pp git::config { 'user.name': value => hiera("github_username"), } git::config { 'user.email': value => hiera("github_email"), } In the Vagrant file I have this (inside...