通过puppet安装mysql

时间:2013-03-15 04:04:32

标签: mysql puppet

我正在尝试通过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]

1 个答案:

答案 0 :(得分:1)

我不知道这与您粘贴的具体问题有什么关系,但如果这是您的完整木偶代码,我认为您没有正确使用require参数。如果您已经为' mysql-client-core-5.5'定义了一个包资源。然后忽略这个答案的其余部分。

require参数指的是另一个已定义的资源。它表示在应用所需资源之前不应用当前资源。

所以在你的情况下,puppet会期望存在如下资源:

  package {
    'mysql-client-core-5.5': ensure => present
  }

如果要强制执行特定版本的软件包,则不需要使用require参数。