cp_mgmt_hosts
Manages HOSTS resource module through native controller HTTPAPI with owned sessions
Collection: check_point.mgmt
Full Name: check_point.mgmt.cp_mgmt_hosts
Controller module — runs on the local controller, not on remote hosts.
Synopsis
Manages HOSTS resource module through native controller HTTPAPI with owned sessions
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| config | dict | A dictionary of HOSTS options | ||
| state | str | The state the configuration should be left in The state I(gathered) will get the module API configuration from the device and transform it into structured data in the format as per the module argspec and the value is returned in the I(gathered) key within the result. |
Example
yaml
- name: Merge MGMT Hosts config
check_point.mgmt.cp_mgmt_hosts:
state: merged
config:
color: cyan
ip_address: 192.0.2.1
name: New Host 1
auto_publish_session: true
tags:
- New Host
round_trip: true
# RUN output:
# -----------
# mgmt_hosts:
# after:
# color: cyan
# comments: ''
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 192.0.2.1
# name: New Host 1
# nat_settings: {}
# tags:
# - New Host
# before: {}
# Using REPLACED state
# --------------------
- name: Replace MGMT Host config
check_point.mgmt.cp_mgmt_hosts:
state: replaced
config:
name: New Host 1
tags:
- New Replaced Host
color: aquamarine
ip_address: 198.51.110.0
comments: REPLACED description
ignore_warnings: true
ignore_errors: false
auto_publish_session: true
round_trip: true
# RUN output:
# -----------
# mgmt_hosts:
# after:
# color: aquamarine
# comments: REPLACED description
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 198.51.110.0
# name: New Host 1
# nat_settings: {}
# tags:
# - New Replaced Host
# before:
# color: cyan
# comments: ''
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 192.0.2.1
# name: New Host 1
# nat_settings: {}
# tags:
# - New Host
# Using GATHERED state
# --------------------
# 1. With Round Trip set to True
- name: Gather MGMT Host config by Name
check_point.mgmt.cp_mgmt_hosts:
state: gathered
config:
name: New Host 1
# RUN output:
# -----------
# gathered:
# color: cyan
# comments: REPLACED description
# domain: SMC User
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 192.0.2.1
# name: New Host 1
# nat_settings: {}
# read-only: false
# tags:
# - New Host
# uid: 63b868bb-d300-47f4-b97a-c465a56fe9c7
# 2. With Round Trip set to False which is the default behaviour
- name: Gather MGMT Host config by Name
check_point.mgmt.cp_mgmt_hosts:
state: gathered
config:
name: New Host 1
# RUN output:
# -----------
# gathered:
# color: cyan
# comments: ''
# domain:
# domain-type: domain
# name: SMC User
# uid: 41e821a0-3720-11e3-aa6e-0800200c9fde
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 192.0.2.1
# meta-info:
# creation-time:
# iso-8601: 2022-11-21T08:31+0000
# posix: 1669019480328
# creator: admin
# last-modifier: admin
# last-modify-time:
# iso-8601: 2022-11-21T08:31+0000
# posix: 1669019480328
# lock: unlocked
# validation-state: ok
# name: New Host 1
# nat_settings: {}
# read-only: false
# tags:
# - domain:
# domain-type: domain
# name: SMC User
# uid: 41e821a0-3720-11e3-aa6e-0800200c9fde
# name: New Host
# type: tag
# uid: 94d53896-3cee-4e1f-a83b-3abac80bf512
# type: host
# uid: 8f23a44b-d9d2-4242-8a9e-2a4cbb6723ff
# 3. Gather ALL threat-layer config with DESC order filter
- name: Gather All hosts on the MGMT instance
check_point.mgmt.cp_mgmt_hosts:
config:
details_level: full
state: gathered
# RUN output:
# -----------
# gathered:
# - domain:
# domain-type: domain
# name: SMC User
# uid: 41e821a0-3720-11e3-aa6e-0800200c9fde
# ipv4-address: 192.0.2.1
# name: New Host 1
# type: host
# uid: 8f23a44b-d9d2-4242-8a9e-2a4cbb6723ff
# Using DELETED state
# -------------------
- name: Delete MGMT Host config by Name
check_point.mgmt.cp_mgmt_hosts:
state: deleted
config:
name: New Host 1
round_trip: true
# RUN output:
# -----------
# mgmt_hosts:
# after: {}
# before:
# color: cyan
# comments: REPLACED description
# groups: []
# icon: Objects/host
# interfaces: []
# ipv4-address: 192.0.2.1
# name: New Host 1
# nat_settings: {}
# tags:
# - New Host