它FreeBSD 9.1-RELEASE amd64
在这里。我从 ports 安装了 puppet,我的清单可能也使用了 ports 包。我对此很满意。现在这里有一个简单的清单:
root@ovh:/root # cat freebsd.pp
package { '*./editors/vim':
ensure => installed,
}
应用清单:
root@ovh:/root # puppet apply freebsd.pp
Notice: /Stage[main]//Package[*./editors/vim]/ensure: created
Notice: Finished catalog run in 22.54 seconds
执行简单的软件包检查需要 23 秒,而实际上已经安装了?这正常吗?我是 Puppet 的新手,所以如果有人能解释一下这种简单检查的后台运行情况,我将不胜感激。也许有更快的方法来检查软件包是否已安装?
答案1
是的,因为你安装了一个新的包。再次运行它,创建应该会消失,而且速度会快一点。无论如何,Puppet 并不是很快。对于该包,它必须查询你的包管理器以查看它是否已安装,如果你不选择一个,它会尽力猜测它应该是什么,然后尝试一下,如果没有,请选择下一个最佳猜测。
答案2
添加调试开关后,我发现每次使用 pkg_add 时都会安装 vim。所以这个问题得到了回答。
[0;36mDebug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderRpm: file rpm does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderYum: file rpm does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderSun: file /usr/sbin/pkgrm does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderUrpmi: file urpmq does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist[0m
[0;36mDebug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not exist[0m
[0;36mDebug: Creating default schedules[0m
[0;36mDebug: Failed to load library 'selinux' for feature 'selinux'[0m
[0;36mDebug: Using settings: adding file resource 'client_datadir': 'File[/var/puppet/client_data]{:backup=>false, :mode=>"750", :path=>"/var/puppet/client_data", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Failed to load library 'shadow' for feature 'libshadow'[0m
[0;36mDebug: Puppet::Type::User::ProviderUseradd: file usermod does not exist[0m
[0;36mDebug: Puppet::Type::User::ProviderUser_role_add: file usermod does not exist[0m
[0;36mDebug: Puppet::Type::User::ProviderLdap: true value when expecting false[0m
[0;36mDebug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/uuidgen does not exist[0m
[0;36mDebug: Using settings: adding file resource 'certdir': 'File[/var/puppet/ssl/certs]{:owner=>"puppet", :backup=>false, :path=>"/var/puppet/ssl/certs", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'vardir': 'File[/var/puppet]{:backup=>false, :path=>"/var/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'requestdir': 'File[/var/puppet/ssl/certificate_requests]{:owner=>"puppet", :backup=>false, :path=>"/var/puppet/ssl/certificate_requests", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'rundir': 'File[/var/run/puppet]{:backup=>false, :mode=>"1777", :path=>"/var/run/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'plugindest': 'File[/var/puppet/lib]{:backup=>false, :path=>"/var/puppet/lib", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'statefile': 'File[/var/puppet/state/state.yaml]{:backup=>false, :mode=>"660", :path=>"/var/puppet/state/state.yaml", :ensure=>:file, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'hostprivkey': 'File[/var/puppet/ssl/private_keys/ovh.holms.lt.pem]{:owner=>"puppet", :backup=>false, :mode=>"600", :path=>"/var/puppet/ssl/private_keys/ovh.holms.lt.pem", :ensure=>:file, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'clientbucketdir': 'File[/var/puppet/clientbucket]{:backup=>false, :mode=>"750", :path=>"/var/puppet/clientbucket", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'statedir': 'File[/var/puppet/state]{:backup=>false, :mode=>"1755", :path=>"/var/puppet/state", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'lastrunfile': 'File[/var/puppet/state/last_run_summary.yaml]{:backup=>false, :mode=>"644", :path=>"/var/puppet/state/last_run_summary.yaml", :ensure=>:file, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'logdir': 'File[/var/puppet/log]{:owner=>"puppet", :group=>"puppet", :backup=>false, :mode=>"750", :path=>"/var/puppet/log", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'ssldir': 'File[/var/puppet/ssl]{:owner=>"puppet", :backup=>false, :mode=>"771", :path=>"/var/puppet/ssl", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'graphdir': 'File[/var/puppet/state/graphs]{:backup=>false, :path=>"/var/puppet/state/graphs", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'privatekeydir': 'File[/var/puppet/ssl/private_keys]{:owner=>"puppet", :backup=>false, :mode=>"750", :path=>"/var/puppet/ssl/private_keys", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'clientyamldir': 'File[/var/puppet/client_yaml]{:backup=>false, :mode=>"750", :path=>"/var/puppet/client_yaml", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'hostpubkey': 'File[/var/puppet/ssl/public_keys/ovh.holms.lt.pem]{:owner=>"puppet", :backup=>false, :mode=>"644", :path=>"/var/puppet/ssl/public_keys/ovh.holms.lt.pem", :ensure=>:file, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'lastrunreport': 'File[/var/puppet/state/last_run_report.yaml]{:backup=>false, :mode=>"640", :path=>"/var/puppet/state/last_run_report.yaml", :ensure=>:file, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'confdir': 'File[/usr/local/etc/puppet]{:backup=>false, :path=>"/usr/local/etc/puppet", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'publickeydir': 'File[/var/puppet/ssl/public_keys]{:owner=>"puppet", :backup=>false, :path=>"/var/puppet/ssl/public_keys", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Using settings: adding file resource 'privatedir': 'File[/var/puppet/ssl/private]{:owner=>"puppet", :backup=>false, :mode=>"750", :path=>"/var/puppet/ssl/private", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: /File[/var/puppet/ssl]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/ssl/private]: Autorequiring File[/var/puppet/ssl][0m
[0;36mDebug: /File[/var/puppet/ssl/certificate_requests]: Autorequiring File[/var/puppet/ssl][0m
[0;36mDebug: /File[/var/puppet/clientbucket]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/ssl/private_keys/ovh.holms.lt.pem]: Autorequiring File[/var/puppet/ssl/private_keys][0m
[0;36mDebug: /File[/var/puppet/ssl/certs]: Autorequiring File[/var/puppet/ssl][0m
[0;36mDebug: /File[/var/puppet/ssl/public_keys/ovh.holms.lt.pem]: Autorequiring File[/var/puppet/ssl/public_keys][0m
[0;36mDebug: /File[/var/puppet/state]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/ssl/public_keys]: Autorequiring File[/var/puppet/ssl][0m
[0;36mDebug: /File[/var/puppet/state/graphs]: Autorequiring File[/var/puppet/state][0m
[0;36mDebug: /File[/var/puppet/client_data]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/log]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/puppet/state][0m
[0;36mDebug: /File[/var/puppet/lib]: Autorequiring File[/var/puppet][0m
[0;36mDebug: /File[/var/puppet/state/state.yaml]: Autorequiring File[/var/puppet/state][0m
[0;36mDebug: /File[/var/puppet/state/last_run_report.yaml]: Autorequiring File[/var/puppet/state][0m
[0;36mDebug: /File[/var/puppet/ssl/private_keys]: Autorequiring File[/var/puppet/ssl][0m
[0;36mDebug: /File[/var/puppet/client_yaml]: Autorequiring File[/var/puppet][0m
[0;36mDebug: Finishing transaction 17233557220[0m
[0;36mDebug: Loaded state in 0.00 seconds[0m
[0;36mDebug: Loaded state in 0.00 seconds[0m
[0;32mInfo: Applying configuration version '1360078391'[0m
[0;36mDebug: /Schedule[daily]: Skipping device resources because running on a host[0m
[0;36mDebug: /Schedule[monthly]: Skipping device resources because running on a host[0m
[0;36mDebug: /Schedule[hourly]: Skipping device resources because running on a host[0m
[0;36mDebug: /Schedule[never]: Skipping device resources because running on a host[0m
[0;36mDebug: /Schedule[weekly]: Skipping device resources because running on a host[0m
[0;36mDebug: /Schedule[puppet]: Skipping device resources because running on a host[0m
[0;36mDebug: Prefetching freebsd resources for package[0m
[0;36mDebug: Executing '/usr/sbin/pkg_info -aoQ'[0m
[0;36mDebug: Executing '/usr/sbin/pkg_info -aoQ'[0m
[0;36mDebug: Package: *./editors/vim: origin => {:port_category=>"editors", :port_name=>"vim"}[0m
[0;36mDebug: Package: *./editors/vim: source => #<URI::FTP:0x80648c4d0 URL:ftp://ftp.freebsd.org/%2Fpub/FreeBSD/ports/amd64/packages-9-stable/>[0m
[0;36mDebug: Fetching INDEX: #<URI::FTP:0x80648b1c0 URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/INDEX.bz2>[0m
[0;36mDebug: Package: *./editors/vim: package_uri => #<URI::FTP:0x80a1b3980 URL:ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/vim-7.3.669.tbz>[0m
[0;36mDebug: Executing '/usr/sbin/pkg_add -f ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/All/vim-7.3.669.tbz'[0m
[mNotice: /Stage[main]//Package[*./editors/vim]/ensure: created[0m
[0;36mDebug: /Stage[main]//Package[*./editors/vim]: The container Class[Main] will propagate my refresh event[0m
[0;36mDebug: Class[Main]: The container Stage[main] will propagate my refresh event[0m
[0;36mDebug: Finishing transaction 17232926340[0m
[0;36mDebug: Storing state[0m
[0;36mDebug: Stored state in 0.02 seconds[0m
[mNotice: Finished catalog run in 21.05 seconds[0m
[0;36mDebug: Using settings: adding file resource 'rrddir': 'File[/var/puppet/rrd]{:owner=>"puppet", :group=>"puppet", :backup=>false, :mode=>"750", :path=>"/var/puppet/rrd", :ensure=>:directory, :loglevel=>:debug, :links=>:follow}'[0m
[0;36mDebug: Finishing transaction 17264361120[0m
[0;36mDebug: Received report to process from ovh.holms.lt[0m
[0;36mDebug: Processing report from ovh.holms.lt with processor Puppet::Reports::Store[0m