Articles of 木偶

如何从节点中的现有模块扩展文件定义?

我使用example42 mysql模块的旧版本,它定义了mysql.conf文件,但不包含它的内容。 Mmy的目标是只包含mysql模块,并在节点中添加一个内容定义。 class mysql { … file { "mysql.conf": path => "${mysql::params::configfile}", mode => "${mysql::params::configfile_mode}", owner => "${mysql::params::configfile_owner}", group => "${mysql::params::configfile_group}", ensure => present, require => Package["mysql"], notify => Service["mysql"], } … } node xyz { include mysql File["mysql.conf"] { content => template("mymodule/mysql.conf.erb")} } 上面的代码产生一个“只有子类可以覆盖参数” 将内容定义添加到现有文件定义的正确方法是什么?

使用puppet安装依赖包

我是puppet新手,为了学习它的过程,我创build了Puppet Master和Puppet Slave安装程序,并configuration了一个mysql模块在Puppet client上安装mysql。 以下是清单文件。 class mysql { package { ["mysql-server-5.5", "libaio1", "libdbd-mysql-perl", "libdbi-perl", "libhtml-template-perl", "libmysqlclient18", "mysql-client-5.5", "mysql-common", "mysql-server-core-5.5"]: ensure => present, allowcdrom => 'true', } } package资源包含mysql-server的所有依赖关系。 但是我得到了下面的错误。 Building dependency tree… Reading state information… The following extra packages will be installed: mysql-common The following NEW packages will be installed: libmysqlclient18 mysql-common 0 upgraded, 2 […]

木偶更新包到最新的次要版本?

例如,我已经安装了php-fpm: Name : php-fpm Arch : x86_64 Version : 5.4.16 Release : 23.el7_0.3 Size : 4.5 M Repo : installed From repo : updates Summary : PHP FastCGI Process Manager URL : http://www.php.net/ License : PHP and Zend and BSD 目标是让PHP保持最新的5.4版本。 目前我在清单中有这个: ensure => '5.4.16-23.el7_0.3', 这不会更新,如果新版本或释放出来,而我不希望它更新到5.5意外。 我已经尝试了以下内容: ensure => '5.4.16', ensure => '5.4', ensure => […]

木偶不会删除/ etc / fstab中的旧挂载项

我定义了一个简单的类,用于在主机上挂载一个nfs共享,如下所示(当前) class mounts { file { [ "/mnt/share", "/mnt/share/share1" ]: ensure => 'directory', } mount { '/mnt/share/share1': ensure => 'mounted', device => '192.168.122.1:/home/export', dump => '0', fstype => 'nfs', options => 'vers=3,defaults', pass => '0', require => File[ "/mnt/share", "/mnt/share/share1" ], } } 所以现在我在puppet客户端的/ etc / fstab中有一个入口 192.168.122.1:/home/export /mnt/share/share1 nfs vers=3,defaults 0 0 我的问题是,傀儡类是这样定义的(OLD) class […]

Puppet Ubuntu删除不再需要的软件包

教自己的傀儡。 使用Ubuntu 11.10 Puppet 2.7.1(直接从apt) 在单个节点上运行一些testing脚本( http://docs.puppetlabs.com/learning/manifests.html )。 我做了一个清单,安装并启动apache2包…都很好。 现在我想反过来,我做一个清除apache2包的清单。 这个成功完成,问题是puppet只能删除apache2包,并不是所有的apache2包带来的(我认为apache2.2-bin是主要的)…所以apache2服务仍然安装并运行在系统上。 如果我是用apt-get来做这件事的话,我只会做一个“apt-get autoremove”,但是我怎么能让puppet为我做这个?

木偶重复资源和虚拟资源

概观 我刚开始使用Puppet,一直无法索回。 问题 由于规范化,当我将两个类添加到具有相同依赖性的包的节点时,它将失败。 简单地说就是有重复的资源 – 在这种情况下是包libssl 。 注意:软件包被阻止以防止最新的软件包被安装。 题 最好的做法是什么? class ssh { package { 'openssh-server': ensure => installed, require => Package['libssl'], } package { 'libssl': ensure => installed, } } class apache { package { 'apache': ensure => installed, require => Package['libssl'], } package { 'libssl': ensure => installed, } } node server […]

木偶 – 复制几个文件到目录

我想从puppet:// urls复制一些文件到代理上的一个目录。 我不确定我在这里做错了什么,但是好像木偶不喜欢这样 file { '/etc/nginx/conf.d': path => '/etc/nginx/conf.d', ensure => directory, require => File['/etc/nginx/nginx.conf'], source => ['puppet:///modules/nginx/app1.conf', 'puppet:///modules/nginx/app2.conf'], sourceselect => all, } 这是我试图运行代理时得到的结果 错误:无法将临时文件/etc/nginx/conf.d.puppettmp_9046重命名为/etc/nginx/conf.d:是一个目录 如果我通过在模块中创build目录来改变一些东西,并将资源指向它们,它就可以工作 mkdir module/files/app1 module/files/app2 mv module/files/app1.conf module/files/app1 mv module/files/app2.conf module/files/app2 新的资源 file { '/etc/nginx/conf.d': path => '/etc/nginx/conf.d', ensure => directory, require => File['/etc/nginx/nginx.conf'], source => ['puppet:///modules/nginx/app1', 'puppet:///modules/nginx/app2'], sourceselect => all, […]

访问数组/哈希的事实

在第二部分中,您现在可以将数组/散列作为事实。 例如: os => { "name"=>"CentOS", "family"=>"RedHat", "release"=>{ "major"=>"7", "minor"=>"0", "full"=>"7.0.1406" } } 什么是从清单访问os=>release=>major的格式?

用于设置Web服务器的示例木偶清单

只是让我的双脚与木偶湿(到目前为止只是阅读),并希望有一些样品(现实生活)清单/食谱,build立一个典型的Web服务器,如Apache / MySQL / PHP等,以及基本的服务器硬化Ubuntu的)

迭代傀儡模板中的资源

我试图用puppet来pipe理我的/etc/hosts文件,但是我不喜欢内部的'host'types,如果可能的话我想使用我自己的模板。 因此,我定义了一个“主机”资源: # Basic hosts configuration class hosts { # Host resource define host ( $address, $names ) { } Network::Hosts::Host { before => File['/etc/hosts'] } # Configure hosts file file { "/etc/hosts": ensure => present, checksum => md5, owner => root, group => root, mode => 0644, content => template("network/hosts.erb"), } 在其他地方,我定义主机资源: network::hosts::host { […]