Created
February 2, 2014 14:46
-
-
Save progre/8769424 to your computer and use it in GitHub Desktop.
AnsibleをゲストOSに押し込んでVagrant環境構築する ref: http://qiita.com/progre/items/ccc2d8c2ec7ae8a4ed61
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible/ | |
hosts | |
playbook.yml | |
provision.sh | |
Vagrantfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS E:\Developments\vagrant\rubyist> vagrant provision | |
[default] Running provisioner: shell... | |
DL is deprecated, please use Fiddle | |
[default] Running: C:/Users/progre/AppData/Local/Temp/vagrant-shell20140202-12404-w7zith | |
stdin: is not a tty | |
PLAY [127.0.0.1] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [127.0.0.1] | |
TASK: [install ruby] ********************************************************** | |
ok: [127.0.0.1] | |
TASK: [install rubygems] ****************************************************** | |
ok: [127.0.0.1] | |
TASK: [install bundler] ******************************************************* | |
changed: [127.0.0.1] | |
PLAY RECAP ******************************************************************** | |
127.0.0.1 : ok=4 changed=1 unreachable=0 failed=0 | |
PS E:\Developments\vagrant\rubyist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 ansible_connection=local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: 127.0.0.1 | |
connection: local | |
sudo: yes | |
tasks: | |
- name: install ruby | |
apt: pkg=ruby update_cache=yes | |
- name: install rubygems | |
apt: pkg=rubygems update_cache=yes | |
- name: install bundler | |
command: gem install bundler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if ! [ `which ansible` ]; then | |
apt-get update -y | |
apt-get install -y ansible | |
fi | |
ansible-playbook -i /vagrant/ansible/hosts /vagrant/ansible/playbook.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.synced_folder ".", "/vagrant", :mount_options => ['dmode=775', 'fmode=664'] | |
config.vm.provision "shell", :path => "provision.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment