puppet

Unable to use $facts as a hash in the puppet manifest

醉酒当歌 提交于 2019-12-12 05:09:33
问题 Here is the manifest code which is failing: each( $facts['partitions'] ) |$name, $device| { notice( "${facts['hostname']} has device ${name} with size ${device['size']}" ) } The error: [manifests]$puppet apply /vagrant/manifests/mountpoints.pp Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /vagrant/manifests/mountpoints.pp:1:7 on node siy Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /vagrant/manifests/mountpoints.pp:1:7 on node

Node specific settings in a puppet environment

时光怂恿深爱的人放手 提交于 2019-12-12 04:39:10
问题 I'm in the process of learning puppet and I'm running into what I assume is a pretty basic issue. For the purposes of keeping things simple, I'm using a puppet forge module rather than anything custom written. Here's what I'm using version wise: puppet server: 5.1.3 puppet agent: 5.3.2 puppetlabs-java: 2.1.0 When I install the puppetlabs-java module, I am using --modulepath /etc/puppetlabs/code/modules/ . I currently have my agent configured to point at my puppet server and an environment I

is it possible to Override manifest/class ordering from a profile or role?

风格不统一 提交于 2019-12-12 04:15:07
问题 I have a role that calls several profiles in order using contains and chaining like this: class role::buildserver { contain ::profile::<all the classes below> Class['::profile::chocolatey'] -> Class['::profile::jdk'] -> Class['::profile::googlechrome'] -> Class['::profile::jenkins_install'] } The chain works fine until I include the jenkins_install profile which uses the jenkins module. No matter what I do the jenkins module always gets called first. The module itself contains it's own

Shared Vagrant configuration across multiple projects

主宰稳场 提交于 2019-12-12 04:11:05
问题 I have a few services, each one living in its own Git repository. Each service is self-contained and runs independently from each other. I want them to run in the same VM. How do you use Vagrant to set up a shared development environment containing these services? (Please note that I want to avoid creating a Vagrantfile per repo.) 回答1: Create a custom cookbook/puppet manifest or shell provisioner that will checkout individual git repository and run the service. More details/configuration

Puppet error : could not retrieve catalog from remote server: SSL_connect returned=1 errno=0

人盡茶涼 提交于 2019-12-12 02:11:23
问题 I am trying to setup puppet master and puppet agent in aws ec2 instances-linux ami. when i run my puppet agent to generate the certificate for the master to sign i encounter the below error. Puppet Master: [root@ip-10-**-*-*** /]# sudo yum install puppet-server [root@ip-10-**-*-*** /] sudo service puppetmaster start Starting puppetmaster: [ OK ] Puppet Agent: [root@ip-10-**-*-*** /]# sudo yum install puppet [root@ip-10-**-*-*** /] File excerpt /etc/puppet/puppet.conf [main] server = hostname

run Exec only if another Exec ran

≯℡__Kan透↙ 提交于 2019-12-12 02:09:08
问题 how can I configure a Exec to run only if another Exec ran? I have a manifest like this: file { $target: ensure => directory } exec { "unzip foobar.zip -C ${target}": unless => "file ${target}/some-file-form-archive" } exec { "chown -R $user ${target}": onlyif => ??? } I would like the chown to run only if unzip foobar.zip ran. Of course I could start checking whether some-file-from-archive is already owned by $user , but somehow it does not seem right. 回答1: There's an answer here already:

Missing resources when running “puppet agent --noop”

六眼飞鱼酱① 提交于 2019-12-12 02:06:38
问题 I may have misunderstood how " puppet agent --noop " works: In the definition of a class I set the existence of a file and I set it's user&group ownership and this is what I have when I un " puppet agent --noop " : If the file doesn't exist, " puppet agent --noop " works fine If the file exists but user or group doesn't exist, then " puppet agent --noop " fails complaining about the missing user or group. If I simply run " puppet agent " (without " --noop ") it works fine: Doesn't matter if

puppet not upgrading in Ubuntu 12.04

主宰稳场 提交于 2019-12-12 01:43:38
问题 I installed puppet in Ubuntu 12.04 from apt respository. Current version is 2.7.11 I am trying to upgrade to puppet 3 by following wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb sudo dpkg -i puppetlabs-release-precise.deb sudo apt-get update But this is what the result Reading package lists... Done Building dependency tree Reading state information... Done puppet is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded. It's always staying

How to secure copy using Puppet?

随声附和 提交于 2019-12-12 01:34:42
问题 I have been trying to copy a directory from my master to different hosts. I have a script that checks out a code and puts it in certain directory. My script looks like below. #!/bin/bash export CVSROOT=:pserver:anonymous@server101:2401/cvs/PXI/ cvs checkout -r 2_a Jcode mv Jcode /etc/example/puppettest/ Now I want to copy this Jcode to my hosts. 回答1: Assuming you are trying to copy /etc/example/puppettest to your nodes you would have to create a mount point in ${configdir}/fileserver.conf

Cannot create files inside defined type

牧云@^-^@ 提交于 2019-12-11 23:11:53
问题 I want to create files inside a defined type. I have tried it several ways but couldn't solve the issue. Let me explain you my case. I am creating some files using temapltes and I could do that operation perfectly. I am using below ruby function to gather filename, location kind of data require 'rexml/document' include REXML module Puppet::Parser::Functions newfunction(:getConfigFileDetails, :type => :rvalue ) do |args| fileDetails= [] doc = REXML::Document.new args[0] doc.elements.each("node