Created
August 3, 2016 21:13
-
-
Save TopherGopher/370b6e2f5944f18eb7e60adc475c221b to your computer and use it in GitHub Desktop.
Loading databags in using ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Get the databag data for this site/env | |
local_action: command knife data bag show nmdhosting {{ item.path | basename }} -F yaml | |
register: bag | |
when: current_directory.stat.exists is defined and current_directory.stat.exists | |
- name: Get that data into a YAML file | |
local_action: copy content="{{ bag.stdout }}" dest="/tmp/{{ item.path | basename }}_generated.yml" | |
when: current_directory.stat.exists is defined and current_directory.stat.exists | |
- name: Get those vars | |
include_vars: "/tmp/{{ item.path | basename}}_generated.yml" | |
when: current_directory.stat.exists is defined and current_directory.stat.exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment