0

我试图让一个非常基本的 Vagrant 设置工作,它基本上执行以下操作:创建一个新的 Precise64 VM 并安装一个包列表(简单的东西——我需要的只是 git、python、pip、virtualenv、virtualenvwrapper 和 postgres) . 让它运行一个简单的 shell 脚本也很好,但我并不绝对需要它。

我已经能够让 Vagrant 启动 Precise64 VM,但是要弄清楚 Puppet 和 Chef 的配置是很困难的。Puppet 或 Chef(哪个更容易)安装软件包(即 run sudo apt-get install)的基本语法是什么?

4

1 回答 1

0

对于 puppet(来自 puppet docs),您可以对 Ubuntu 上的 openssh 包执行类似的操作:

# /root/examples/ssh.pp
package { 'openssh-server':
  ensure => present,
  before => File['/etc/ssh/sshd_config'],
}
file { '/etc/ssh/sshd_config':
  ensure => file,
  mode   => 600,
  source => '/root/examples/sshd_config',
}
service { 'sshd':
  ensure     => running,
  enable     => true,
  subscribe  => File['/etc/ssh/sshd_config'],
}

你可以用这样的东西来测试它:

puppet apply --debug --noop /root/examples/ssh.pp
于 2014-01-10T23:15:02.163 回答