configure for json file fact caching
authorLorin Hochstein <lorin.hochstein@sendgrid.com>
Thu, 19 Feb 2015 02:52:17 +0000 (21:52 -0500)
committerLorin Hochstein <lorin.hochstein@sendgrid.com>
Thu, 19 Feb 2015 02:52:17 +0000 (21:52 -0500)
ch09/playbooks/Vagrantfile [new file with mode: 0644]
ch09/playbooks/ansible.cfg
ch09/playbooks/hosts [new file with mode: 0644]
ch09/playbooks/site.yml [new file with mode: 0644]

diff --git a/ch09/playbooks/Vagrantfile b/ch09/playbooks/Vagrantfile
new file mode 100644 (file)
index 0000000..fb8ee2e
--- /dev/null
@@ -0,0 +1,19 @@
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  # Use the same key for each machine
+  config.ssh.insert_key = false
+
+  config.vm.define "vagrant1" do |vagrant1|
+    vagrant1.vm.box = "ubuntu/trusty64"
+    vagrant1.vm.network "private_network", ip: "192.168.35.10"
+  end
+  config.vm.define "vagrant2" do |vagrant2|
+    vagrant2.vm.box = "ubuntu/trusty64"
+    vagrant2.vm.network "private_network", ip: "192.168.35.11"
+  end
+  config.vm.define "vagrant3" do |vagrant3|
+    vagrant3.vm.box = "ubuntu/trusty64"
+    vagrant3.vm.network "private_network", ip: "192.168.35.12"
+  end
+end
index 4c49145..62cf73a 100644 (file)
@@ -1,8 +1,15 @@
 [defaults]
+hostfile = hosts
+
+# Vagrant
+remote_user = vagrant
+private_key_file = ~/.vagrant.d/insecure_private_key
+
 pipelining = True
 gathering = smart
-fact_caching = redis
+fact_caching = jsonfile
 fact_caching_timeout = 86400
+fact_caching_connection = /tmp/ansible_fact_cache
 forks = 20
 
 [ssh_connection]
diff --git a/ch09/playbooks/hosts b/ch09/playbooks/hosts
new file mode 100644 (file)
index 0000000..b48116a
--- /dev/null
@@ -0,0 +1,4 @@
+[vagrant]
+192.168.35.10
+192.168.35.11
+192.168.35.12
diff --git a/ch09/playbooks/site.yml b/ch09/playbooks/site.yml
new file mode 100644 (file)
index 0000000..30aae8a
--- /dev/null
@@ -0,0 +1,5 @@
+- name: just a test of the cache
+  hosts: vagrant
+  tasks:
+    - name: just a ping
+      action: ping