我做了一个 git clone,然后 sudo puppet apply init.pp
但我没有看到 ubuntu 11.04 主机上安装了 iptraf
现在这个木偶只是一个客户端实例,没有主人。
从另一个示例中,我看到我可以将 apache2 安装为:
class basic_services {
##Get Apache
package { 'apache2':
ensure => 'installed',
}
##Edit the Apache Conf
file { "/etc/apache2/sites-available/default":
require => Package["apache2"],
owner => "root",
group => "root",
content => "$some_variables::apache_config",
}
##Make sure Apache is running, and restarts on changes to conf
service {'apache2':
require => Package["apache2"],
ensure => running,
subscribe => File["/etc/apache2/sites-available/default"],
}
}
所以对于iptraf:
init.pp
class iptraf {
include iptraf::base
}
base.pp
class iptraf::base {
package{'iptraf': ensure => installed }
}
我将以此示例为基础来开发测试工具的清单
那么我在这里缺少什么,就像我跑步之后一样:
sudo puppet apply init.pp ,并尝试访问 iptraf,我收到消息:
iptraf
The program 'iptraf' is currently not installed. You can install it by typing:
sudo apt-get install iptraf