vagrant 로 ansible, puppet, chef를 쓰지 않아도 간단하게 shell 만으로도 배포(provision)이 가능하다.
아래아 같은 Vagrantfile 예제를 활용한다.
$ vi Vagrantfile
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.hostname = "web"
config.vm.network "private_network", ip: "192.168.1.50"
config.vm.network :forwarded_port, guest: 9966, host: 3333
config.vm.provision :shell, :path => "test.sh"
config.vm.define :testing do |test|
test.vm.provision :shell, inline: 'echo XXXXX'
end
end
결과 화면
$ vagrant provision
==> testing: Running provisioner: shell...
testing: Running: /var/folders/nx/lkzmd37d6fj3sg9kg5flt3yr0000gp/T/vagrant-shell20140714-98395-6wvcso.sh
==> testing: stdin: is not a tty
==> testing: total 12
==> testing: drwxr-xr-x 3 root root 4096 Sep 14 2012 .
==> testing: drwxr-xr-x 24 root root 4096 Jul 13 18:18 ..
==> testing: drwxr-xr-x 4 vagrant vagrant 4096 Sep 14 2012 vagrant
==> testing: Running provisioner: shell...
testing: Running: inline script
==> testing: stdin: is not a tty
==> testing: XXXXX
'Ansible-Puppet-Chef' 카테고리의 다른 글
[ansible] 멱등성(idempotent) 용어 이해하기 (0) | 2014.07.24 |
---|---|
[vagrant] vagrant에서 여러 개의 가상머신 실행하기 (How to execute multiple vm on VirtualBox) (0) | 2014.07.16 |
[ansible] drupal 2014 - devops for developer저자의 Ansible 설명자료 (0) | 2014.06.30 |
[ansible] USENIX 2013 - Continuous Deployment with Ansible (0) | 2014.06.30 |
[ansible] pycon 2014 - Ansible - Python-Powered Radically Simple IT Automation (0) | 2014.06.30 |