我正在build立一个IT基础设施来pipe理我公司的所有工作站。 我对Puppet和一个外部节点分类器感兴趣,但是我总是看到Puppet和Foreman是基于服务器的,有什么理由不使用Puppet和Foreman工作站? 用这种configurationpipe理大约1000个工作或更多是疯狂的? 谢谢
我已经写了下面的代码,如果交换不到位,这工作正常,但一旦交换被创build,如果脚本再次执行,它会导致错误。 我尝试使用onlyif添加条件,除非在下面的代码中注释,但他们似乎没有任何工作 class swap { exec { "create swap file": command => "dd if=/dev/zero of=/swapfile bs=1M count=1024", path => "/bin/", creates => "/swapfile", } exec { "makeswap": command => "mkswap /swapfile", path => "/sbin/", # condition so that the block is executed only if the swap is not place onlyif => "/sbin/swapon -s | /bin/grep […]
我有一个问题,只有在安装了其他模块/类的情况下,我才能使puppet运行命令。 我读定义函数可以做到这一点,但我不明白这一点。 示例我正在尝试做什么: 比方说,我有一个模块/类的SSH和模块/类的SSH密钥 ,然后我想只在SSH模块/类在节点中定义的SSH密钥运行命令。 我正在为NagiOS做这件事,以确保NagiOS只监视那些安装了它想要监视的模块的服务器。 PS:对不起,如果我解释得不好。
我的Windows虚拟机上的Puppet代理没有执行PowerShell脚本。 我用一个非常简单的脚本来testing它。 该脚本作为test.ps1存储在C驱动器上。 其内容如下: "$(Get-Date -format F)" | Out-File C:\z.txt -Encoding ASCII 当我手动从PowerShell控制台运行./test.ps1时,它工作正常,文件z.txt被创build。 但由于某种原因,伪装代理不运行这个。 我的site.pp的内容是: exec { "Run Script": command => 'C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Executionpolicy Unrestricted -File c:/test.ps1', logoutput => true, refreshonly => true, } 而虚拟机本身的“puppet agent -t”的输出是: C:\Users\Administrator>puppet agent -t Info: Retrieving pluginfacts Warning: Copying owner/mode/group from the source file on Windows is deprecated; use source_permissions […]
为了让我更容易地debugging我的提供者,我有时想在自己的ruby代码中使用'command'。 试图弄清楚如何是问题。 这就是我在提供者中使用它的方式: commands :wget => '/usr/bin/wget', :cp => '/bin/cp' 后来,我可以用简单的命令来运行命令: wget('http://example.com') 现在,我试着这样做: something = Puppet::Provider.commands({:wget => '/usr/bin/wget'}) something.wget('http://example.com') 但是,我得到这个: test.rb:15: undefined method `wget' for {:wget=>"/usr/bin/wget"}:Hash (NoMethodError) 我也试过运行: wget = Puppet::Provider::Command.new('wget', '/usr/bin/wget', Puppet::Util, Puppet::Util::Execution) puts Puppet::Util::Execution.execute(['wget','http://example.com'],{}) 但输出是空白的… 有任何想法吗?
在工头1.6.0上,可以轻松地将多个主机分配给一个configuration组(在Configure-> Puppet-> Config Groups菜单下)? 我已经有了一个相当不错的Web界面和锤子cli,但似乎无法find任何东西。
以前在ServerFault上,它显示了如何testing是否定义了一个资源: Puppet:testing是否定义了资源,或创build它 if defined(File["/tmp/foo"]) { alert("/tmp/foo is defined") } else { alert("/tmp/foo is not defined") } 我想testing一个虚拟资源是否被定义或存在,然后通过收集器实现它,但它似乎不工作在相同的语法。 create_resource('@package',hiera_hash('packages',{}),{}) if !defined(@Package['foo']) { alert('Hiera screwed up, critical virtual package is missing') } # Realize the critical packages Package<| groups == critical |> 这让我: Error: Could not parse for environment production: Virtual (@) can only be applied to […]
我们将在未来一周内将RHEL 6.5机器升级到RHEL 6.6。 我知道如何使用Puppet创build回购站,但是不是只使用exec来运行yum -y update ,有没有办法告诉Puppet将操作系统带到(或保持)某个版本? 就像说明应该改变系统以达到或保持以下标准: operatingsystem => RedHat operatingsystemmajrelease => 6 operatingsystemrelease => 6.6
操作系统安装后,我已经安装了自动运行puppet的皮匠。 它工作正常,除了需要一段时间傀儡安装所有的软件包。 这仍然是一个testing阶段,所以总共只有15个包。 我的网站.pp看起来像这样: node server1 { include myrepo include bacula include vsftpd } myrepo只是将存储库文件复制到客户端服务器。 bacula列出了要安装的11个软件包,而vsftpd只有1个软件包。 安装操作系统(Suse)后,版本库文件被复制,安装了vsftpd,但客户端服务器上只安装了2个bacula软件包。 所有的bacula包装都已经安装好了,我只能等了半个小时左右。 木偶日志是空的。 如果我手动运行木偶,软件包的安装将运行平稳和快速。 什么可能是延误的原因?
我想签出几个SVN项目,我需要能够为每个分支或中继select目录名称。 现在我想检查名为svn_name的SVN项目在文件夹service_dir和该文件夹我想要创build一个树干文件夹和分支文件夹与所有分支。 — SVN文件夹 ——–分行 ————— branch1_name ————— branch2_name ——- trunk_name 我有我的散列结构如下 $hash = { 'svn_name' => { service_dir => 'directory_name', branch => [ { branch => '0.1', branch_dir => 'branch1_name'}, { branch => '0.2', branch_dir => 'branch2_name'} ], trunk => { service_dir => 'trunk_name'}, } } 现在我使用散列和我定义的typescreate_resources来创build必要的文件夹并检出工作副本。 问题是我无法迭代我的分支数组,我不知道如何访问哈希值内的值。 define test ( $service_dir, $branch, $trunk […]