Skip to content

Instantly share code, notes, and snippets.

@trondhindenes
Created November 5, 2016 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trondhindenes/44891cadf8c96555ee9a75bd60929e55 to your computer and use it in GitHub Desktop.
Save trondhindenes/44891cadf8c96555ee9a75bd60929e55 to your computer and use it in GitHub Desktop.
- name: Set intermediate fact
set_fact:
vars_hack: "{{ hostvars[inventory_hostname] }}"
- name: remove temp folder
file:
path: "/tmp/ansiblecmdb"
state: absent
failed_when: false
delegate_to: localhost
- name: create temp folder
file:
path: "/tmp/ansiblecmdb"
state: directory
delegate_to: localhost
- name: Dump all vars
action: template src=templates/dumpall.j2 dest="/tmp/ansiblecmdb/{{ inventory_hostname }}.json"
delegate_to: localhost
- name: add to db
hosts: localhost
tasks:
- name: add to db
script: app.py
delegate_to: localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment