我是 puppet 新手。这是我第一次体验它。我在 2 个 ubuntu 虚拟机上安装了一个 master 和一个 agent。我已经用 puppet 安装了 apache。 它似乎工作正常。现在我已经编写了我的 site.pp 和我的 init.pp:
ubuntu@puppet:/etc/puppet/manifests$ cat site.pp
node 'puppetclient.example.com' {
include apache2
include mysql-server
}
树:
ubuntu@puppet:/etc/puppet/modules$ tree
.
├── apache2
│ └── manifests
│ └── init.pp
└── mysql-server
└── manifests
└── init.pp
mysql-server 的 init.pp:
class mysql-server {
package { 'mysql-server':
ensure => installed,
}
service { 'mysql-server':
ensure => true,
enable => true,
require => Package['mysql-server'],
}
}
当我在我的代理上执行 puppet agent -t
时。
ubuntu@puppetclient:~$ sudo puppet agent -t
[sudo] password for ubuntu:
Info: Retrieving plugin
Info: Caching catalog for puppetclient.example.com
Info: Applying configuration version '1462308091'
Error: /Stage[main]/Mysql-server/Service[mysql-server]: Could not evaluate: Could not find init script or upstart conf file for 'mysql-server'
Notice: Finished catalog run in 0.10 seconds
我做错了什么?谢谢
最佳答案
错误意味着 puppet 无法启动名为 mysql-server 的服务
Could not find init script or upstart conf file for 'mysql-server'
虽然我不使用 Ubuntu,但我确定该服务不称为 mysql-server,因为这只是包的名称,实际服务称为 mysql。
尝试使用:
服务 { 'mysql':
确保 => 真,
启用 => 真,
require => Package['mysql-server'],
}
关于mysql - 使用 puppet 安装 mysql-server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37014161/