Articles of puppet

使用Puppetpipe理OpenStack安装设置dnsmasq_config_file

我们的OpenStack安装与Puppet一起推出。 我们使用优秀的puppetlabs-openstack模块。 由于周转缓慢,我们仍然坚持版本5.0.2 ,现在我们不能迁移到一个较新的版本。 所以这个问题与OpenStack 2014.2.2有关。 我们当前的networking设置(GRE-tunneled)迫使我们通过DHCP向计算节点上的访客虚拟机宣布1454的MTU。 我们很清楚,我们可以通过在/etc/neutron/dnsmasq-neutron.conf提供相关的configuration并在/etc/neutron/dnsmasq-neutron.conf指定。 现在的问题是,我们缺乏适当的木偶知识configuration这些参数“木偶路”。 当前的configuration如下所示: (1)我们使用文件资源在我们单个networking节点上的相应位置创builddnsmasq-neutron.conf文件。 这显然工作得很好,我相信我们可以保持这种方式。 file { 'dnsmasq-neutron.conf': name => '/etc/neutron/dnsmasq-neutron.conf', mode => '0644', owner => 'root', group => 'neutron', content => template('/etc/puppet/manifests/neutron/dnsmasq-neutron.erb') } (2)目前我们使用下面这个非常糟糕的方式将configuration行注入到dhcp_agent.ini文件中。 exec { 'dnsmasq_config-file': command => '/usr/bin/echo "dnsmasq_config_file=/etc/neutron/dnsmasq-neutron.conf" >> /etc/neutron/dhcp_agent.ini && /usr/sbin/service neutron-dhcp-agent restart', user => 'root', } 我们的第一个猜测是使用没有按预期工作的Augeas。 而且我们知道必须有一种方法来设置干净的Puppetpipe理方式的dnsmasq_config_file属性。 实际上有一个class neutron::agents::dhcp的参数叫做dnsmasq_config_file ,默认是undefined。 问题是: […]

与多个NFS在同一台服务器上安装的木偶

我在同一台服务器上有几个NFS挂载点,但有不同的目录。 例如: xxxx:/stats /data/stats xxxx:/scratch /data/scratch xxxx:/ops /data/ops 但是,当我尝试运行木偶,它添加以下到我的fstab。 (错误的安装分配) xxxx:/scratch /data/stats nfs defaults,nodev,nosharecache 0 0 xxxx:/scratch /data/ops nfs defaults,nodev,nosharecache 0 0 xxxx:/scratch /data/scratch nfs defaults,nodev,nosharecache 0 0 它使用所有安装分区上的最后一个安装选项。 所以我做了一些研究,发现了以下的错误。 https://tickets.puppetlabs.com/browse/DOCUMENT-242 然后添加nosharecache选项,但仍然没有运气。 这是我的木偶代码 class profile::mounts::stats { # Hiera lookups $location = hiera('profile::mounts::stats::location') $location2 = hiera('profile::mounts::stats::location2') tag 'new_mount' file { '/data/stats': ensure => directory, owner => […]

用NGINX卸载木偶,403禁止错误

我目前正试图卸载一些文件服务木偶使用NGINX(如显示在这里http://www.masterzen.fr/2010/03/21/more-puppet-offloading/ ),但是我一直有403错误在文件和目录检索。 有一件事解决了这个问题,在我的auth.conf中的第一个定义中添加了“auth any”,但据我所知,将完全禁用客户端validation? 那么我是不是通过NGINX传递所有需要的头文件还是有其他的错误? configuration文件如下。 /etc/puppet/puppet.conf [main] logdir = /var/log/puppet rundir = /var/run/puppet ssldir = $vardir/ssl server = Puppet.xServ pluginsync=false external_nodes = /usr/sbin/external_nodes node_terminus = exec [master] certname = puppet.xserv [agent] classfile = $vardir/classes.txt localconfig = $vardir/localconfig /etc/puppet/auth.conf path ~ ^/catalog/([^/]+)$ method find allow localhost allow $1 path /certificate_revocation_list/ca method find allow * path […]

木偶甚至在root时也不能访问MySQL的元信息

运行时: $ sudo puppetd –verbose –no-daemonize -o 我遇到如下错误: err: //webserver/Mysql::Rights[Setup SW Database]/Mysql_user[scraperwiki@localhost]: Failed to retrieve current state of resource: Execution of '/usr/bin/mysql mysql -NBe select '1' from user where CONCAT(user, '@', host) = 'scraperwiki@localhost'' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) notice: //webserver/Mysql::Rights[Setup SW Database]/Mysql_grant[scraperwiki@localhost/scraperwiki_live]: Dependency mysql_user[scraperwiki@localhost] has 1 […]

如何更改由Puppetconfiguration的服务器上的计算机名称

我是Puppet的新手,我试图让Puppet在从AWS中的Cloud Formation Template启动后configurationEC2实例。 问题是,所有从云形成模板开始的节点都具有相同的名称(新节点派生自AMI的名称)。 我很想find一个方法来让节点启动时傀儡重命名节点。 (虽然,据我所知,计算机名称更改需要重新启动,一个单独的问题…) 如果你能指出我的一些文件,可以帮助我解决这个问题,或者如果你有任何想法,将是伟大的。 我的最终目标是让每个EC2都以唯一的名称开始,以便我可以使用New Relic服务器监视来报告不同的服务器。 我最终需要为Linux和Windows Server 2008 R2实现这一点,但是我想我已经弄清楚了Linux的一面。 更新: 我和New Relic谈了这个问题,他们证实New Relic目前没有办法用机器名称以外的东西来报告。 所以从New Relic方面来解决这个问题并不是一个好的select。 我也想避免在创build机器后不得不更改机器名称,因为我不想在机器启动后重新启动机器。 我的理想select是使Cloud Formation能够从AMI生成新的EC2实例,但在创build过程中使用特定的计算机名称(例如将计算机名称设置为实例Id或其他名称)。

puppet环境variables$ PATH未设置

我正试图在Debian 6.0上安装一个带有puppet 2.7的模块,并且不断收到这个错误: returns: change from notrun to 0 failed: Could not find command 'tar' 这是相关的代码: file {"zookeeper-tarball": path => "${zookeeper_parent_dir}/${tarball}", source => "puppet:///modules/zookeeper/${tarball}", ensure => file, } exec { "zookeeper_untar": path => "${zookeeper_parent_dir}", command => "tar -xzf ${zookeeper_parent_dir}/${tarball}", cwd => "${zookeeper_parent_dir}", user => "$user", require => File["zookeeper-tarball"], creates => "${zookeeper_parent_dir}/zookeeper-${zookeeper_version}", } 在manifests/site.pp我有这样的: Exec { […]

木偶 – 如何安装不在默认包中的git 1.8.x

你将如何使用puppet自动安装特定版本的git? apt-get update && apt-get install git-core在我的12.04 ubuntu服务器上apt-get update && apt-get install git-core导致git版本为1.7.9。 我必须有1.7.10或更新。 有两个选项,我可以看到。 1.添加ppa 2.从源代码安装git 我认为从源代码编译将更容易,所以这是我正在尝试。 我试过使用puppetlabs / apt模块来安装git-core ppa,但是我的git版本在puppet运行后仍然是1.7.9。 root@gitlab:~# puppet module list /etc/puppet/modules ├── puppetlabs-apt (v1.2.0) ├── puppetlabs-git (v0.0.3) ├── puppetlabs-stdlib (v4.1.0) └── ruby (???) root@gitlab:~# cat /etc/puppet/manifests/git.pp class { 'apt': } apt::ppa { 'ppa:git-core/ppa': before => Exec['apt-get update'], } exec{'apt-get […]

排查木偶安装顺序

我的木偶代理最初运行失败,然后在第二次运行成功。 我明白,这可能与我的执行顺序有关,并且在执行过程中稍后会添加一个依赖项。 但是,我无法弄清楚缺less的依赖关系是什么,是否有任何疑难解答的做法,可以帮助我弄清楚? 这是我的错误: CXX(target) Release/obj.target/contextify/src/contextify.o make: g++: Command not found make: *** [Release/obj.target/contextify/src/contextify.o] Error 127 ..当我的木偶类试图安装一个NPM模块时发生: /usr/bin/node /usr/bin/npm install –global log.io –user 'monitor' – 其他可能相关的要点 我明白失败与g ++二进制文件有关,但是我看不到这个失败之后的任何目录能够安装g ++(我假设我应该find一个'gcc'或'make'包,或者是一个包含那些作为依赖) 我的Vagranttesting环境中不会发生此故障,但仅在尝试设置AWS实例时才会发生 运行CentOS 6.4 感谢您的帮助!

傀儡服务不停止服务(iptables)

我正在尝试使用puppet master 3.1.1来pipe理各种服务器上的iptables。 我的本地木偶代理是2.7.19 ,服务器OS是CentOS 5.4 。 /etc/puppet/modules/mycompany/manifests/config/iptables.pp class base::iptables ( { { $identity_environment = $::identity_environment } if ($identity_environment == "production") { $start_iptables = "true" $run_iptables = "running" } elsif ($identity_environment == "development") { $start_iptables = "false" $run_iptables = "stopped" } if ($run_iptables != "stopped") { file { "/etc/sysconfig/iptables": ensure => file, owner => root, […]

在Vagrant环境中安装Grunt的问题

我试图在Ubuntu Trusty 64bit Vagrant环境中安装node.js,npm和Grunt.js,并遇到一些问题。 这是我的木偶清单: init.pp – class grunt::install { exec { 'apt_update': command => 'apt-get update', path => '/usr/bin' } package { [ 'curl', 'python-software-properties', 'ruby1.9.3' ]: ensure => present, require => Exec['apt_update'] } # Get node exec { 'add-node-repo': command => '/usr/bin/add-apt-repository ppa:chris-lea/node.js && /usr/bin/apt-get update', require => Package['python-software-properties'] } package { 'nodejs': […]