Created
August 21, 2020 06:19
-
-
Save iamgini/3c9a5842676bf00aa10f13ed82d3aa81 to your computer and use it in GitHub Desktop.
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
``` | |
tasks: | |
- name: Display the JSON file and collect data | |
shell: cat {{ cve_json_file }} | |
register: result | |
- name: Save the Json data to a Variable | |
set_fact: | |
jsondata: "{{ result.stdout | from_json }}" | |
- name: setDomainName | |
set_fact: | |
domain_name: "{{ jsondata | json_query(jmesquery) }}" | |
vars: | |
jmesquery: 'domain.name' | |
- name: Server Names | |
set_fact: | |
servernames: "{{ jsondata | json_query(jmesquery) }}" | |
vars: | |
jmesquery: '*.servers[*].name' | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment