From: Lorin Hochstein Date: Thu, 19 Feb 2015 02:52:17 +0000 (-0500) Subject: configure for json file fact caching X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=93511fac0302e7cb45129fe4617d35183637dd08;p=ansiblebook.git configure for json file fact caching --- diff --git a/ch09/playbooks/Vagrantfile b/ch09/playbooks/Vagrantfile new file mode 100644 index 0000000..fb8ee2e --- /dev/null +++ b/ch09/playbooks/Vagrantfile @@ -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 diff --git a/ch09/playbooks/ansible.cfg b/ch09/playbooks/ansible.cfg index 4c49145..62cf73a 100644 --- a/ch09/playbooks/ansible.cfg +++ b/ch09/playbooks/ansible.cfg @@ -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 index 0000000..b48116a --- /dev/null +++ b/ch09/playbooks/hosts @@ -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 index 0000000..30aae8a --- /dev/null +++ b/ch09/playbooks/site.yml @@ -0,0 +1,5 @@ +- name: just a test of the cache + hosts: vagrant + tasks: + - name: just a ping + action: ping