Hi Team,
I have a small playbook which connects to InfoBlox Server and collects
useful data via API and then save API commands out to variable and later
redirecting variable output to a log file.
Issue is that Variable is not getting all output but it captures only
fraction of output. Any idea and suggestion how to capture complete output
of API call and save it in log file in formatted way , just like Jason
Below is playbook:
---
- hosts: localhost
connection: local
gather_facts: no
vars_files:
- infoblox_pass.yml
tasks:
- name: Command to get Infoblox data
uri:
url:
"https://x.x.x.x/wapi/v2.9/member?_return_fields%2B=node_info&_return_as_object=1"
method: GET
user: admin
password: "xxxxxxx"
validate_certs: no
register: pool_members_resource
- name: Command to get DNS & NTP Service Status of pool members
uri:
url:
"https://x.x.x.x/wapi/v2.9/member?_return_fields%2B=service_status&_return_as_object=1"
method: GET
user: admin
password: "xxxxxxxx"
validate_certs: no
register: pool_members_service_status
# - debug:
# msg: "{{ pool_members_service_status }}"
- lineinfile:
path: "/root/logs/infoblox-{{ dates }}.log"
create: yes
line: "{{ item }}"
with_items:
- "{{ pool_members_resource }}"
- "{{ pool_members_service_status }}"
#- hosts: "{{ nagios_node }}"
# gather_facts: false
# tasks:
# - copy:
# src: "/root/logs/infoblox-{{ dates }}.log"
# dest: /var/tmp/nagios_logs/infoblox/
# owner: nagios
# group: nagios
#
...
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/31ae197e-5088-4cab-9c16-c08edf07123a%40googlegroups.com.