From 93511fac0302e7cb45129fe4617d35183637dd08 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Wed, 18 Feb 2015 21:52:17 -0500 Subject: [PATCH] configure for json file fact caching --- ch09/playbooks/Vagrantfile | 19 +++++++++++++++++++ ch09/playbooks/ansible.cfg | 9 ++++++++- ch09/playbooks/hosts | 4 ++++ ch09/playbooks/site.yml | 5 +++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ch09/playbooks/Vagrantfile create mode 100644 ch09/playbooks/hosts create mode 100644 ch09/playbooks/site.yml 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 -- 2.44.0