问题
I'm trying to install mysql via puppet, using the following code:
class mysql::install {
package {
'mysql-client': ensure => present,
require => Package["mysql-client-core-5.5"];
}
service {
'mysql': ensure => running;
}
}
node default {
include mysql::install
}
But I received the following error message:
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:
I don't know if this has anything to do with the specific issue you pasted, but I don't think you're using the require parameter correctly if this is your full puppet code. If you're already defining a package resource for 'mysql-client-core-5.5' then disregard the rest of this answer.
The require parameter refers to another defined resource. It says don't apply the current resource until the required resource is applied.
So in your case, puppet would expect a resource like the following to exist:
package { 'mysql-client-core-5.5': ensure => present }
If you want to enforce a specific version of the package, the require parameter is not the way.
来源:https://stackoverflow.com/questions/15424520/install-mysql-via-puppet