- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- Query IP address in multi-domain environment
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Query IP address in multi-domain environment
Hello,
We have a multi-domain environment R81.10. I am trying to search for objects using ansible that have x.x.x.x IP address in all domains. I read somewhere that even though I log into a specific domain I have to specify the domain in the playbook. I do not see that in the documentation. Could it be you can't do it using ansible and only able to do it via a script (like python)
My playbook:
---
- hosts: checkpoint # Tells Ansible which plugin to use.
connection: httpapi # Determines connection.
tasks:
- name: Get object facts
checkpoint_object_facts:
object_filter: 192.168.30.30
ip_only: yes
- name: Printing The Result
debug:
msg: "{{result}}"
Ansible #python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found out why. Here is my hosts and playbook for ansible:
++++++++++++++++++++++++++++++++++++++
# This is the default ansible 'hosts' file.
[checkpoint]
<x.x.x.x>
[checkpoint:vars]
ansible_python_interpreter=/usr/bin/python3.6
ansible_httpapi_validate_certs=False
ansible_httpapi_use_ssl=True
ansible_network_os=check_point.mgmt.checkpoint
ansible_user=<username>
ansible_password=<password>
ansible_checkpoint_domain=<domain name>
++++++++++++++++++++++++++++++++++++++++
# This is the ansible 'playbook' file.
---
- hosts: checkpoint
connection: httpapi
tasks:
- name: show-host
cp_mgmt_host_facts:
name: Host_82.5.223.125
register: result
- name: show-hosts
cp_mgmt_host_facts:
details_level: standard
limit: 50
offset: 0
- name: Printing The Result
debug:
msg: "{{result}}"
