Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
paredesh
Participant

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

0 Kudos
1 Reply
paredesh
Participant

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}}"

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events