通过 puppet 安装 mysql [英] install mysql via puppet

查看:54
本文介绍了通过 puppet 安装 mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

class mysql::install {包裹 {'mysql-client': 确保 =>展示,要求 =>包["mysql-client-core-5.5"];}服务 {'mysql': 确保 =>跑步;}}节点默认{包括 mysql::install}

但我收到以下错误消息:

无法获取 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]无法获取 http://security.ubuntu.com/ubuntu/pool/main/m/mysql-dfsg-5.1/libmysqlclient16_5.1.63-0ubuntu0.10.04.1_i386.deb 404 未找到 [IP: 91.189.91.13 80]无法获取 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]无法获取 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]无法获取 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]无法获取 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]无法获取 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]

解决方案

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

require 参数引用另一个定义的资源.它表示在应用所需资源之前不要应用当前资源.

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

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

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

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]

解决方案

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.

这篇关于通过 puppet 安装 mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆