Skip to content

Instantly share code, notes, and snippets.

@gamename
Created April 9, 2021 15:59
Show Gist options
  • Save gamename/035520f8300789e990f37c37b3ad5f52 to your computer and use it in GitHub Desktop.
Save gamename/035520f8300789e990f37c37b3ad5f52 to your computer and use it in GitHub Desktop.
to_json error
---
# tasks file for apigee-opdk-settings-cassandra/
- name: Fail if ds group is not provided
fail:
msg: 'ds group is not defined in the inventory file, please define the ds group in the inventory file'
when: groups['ds'] is not defined
- name: Fail if dc_1 group is not provided
fail:
msg: 'dc_1 group is not defined in the inventory file, please define the dc_1 group in the inventory file'
when: groups['dc_1'] is not defined
- name: Fail if dc_1_ds group is not provided
fail:
msg: 'dc_1_ds group is not defined in the inventory file, please define the dc_1_ds group in the inventory file'
when: groups['dc_1_ds'] is not defined
- name: Fail if dc_1_ms group is not provided
fail:
msg: 'dc_1_ms group is not defined in the inventory file, please define the dc_1_ms group in the inventory file'
when: groups['dc_1_ms'] is not defined
- name: Assert variables are available
assert:
that:
- private_address is defined
- region is defined
msg: "Please provide the missing variable"
- name: Construct cassandra hosts configuration
cassandra_hosts:
inventory_hostname: '{{ inventory_hostname }}'
hostvars: '{{ hostvars | to_json }}'
when: manual_response_file is not defined or not manual_response_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment