2014-07-01 28 views
1

我使用Puppet 3.4.0附帶的CentOS 6.5框。我有必要的依賴關係,stdlib和concat。這裏是我用來安裝Apache模塊的代碼:Puppet 3.6.2在首次運行時在CentOS 6.5上打破Puppetlabs,在第二次運行時安裝

class { 'apache': 
    default_mods  => false, 
    default_confd_files => false, 
} 

這在3.4.0上運行良好。然而,當我運行yum更新,像這樣:

exec { "yum_update": 
    command => "yum -y update", 
    path => "/usr/bin", 
    timeout => 0, 
    before => Package["httpd"] 
} 

它安裝木偶3.6.2,我得到一噸的錯誤,並且不會安裝的Apache ...

Stderr from the command: 

Warning: Config file /vagrant/hiera.yamlm not found, using Hiera defaults 
Error: /Stage[main]/Concat::Setup/File[/var/lib/puppet/concat/bin/concatfragments.sh]: Could not evaluate: undefined method `exist?' for Puppet::FileSystem:Module Could not retrieve file metadata for puppet:///modules/concat/concatfragments.sh: undefined method `exist?' for Puppet::FileSystem:Module 
Error: Could not back up /etc/httpd/conf/httpd.conf: Unsupported checksum type "md5" 
Error: Could not back up /etc/httpd/conf/httpd.conf: Unsupported checksum type "md5" 
Error: /Stage[main]/Apache/File[/etc/httpd/conf/httpd.conf]/content: change from {md5}27a5c8d9e75351b08b8ca1171e8a0bbd to {md5}87926a96450a8af968c3b0c9675b373c failed: Could not back up /etc/httpd/conf/httpd.conf: Unsupported checksum type "md5" 
Error: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/File[/var/lib/puppet/concat/_etc_httpd_conf_ports.conf/fragments]: Failed to generate additional resources using 'eval_generate': undefined method `exist?' for Puppet::FileSystem:Module 
Warning: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/Exec[concat_/etc/httpd/conf/ports.conf]: Skipping because of failed dependencies 
Error: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/Exec[concat_/etc/httpd/conf/ports.conf]: Failed to call refresh: Could not find command '/var/lib/puppet/concat/bin/concatfragments.sh' 
Error: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/Exec[concat_/etc/httpd/conf/ports.conf]: Could not find command '/var/lib/puppet/concat/bin/concatfragments.sh' 
Warning: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/File[/etc/httpd/conf/ports.conf]: Skipping because of failed dependencies 
Error: /Stage[main]/Apache/File[/etc/httpd/conf.d]: Failed to generate additional resources using 'eval_generate': undefined method `exist?' for Puppet::FileSystem:Module 
Warning: /Stage[main]/Apache::Service/Service[httpd]: Skipping because of failed dependencies 
Error: Report processor failed: undefined method `exist?' for Puppet::FileSystem:Module 

.. 。第一次。運行vagrant provision再次導致僅廢棄警告和Apache被安裝運行時,我的SSH協議。

我知道hiera東西不是什麼大不了的事,雖然我在流浪文件把--hiera_config /vagrant/hiera.yamlm所以我不知道爲什麼它仍然在那裏。

我試着用谷歌搜索了很多這些錯誤,我也看到了一些錯誤報告,但似乎沒有直接解決這個問題。當我看到大量這樣的錯誤時,我通常會認爲缺少依賴關係,但我無法弄清楚我可能在這裏錯過了什麼。非常感謝您的幫助!

+0

這發生在'vagrant'?是否有木偶大師參與? –

+0

不 - 我剛剛開始使用Vagrant/Puppet並在我的機器上本地運行所有內容。我使用的盒子是http://www.lyricalsoftware.com/downloads/centos65.box – Andy

回答

1

從Puppet內部更新Puppet是好的,但不要指望相同的代理進程在事後做任何有用的事情。

對於後臺進程,這通常需要重新啓動服務,並且如果由cron運行,您將在下一個時間間隔中獲得新的代理進程。

在(配置的早期階段)進行版本升級聽起來像一個糟糕的想法。

也許你可以在Puppet之前獨立運行yum update

+0

有趣,謝謝!我正在考慮將更新作爲最後一項任務。 – Andy

0

據我所知,我可以在一定程度上幫助你。 在這裏你可以與這個puppet清單中的apache2(httpd)在centos中。

在您的清單文件夾中創建2個.PP文件(init.pp,install.pp)與 開放init.pp文件納米,VI或VIM ...在init.pp下面寫

class httpd { 
    include httpd::install 
} 

之後打開install.pp文件並寫下腳本。按照site.pp

class httpd::install { 
    package { 'httpd': 
     ensure => installed, 
    } 

    service { 'httpd': 
     ensure => running, 
     hasrestart => true, 
     hasstatus => true, 
     require => Package['httpd'], 
    } 

    exec { "yum_update" : 
     command => "yum update", 
     path => "/usr/local/bin:/usr/bin", 
     timeout => 180, 
     before => Package['httpd'], 
    } 

運行以下命令:

node 'ur node here with fqdn' 
{ 
    include httpd 
} 

puppet agent --test運行。

相關問題