Articles of 木偶

如何在puppet中创build节点组

我正在QA环境中设置Puppet。 我创build了一些运行良好的清单和设置类。 我知道节点定义,并已成功创build清单,使用节点定义应用于less数节点上。 但是我还没有弄清楚如何将一组节点放到一个组中,这样我就可以使用组名,而不必在节点定义中指定每个节点。 这个 puppetlabs文件的URL似乎只是在Puppet Enterprise版本中讨论组创build。 如何在社区版本中创build组? 这是我目前的nodes.pp文件。 [root@puppet modules]# cat /etc/puppet/manifests/nodes.pp node "saturn.qa1.example.com", "mercury.qa1.example.com" { include qa1check }

是否有可能执行“除非”条款作为特定用户?

背景: 我正在升级我们的lxc傀儡模块以支持新兴的无特权LXC技术。 创build容器的代码将被执行,除非以下testing如果容器存在成功: lxc-info -n ${lxcname} >/dev/null 。 如果以root身份执行, lxc-info检查根容器中的名称。 如果由普通用户调用,它将检查为该特定用户存储的非特权容器的列表。 我想创build一个资源沿线(代码尚未testing): #Creation of the container ${name} exec { "lxc-create of ${hostname}": command => "lxc-create -t download -n ${name} — -d ubuntu -r ${release} -a amd64", user => $user, group => $group, timeout => 0, unless => "lxc-info -n ${name}" #Should be executed as user […]

避免在Puppet中使用导出资源时声明if regex语句

避免手动添加主机 class::define { [ 'host1.domain', 'host2.domain' ]: attribute => 'hello', attribute2 => 'world' } class::define { [ 'host3.domaintwo', 'host4.domaintwo' ]: attribute => 'apple', attribute2 => 'orange' } 通过使用导出的资源: if $fqdn =~ /^.*\.domain$/ { @@class::define { $fqdn: attribute => 'hello', attribute2 => 'world', tag => 'test' } } if $fqdn =~ /^.*\.domaintwo$/ { @@class::define { $fqdn: […]

数据中心事实在Puppet

在hiera的例子中,我已经看到人们把一个叫做dc或者datacenter的事实放在他们的层次结构中。 但是,如何确定数据中心的实际情况还不清楚。 有什么已经存在的相同? 还是每个人都写自己的习惯事实? 希望能对此有所帮助。

木偶:如果angular色匹配,层次结构如何工作?

我想了解Puppet层次结构如何工作。 我的Puppet服务器的hiera.yaml如下所示: [root@puppet puppet]# cat hiera.yaml :backends: – yaml :yaml: :datadir: '/etc/puppet/hieradata/%{::environment}' :hierarchy: – fqdns/%{::fqdn} – roles/%{::role} – domains/%{::domain} – common 我想要所有的服务器都有模块,所以我把它们放在common.yaml文件中,每个role.yaml文件中都包含了特定于angular色的模块。 当匹配Puppet中angular色的服务器启动时,首先加载role.yaml文件中的模块。 我的问题是:一旦一台服务器与一个angular色匹配…它会停在那里? 或者它会继续在层次结构中,并加载common.yaml下的模块? 如果不是,我怎样才能确保这是如何performance? 编辑#1:这是一个role.yaml文件的例子: [root@puppet roles]# cat dataorigin.yaml classes: – workspace jdk_enable: true jdk_ver: 1.6.0_41 component_ver: 1-1-5-17 tomcat_enable: true debug_mode: true fstab_params: mount1: mnt_src: "isilonnj01.eyedcny.local:/ifs/Peer39/do_share" mnt_dest: "/doshare" mnt_opts: "tcp,hard,intr,noatime" mnt_dest_parent: "" 服务器的site.pp如下所示: […]

傀儡主日志未在configuration的位置创build

下面是我的puppet master puppet.conf文件 [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter certname = puppet dns_alt_names = puppet [master] # These are needed when the puppetmaster is run by passenger # and can safely be removed if webrick is used. ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY 虽然我已经在configuration中指定了logdir为/var/log/puppet ,但在/var/log/syslog中生成了puppet主日志 任何解决scheme

鉴别傀儡代理(与主人)从傀儡运行?

是否有可能区分从puppet apply运行的puppet agent ? 有没有一个方便的环境variables或事实来检查我的清单?

将文件夹及其子文件夹从puppet master复制到代理程序

我试图将位于puppet master的文件夹/vagrant/scripts及其子文件夹复制到代理中。 我在init.pp使用以下configuration: file { '/home/vagrant/scripts': ensure => 'file', source => 'puppet:///modules/ycsb/scripts', path => '/home/vagrant/YCSB/scripts', owner => 'vagrant', group => 'vagrant', mode => '0744', # Use 0700 if it is sensitive } 当我检查代理我可以看到/scripts文件夹,但没有其子文件夹。 任何想法为什么发生这种情况

木偶无法find模块的文件

我使用docker-compose示例创build了一个puppet服务器(5.0.0),并成功地启动了六个客户端(使用debian提供的puppet代理)。 虽然我可以提供原始内容的文件,例如 file { '/etc/systemd/timesyncd.conf': ensure => present, content => "[Time]\nNTP=time.xxx.net\n", notify => Service["systemd-timesyncd.service"] } 通过源提供文件不起作用: file { "/etc/default/grub": ensure => present, source => "puppet:///modules/debian-noquiet-grub/etc-default-grub", } 客户错误了 Error: /Stage[main]/Loudgrub/File[/etc/default/grub]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/debian-noquiet-grub/etc-default-grub 和服务器 2017-08-24 13:40:21,582 INFO [puppetserver] Puppet Not Found: Could not find file_metadata modules/debian-noquiet-grub/etc-default-grub 10.161.xxx.zzz […]

在RHEL和Ubuntu上通过Puppet安装Zend Server?

我正在通过示例学习Puppet并编写一些模块来pipe理我们当前的RHEL和Ubuntu服务器。 我第一次认真的尝试是一个Zend服务器模块。 由于木偶有一个Yumrepo,但没有Aptrepo资源,你将如何构build一个模块来添加回购和独立的方式安装软件包? 使用模块的人不必关心服务器运行哪个发行版。 另一件事。 我想在安装后让Puppet设置ZSpipe理员密码,但是找不到设置的位置。 任何想法?