安装包下载:
安装过程中,要输入puppet master,在hosts加一下!
配置:
配置文件在(我这里用的是WIN7,WIN2008R2也一样)
C:\ProgramData\PuppetLabs\puppet\etc\puppet.conf
[main]
server=akin.com //服务器地址
pluginsync=true
autoflush=true
certname = akin5.com //certname,不配置会获取机器名
win可用的资源没有LINUX的多,可用的有:file,user,group,scheduled_task,package,service,exec,host等
配置一下MYSQL的安装实例:
vi akin5.com.pp
class winhost{
host { '':
ip => '192.168.14.250',
host_aliases => [ 'www', 'w'],
}
}
class winpkg {
file { 'd:\mysql-5.5.24-win32.msi':
source => "puppet:///mysql/mysql-5.5.24-win32.msi",
}
package { 'mysql':
ensure => installed,
provider => 'msi',
source => 'd:\mysql-5.5.24-win32.msi',
install_options => { 'INSTALLDIR' => 'C:\mysql-5.5' },
require => [File['d:\mysql-5.5.24-win32.msi']],
}
file { 'c:/mysql-5.5/my.ini':
source => "puppet:///mysql/my.ini",
require => [Package['mysql']],
}
exec { 'mysql service install':
command => "c:\mysql-5.5\bin\mysqld.exe --install",
require => [Package['mysql'],File['c:/mysql-5.5/my.ini']],
}
service { "MySQL":
ensure => 'running',
enable => true,
}
}
node "akin5.com" {
include winhost,winpkg
}
再到akin5上执行一下就OK了!
阅读(1363) | 评论(0) | 转发(0) |