Quiz Entry - updated: 2026.12.01
What is the difference between cp_mgmt_host_facts with name: and without it, and what do details_level, limit and offset control?
With name it calls show-host and returns one object; without it, show-hosts and a page of all host objects. details_level (uid, standard, full) sets how much of each object comes back; limit and offset page through long lists.
All *_facts modules switch between the singular and plural API call depending on whether you name an object.
* Name an object to get it; leave the name out to list them, page by page. *
In detail:
| Task | API call | Result in ansible_facts |
|---|---|---|
cp_mgmt_host_facts: name: "HSLU-Test-Host" |
show-host |
one host object |
cp_mgmt_host_facts: (no name) |
show-hosts |
hosts with an objects list, plus from, to, total |
For the list form:
limit: how many objects per call (the lab uses 50);offset: where to start, sooffset: 50gets the next page. Comparetotalwithtoto see whether there is more;details_level:uidreturns only identifiers,standardthe usual fields,fulleverything, including nested objects.
To see the result, register it and print it:
- check_point.mgmt.cp_mgmt_host_facts:
name: "HSLU-Test-Host"
register: host_info
- ansible.builtin.debug:
msg: "{{ host_info }}"
Go deeper:
cp_mgmt_host_facts module (Ansible docs) —
name,details_level,limit,offset,order.