0

我正在尝试通过 puppet 安装 mysql,使用以下代码:

class mysql::install {
  package {
    'mysql-client': ensure => present,
                    require => Package["mysql-client-core-5.5"];
  }

  service {
    'mysql': ensure => running;
  }
}

node default {
  include mysql::install
}

但我收到以下错误消息:

Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-common_5.1.63-0ubuntu0.10.04.1_all.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/libmysqlclient16_5.1.63-0ubuntu0.10.04.1_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-client-core-5.1_5.1.63-0ubuntu0.10.04.1_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-client-5.1_5.1.63-0ubuntu0.10.04.1_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-server-core-5.1_5.1.63-0ubuntu0.10.04.1_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-server-5.1_5.1.63-0ubuntu0.10.04.1_i386.deb  404  Not Found [IP: 91.189.91.13 80]
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/mysql-server_5.1.63-0ubuntu0.10.04.1_all.deb  404  Not Found [IP: 91.189.91.13 80]
4

1 回答 1

1

我不知道这是否与您粘贴的特定问题有关,但如果这是您的完整 puppet 代码,我认为您没有正确使用 require 参数。如果您已经为“mysql-client-core-5.5”定义了一个包资源,那么请忽略这个答案的其余部分。

require 参数引用另一个已定义的资源。它说在应用所需资源之前不要应用当前资源。

因此,在您的情况下,puppet 会期望存在如下资源:

  包裹 {
    'mysql-client-core-5.5':确保 => 存在
  }

如果你想强制执行特定版本的包,require 参数不是办法。

于 2013-04-08T22:18:28.270 回答