From b7157f39a950ae146b807d3fe0c673941522248f Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Sun, 10 Jan 2016 20:41:06 -0700 Subject: [PATCH] Switch to Vagrant-generated Ansible inventory Update `Vagrantfile` to no longer generate an inventory file. Modify `ansible.cfg` to use Vagrant-generated Ansible inventory file. Remove unnecessary inventory file named `hosts`. --- lxd/Vagrantfile | 8 -------- lxd/ansible.cfg | 2 +- lxd/hosts | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 lxd/hosts diff --git a/lxd/Vagrantfile b/lxd/Vagrantfile index 48c49e6..6f689c1 100644 --- a/lxd/Vagrantfile +++ b/lxd/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/lxd/ansible.cfg b/lxd/ansible.cfg index 1813b4a..e7c5f46 100644 --- a/lxd/ansible.cfg +++ b/lxd/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/lxd/hosts b/lxd/hosts deleted file mode 100644 index c1092e1..0000000 --- a/lxd/hosts +++ /dev/null @@ -1 +0,0 @@ -192.168.100.100