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: add a new disk on guest vm | |
vmware_guest: | |
hostname: "{{ vcenter_hostname }}" | |
user: "{{ vcenter_username }}" | |
password: "{{ vcenter_password }}" | |
datacenter: "{{ vcenter_datacenter }}" | |
cluster: "{{ vcenter_cluster }}" | |
guest_id: "rhel7_64Guest" | |
validate_certs: False |
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
- name: Monitoring Filebeat Service | |
uri: | |
url: 'https://{{ nagios_server }}/nagiosxi/api/v1/config/service?apikey={{ nagios_api_key }}' | |
body: 'host_name={{ ansible_nodename }}&service_description={{ nagios_service_description }}&use={{ nagios_filebeat_template }}&force=1' | |
status_code: 200 | |
method: POST | |
return_content: yes | |
validate_certs: no | |
timeout: 120 | |
delegate_to: 127.0.0.1 |
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
Ansible JMESPATH / JSON Explorer | |
nagios_xi_services.json.servicelist.service[?service_description=='Service Status: Filebeat'].host_name | |
I want to run a task when the result is empty only. | |
Example of data I register by module uri in nagios_xi_services | |
{ | |
"nagios_xi_services": { |
NewerOlder