Commit 9007c624 by Jason Bau

Merge pull request #304 from edx/jbau/debug/role

add a ansible_debug role that just dumps vars into json
parents b25bf3bd 181b0f1f
---
- name: Dump all vars to json
template: src=dumpall.json.j2 dest=/tmp/ansible.all.json mode=0600
tags:
- dumpall
- debug
- name: Dump lms auth|env file
template: src=../../edxapp/templates/lms.{{item}}.json.j2 dest=/tmp/lms.{{item}}.json mode=0600
with_items:
- env
- auth
when: "'lms' in service_variants_enabled"
tags:
- dumpall
- debug
- name: Dump lms-preview auth|env file
template: src=../../edxapp/templates/lms-preview.{{item}}.json.j2 dest=/tmp/lms-preview.{{item}}.json mode=0600
with_items:
- env
- auth
when: "'lms-preview' in service_variants_enabled"
tags:
- dumpall
- debug
- name: Dump cms auth|env file
template: src=../../edxapp/templates/cms.{{item}}.json.j2 dest=/tmp/cms.{{item}}.json mode=0600
with_items:
- env
- auth
when: "'cms' in service_variants_enabled"
tags:
- dumpall
- debug
- name: Dump all vars to yaml
template: src=dumpall.yml.j2 dest=/tmp/ansible.all.yml mode=0600
tags:
- dumpall
- debug
- name: fetch remote files
# fetch is fail-safe for remote files that don't exist
# setting mode is not an option
fetch: src=/tmp/{{item}} dest=/tmp/{{ansible_hostname}}-{{item}} flat=True
with_items:
- ansible.all.json
- ansible.all.yml
- lms.env.json
- lms.auth.json
- lms-preview.env.json
- lms-preview.auth.json
- cms.env.json
- cms.auth.json
tags:
- dumpall
- debug
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}
GROUP NAMES Variables ("group_names"):
--------------------------------
{{ group_names | to_nice_json }}
GROUPS Variables ("groups"):
--------------------------------
{{ groups | to_nice_json }}
HOST Variables ("hostvars"):
--------------------------------
{{ hostvars | to_nice_json }}
{% if lms_env_config %}
LMS env variables:
---------------
{{ lms_env_config | to_nice_json }}
{% endif %}
{% if lms_auth_config %}
LMS auth variables:
---------------
{{ lms_auth_config | to_nice_json }}
{% endif %}
{% if lms_preview_env_config %}
Preview env variables:
---------------
{{ lms_preview_env_config | to_nice_json }}
{% endif %}
{% if lms_preview_auth_config %}
Preview auth variables:
---------------
{{ lms_preview_auth_config | to_nice_json }}
{% endif %}
{% if cms_env_config %}
CMS env variables:
---------------
{{ cms_env_config | to_nice_json }}
{% endif %}
{% if cms_auth_config %}
CMS auth variables:
---------------
{{ cms_auth_config | to_nice_json }}
{% endif %}
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_yaml }}
Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_yaml }}
GROUP NAMES Variables ("group_names"):
--------------------------------
{{ group_names | to_nice_yaml }}
GROUPS Variables ("groups"):
--------------------------------
{{ groups | to_nice_yaml }}
{% if lms_env_config %}
LMS env variables:
---------------
{{ lms_env_config | to_nice_yaml }}
{% endif %}
{% if lms_auth_config %}
LMS auth variables:
---------------
{{ lms_auth_config | to_nice_yaml }}
{% endif %}
{% if lms_preview_env_config %}
Preview env variables:
---------------
{{ lms_preview_env_config | to_nice_yaml }}
{% endif %}
{% if lms_preview_auth_config %}
Preview auth variables:
---------------
{{ lms_preview_auth_config | to_nice_yaml }}
{% endif %}
{% if cms_env_config %}
CMS env variables:
---------------
{{ cms_env_config | to_nice_yaml }}
{% endif %}
{% if cms_auth_config %}
CMS auth variables:
---------------
{{ cms_auth_config | to_nice_yaml }}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment