Skip to content

Instantly share code, notes, and snippets.

@haad
Last active February 21, 2017 22:06
Show Gist options
  • Save haad/b005de9bd6e7fef2d8b744de55473eab to your computer and use it in GitHub Desktop.
Save haad/b005de9bd6e7fef2d8b744de55473eab to your computer and use it in GitHub Desktop.
https://github.com/CentOS-PaaS-SIG/linch-pin/blob/master/library/schema_check.py
- name: Do some initial check for user_portal_data
assert:
that:
- "user_portal_data is defined"
- "user_portal_data is string"
- name: Install json-spec tool for json validation
pip:
state: present
name: json-spec
- name: Validate user_portal_data against schema
command: "json validate --document-json='{{ user_portal_data }}' --schema-file=schema/provision_tenant.json_schema"
changed_when: false
failed_when: jsonlint_result.rc != 0
register: jsonlint_result
- name: Verify input data
assert:
that:
- tenantId is defined
- tenant_status is defined
- tenant_status == 'FAILED' or tenant_status == 'SUCCESS'
- queue is defined
- stackstorm_execution_id is defined
- server_environment is defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment