如何从puppet清单安装离线包

时间:2015-02-10 12:59:01

标签: puppet

class shell_ubn {
    file {
      "/home/shellinabox/shellinabox_2.14-1_amd64.deb":
        ensure => present,
        mode => 0777,
        source => "puppet:///modules/shell_ubn/shellinabox_2.14-1_amd64.deb",
        notify => Package["Shellinabox"],
    }

    package {
      "Shellinabox":
        ensure => installed,
        source => "/home/shellinabox/shellinabox_2.14-1_amd64.deb",
        require => File["/home/shellinabox/shellinabox_2.14-1_amd64.deb"],
    }
}

我必须在我的Ubuntu客户端上安装此软件包,但它会出现此错误:

Error: /Stage[main]/Shell_ubn/Package[Shellinabox]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install Shellinabox' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package Shellinabox

1 个答案:

答案 0 :(得分:0)

您需要将provider => 'dpkg'参数添加到package资源。