2014-01-10 77 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