diff --git a/lxc/README.md b/lxc/README.md index e08564d..643cf63 100644 --- a/lxc/README.md +++ b/lxc/README.md @@ -4,9 +4,7 @@ These files were created to allow users to use Vagrant ([http://www.vagrantup.co ## Contents -* **ansible.cfg**: This Ansible configuration file instructs Ansible to use an inventory file named `hosts` in the current directory, and to use the default vagrant user (`vagrant`) and default insecure Vagrant SSH private key. - -* **hosts**: This file is created automatically when you run `vagrant status` or `vagrant up` (anytime Vagrant processes the `Vagrantfile`). This file relies on the presence of a "ip_addr" value in `machines.yml`. Do not edit this file directly---instead edit `machines.yml` to change the values that will be automatically written into this file. +* **ansible.cfg**: This Ansible configuration file instructs Ansible to use an inventory file named `hosts` in the current directory, to use the default vagrant user (`vagrant`) and default insecure Vagrant SSH private key, and to use the Vagrant-generated Ansible inventory file (found, by default, in `./vagrant/provisioners/inventory/vagrant_ansible_inventory`). * **machines.yml**: This YAML file contains a list of VM definitions and associated configuration data. It is referenced by `Vagrantfile` when Vagrant instantiates the VMs. Generally the only change this file needs is to ensure the "box" value correctly references the Vagrant box you're using. The "ip_addr" value is also required in order to build the Ansible inventory file; you may want to edit this to a value appropriate for your environment. diff --git a/lxc/Vagrantfile b/lxc/Vagrantfile index 48c49e6..6f689c1 100644 --- a/lxc/Vagrantfile +++ b/lxc/Vagrantfile @@ -15,14 +15,6 @@ require 'yaml' # Read YAML file with VM details (box, CPU, and RAM) machines = YAML.load_file(File.join(File.dirname(__FILE__), 'machines.yml')) -# Create Ansible inventory file -# (current contents will be overwritten) -f = File.open('hosts','w') -machines.each do |machine| - f.puts machine['ip_addr'] -end # machines.each -f.close - # Create and configure the VMs Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| diff --git a/lxc/ansible.cfg b/lxc/ansible.cfg index 1813b4a..a25e3e2 100644 --- a/lxc/ansible.cfg +++ b/lxc/ansible.cfg @@ -1,5 +1,5 @@ [defaults] -inventory = ./hosts +inventory = ./vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory private_key_file = ~/.vagrant.d/insecure_private_key remote_user = vagrant host_key_checking = False \ No newline at end of file diff --git a/lxc/hosts b/lxc/hosts deleted file mode 100644 index c1092e1..0000000 --- a/lxc/hosts +++ /dev/null @@ -1 +0,0 @@ -192.168.100.100