使用 Puppet 安装 deb 包

一般安装一个包可以使用 apt 方式安装,puppet 也提供了这种功能:
class package{

   $apppackage = [
            "screen",
            "htop",
            "expect",
            "traceroute",
            "curl",
            "ethtool"
   ]
    package
        { $apppackage:
                ensure => installed,
        }  
}

如果想要直接安装 .deb 的包,可以通过 dpkg 这个 provider 来实现:
class package{

        file{
            "sysstat_9.0.6-2":
            path => "/var/tmp/sysstat_9.0.6-2_amd64.deb",
            mode => 0644,
            owner => root,
            group => root,
            source => "puppet://$fileserver/package/sysstat_9.0.6-2_amd64.deb",
        }  

        package {
            "sysstat_9.0.6-2":
            provider => dpkg,
            ensure => installed,
            source => "/var/tmp/sysstat_9.0.6-2_amd64.deb",
        require => [File["sysstat_9.0.6-2"],Package["yyy"]],
          }
}