2014-01-10 78 views
0

我想要得到一个非常基本的流浪汉安装工作,基本上做到以下几点: 创建一个新的Precise64虚拟机并安装包列表(简单的东西 - 我需要的是git,python,pip,virtualenv,virtualenvwrapper和postgres)。它也很高兴能够运行一个简单的shell脚本,但我并不完全需要它。非常简单的流浪安装与厨师或木偶

我已经能够让Vagrant启动一个Precise64虚拟机,但搞清楚配置与木偶和厨师都很困难。 Puppet或Chef的基本语法(以哪个更容易)来安装软件包(即运行sudo apt-get install)?

+0

参见:HTTP ://stackoverflow.com/questions/19125374/how-do-i-configure-chef-solo-to-install-nginx-on-a-new-vagrant-box/19127033#19127033 –

+0

这可能会有所帮助:https: //puphpet.com – steveax

回答

0

对于傀儡(从木偶docs),你可以做这样的事情了openssh包在Ubuntu:

# /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