Last active
December 24, 2015 01:09
-
-
Save wolstena/6722143 to your computer and use it in GitHub Desktop.
Vangrant + Ansible
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
hosts = { | |
"host0" => "192.168.33.10", | |
"host1" => "192.168.33.11", | |
"host2" => "192.168.33.12" | |
} | |
Vagrant.configure("2") do |config| | |
hosts.each do |name, ip| | |
config.vm.define name do |machine| | |
machine.vm.box = "precise32" | |
machine.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
machine.vm.hostname = "%s.example.org" % name | |
machine.vm.network :private_network, ip: ip | |
machine.vm.provider "virtualbox" do |v| | |
v.name = name | |
v.customize ["modifyvm", :id, "--memory", 200] | |
end | |
config.vm.provision :ansible do |ansible| | |
ansible.sudo = true | |
ansible.playbook = 'provisioning/keys.yml' | |
end | |
end | |
end |
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
-Make changes to /etc/network/interfaces (eg change dns servers) | |
-Multiple server auto-resolving port forwarding of 22. | |
-First run: authorized_keys | |
-If you don't specify a host file, how do you specify groups and roles. == via facts? |
ansible -i vagrant_ansible_inventory_elasticsearch01 -m setup -vvv elasticsearch01 --ask-pass -u vagrant --sudo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This causes me grief with the port forwarding for port 22. Does it need a pause or retry somewhere?