我是木偶新手。这是我第一次接触它。我已经在两个ubuntu上安装了一个主服务器和一个代理,我已经安装了带有傀儡的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服务器的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我做错了什么?谢谢
发布于 2016-05-03 21:29:24
此错误意味着傀儡无法启动名为mysql-server的服务。
无法为“mysql-server”找到init脚本或upstart conf文件。
虽然我不使用Ubuntu,但我确信服务不是mysql-server,因为这只是包的名称,实际的服务称为mysql。
试着使用:
service { 'mysql': ensure => true, enable => true, require => Package['mysql-server'], }
发布于 2016-05-03 23:08:42
正如Michal所说,服务名称就是mysql。
不同的操作系统通常有不同的包名和配置文件位置。
对于mysql这样的东西,我建议使用以前的知识,比如支持的MySql模块,它涵盖了mysql的大多数用例,包括创建数据库。
然后,您可以只包含MySql类,它为您完成了大部分工作。
https://stackoverflow.com/questions/37014161
复制相似问题