Skip to content

Instantly share code, notes, and snippets.

---
- include: playbook-stuff.yml
vars:
hosts: all
pkg: httpd
import cPickle as pickle
cachename = os.path.join(os.path.dirname(__file__), "hostscache")
row = None
if os.path.exists(cachename):
cache = pickle.load(open(cachename, 'r'))
if sys.argv[2] in cache:
if cache[sys.argv[2]]['timestamp'] > (time.time() - 300):
row = cache[sys.argv[2]]['row']
else:
cache = {}
diff --git a/lib/ansible/runner/action_plugins/group_by.py b/lib/ansible/runner/action_plugins/group_by.py
index d65ec24..35c39d2 100644
--- a/lib/ansible/runner/action_plugins/group_by.py
+++ b/lib/ansible/runner/action_plugins/group_by.py
@@ -20,7 +20,7 @@ import ansible
from ansible.callbacks import vv
from ansible.errors import AnsibleError as ae
from ansible.runner.return_data import ReturnData
-from ansible.utils import parse_kv, template
+from ansible.utils import parse_kv, template, check_conditional