puppet

Puppet “require” not working as expected

拥有回忆 提交于 2019-12-25 06:04:04
问题 I have the following two manifests: class profile::maven inherits profile::base { # Hiera $version = hiera('profile::maven::version', '3.2.1') $settings = hiera_hash('profile::maven::settings', undef) $environments = hiera_hash('profile::maven::environments', undef) # Dependencies require '::profile::java' # Modules class { '::maven::maven': version => $version, } if ($settings) { create_resources('::maven::settings', $settings) } if ($environments) { create_resources('::maven::environments',

puppet creating relationship between file, class and define

为君一笑 提交于 2019-12-24 23:34:13
问题 I want to create relationship between file, class and define.... Please check the below code.... The problem I am facing is, even if there is no change in deploy.cfg file, class and nexus::artifact always runs... class and nexus::artifact should execute only if it detects a change in file I know that we need to make use of subscribe and refreshonly=true. But I have no idea where to put this... file { 'deploy.cfg': ensure => file, path => '/home/deploy/deploy.cfg', mode => '0644', owner =>

How to pass node specific information to class in puppet?

泄露秘密 提交于 2019-12-24 18:23:42
问题 I want to pass node specific information to a class, which then could evaluate it for specific purposes. Actually this question consists of three parts. Say, I have the following node: node 'devbox' { $serverType = 'something' include someClass someOtherClass { 'someOtherClass': par1 => 'value', } targetClass { 'nodeInformationShouldGoHere': } } Inside targetClass, I want to evaluate if serverType, someClass or someOtherClass is set (e.g. with if-else). My questions now are: Is setting and

validate_cmd in Puppet: supporting older versions

点点圈 提交于 2019-12-24 10:39:29
问题 I have the following Puppet code: file { "/etc/sudoers.d/${name}": content => template('sudo/sudoers.erb'), owner => 'root', group => 'root' mode => '0440', validate_cmd => '/usr/sbin/visudo -c -f %', } However, validate_cmd was only added in Puppet > 3.5, and I have to support some systems running 3.2 and older. Is there some clever way of monkey-patching this into older versions of Puppet, or should I just resign to using the puppetlabs-stdlib validate_cmd statement? Which does a similar

Log file to view last changes made by puppet agent

懵懂的女人 提交于 2019-12-24 08:23:41
问题 If you do puppet agent -t for when agent runs in background, where is the log file where we can see the changes, other than on puppet dashboard. I viewed puppet.conf and in main section I see logdir , but no log file is created on that location. 回答1: From the docs: When running as a service, Puppet agent logs messages to syslog. Your syslog configuration dictates where these messages will be saved, but the default location is /var/log/messages on Linux, /var/log/system.log on Mac OS X, and

Executing bash script from puppet fails

夙愿已清 提交于 2019-12-24 07:06:09
问题 I have been trying to copy and execute a shell script residing in puppet master machine to my puppet agent This is my code [root@ip-****** manifests]# cat site.pp class mymodule::myklass{ file {'my_bash_script': ensure => 'file', source => '/etc/puppet/modules/mymodule/my_bash_script.sh', path => '/home/ec2-user/my_bash_script.sh', owner => 'root', mode => '755', notify => Exec['run_my_script'], } exec { 'run_my_script': command => '/home/ec2-user/my_bash_script.sh', } } include mymodule:

How to install a puppet file from a local repo with puppet module install

夙愿已清 提交于 2019-12-24 00:23:38
问题 another question around this problem. is there a way the the puppet module install tool to install from a local repo I already downloaded to the disk? 回答1: Unfortunately, no. You can read the manual page for the puppet module face here. While there seems to be an option to specify private forges when installing modules, Puppetlabs' Forge API are not public, and Puppetlabs itself doesn't support any public or private application other than their Forge to build private repositories. As an

puppet adding array elements in a loop

一笑奈何 提交于 2019-12-23 16:27:15
问题 I want something like this: $ssl_domains = ['dev.mydomain.com'] ['admin', 'api', 'web'].each |$site| { ['tom', 'jeff', 'harry'].each |$developer| { $ssl_domains << "$site.$developer.dev.mydomain.com" } } letsencrypt::certonly { 'dev-cert': domains => $ssl_domains, plugin => 'apache', manage_cron => true, } now it is impossible because of Puppet's variable scoping. How can I collect some variables in an array through nested loops? 回答1: You were close with your attempt, but you were using the

Vagrant with Librarian-Puppet Broken

二次信任 提交于 2019-12-23 10:45:29
问题 I'm having problems with provisioning new Vagrant instances. I've used the exact same configuration before without problems. I cannot figure out what's causing the problems when it used to work. Vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com

Vagrant with Librarian-Puppet Broken

痴心易碎 提交于 2019-12-23 10:43:19
问题 I'm having problems with provisioning new Vagrant instances. I've used the exact same configuration before without problems. I cannot figure out what's causing the problems when it used to work. Vagrantfile # -*- mode: ruby -*- # vi: set ft=ruby : # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "precise64" config.vm.box_url = "http://files.vagrantup.com