ipbhat / ipbhat.sample / 1.0.0 / module / infn_cfg_validator Validate the user defined configurations Authors: Anand Krishna Rallabhandi (anand-krishna) preview | supported by networkipbhat.sample.infn_cfg_validator (1.0.0) — module
Install with ansible-galaxy collection install ipbhat.sample:==1.0.0
collections: - name: ipbhat.sample version: 1.0.0
The configurations given are to be validated against a JSON Schema defined for them
--- - hosts: swne connection: local gather_facts: False vars_files: - group_vars/iqnos_radius_config.yml vars: NE_IP: "{{ ne_ip | default(hostvars[inventory_hostname]['ansible_host']) }}" NE_User: "{{ ne_user | default(hostvars[inventory_hostname]['ansible_user']) }}" NE_Pwd: "{{ ne_pwd | default(hostvars[inventory_hostname]['ansible_password']) }}" tasks: - name: Check if the input configuration is valid or not infn_cfg_validator: what_is_being_validated: "NTP Server Configs" configs: "{{ configs }}" schema: "{{ lookup('file', 'ntp_config_schema.json') | from_json | string }}"
schema: description: - JSON Schema for the input configuration of that role required: true type: string configs: description: - Input configurations for any role required: true type: dict what_is_being_validated: description: - A string describing what is being validated required: true type: string