check_point.mgmt.cp_mgmt_time 模块 – 通过 Web Services API 管理 Check Point 上的时间对象

注意

此模块是 check_point.mgmt 集合 (版本 6.2.1) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install check_point.mgmt

要在 playbook 中使用它,请指定:check_point.mgmt.cp_mgmt_time

check_point.mgmt 1.0.0 中的新增功能

概要

  • 管理 Check Point 设备上的时间对象,包括创建、更新和删除对象。

  • 所有操作均通过 Web Services API 执行。

参数

参数

注释

auto_publish_session

布尔值

如果任务完成后已执行更改,则发布当前会话。

选项

  • false ← (默认)

  • true

color

字符串

对象的颜色。应为现有颜色之一。

选项

  • "aquamarine"

  • "black"

  • "blue"

  • "crete blue"

  • "burlywood"

  • "cyan"

  • "dark green"

  • "khaki"

  • "orchid"

  • "dark orange"

  • "dark sea green"

  • "pink"

  • "turquoise"

  • "dark blue"

  • "firebrick"

  • "brown"

  • "forest green"

  • "gold"

  • "dark gold"

  • "gray"

  • "dark gray"

  • "light green"

  • "lemon chiffon"

  • "coral"

  • "sea green"

  • "sky blue"

  • "magenta"

  • "purple"

  • "slate blue"

  • "violet red"

  • "navy blue"

  • "olive"

  • "orange"

  • "red"

  • "sienna"

  • "yellow"

comments

字符串

注释字符串。

details_level

字符串

响应中某些字段的详细级别可以变化,从仅显示对象的 UID 值到对象的完全详细表示。

选项

  • "uid"

  • "standard"

  • "full"

end

字典

结束时间。注意,每个网关可能会根据其时区以不同的方式解释此时间。

date

字符串

日期格式为 dd-MMM-yyyy。

iso_8601

字符串

以国际 ISO 8601 格式表示的日期和时间。时区信息将被忽略。

posix

整数

自 1970 年 1 月 1 日 00:00:00 以来经过的毫秒数。

time

字符串

时间格式为 HH:mm。

end_never

布尔值

永不结束。

选项

  • false

  • true

groups

列表 / 元素=字符串

组标识符集合。

hours_ranges

列表 / 元素=字典

小时重复。注意,每个网关可能会根据其时区以不同的方式解释此时间。

enabled

布尔值

小时范围是否启用。

选项

  • false

  • true

from

字符串

时间格式为 HH:MM。

index

整数

小时范围索引。

to

字符串

时间格式为 HH:MM。

ignore_errors

布尔值

忽略错误应用更改。您将无法发布此类更改。如果忽略警告标志被忽略,则警告也将被忽略。

选项

  • false

  • true

ignore_warnings

布尔值

忽略警告应用更改。

选项

  • false

  • true

name

字符串 / 必填

对象名称。

recurrence

字典

天数重复。

days

列表 / 元素=字符串

在特定日期有效。多个选项,支持月份中的日期范围。例如,[“1”、“3”、“9-20”]。

month

字符串

在月份有效。例如,“1”、“2”、“12”、“任意”。

pattern

字符串

在“每日”、“每周”、“每月”基础上有效。

weekdays

列表 / 元素=字符串

在工作日有效。例如,“Sun”、“Mon”……“Sat”。

start

字典

开始时间。注意,每个网关可能会根据其时区以不同的方式解释此时间。

date

字符串

日期格式为 dd-MMM-yyyy。

iso_8601

字符串

以国际 ISO 8601 格式表示的日期和时间。时区信息将被忽略。

posix

整数

自 1970 年 1 月 1 日 00:00:00 以来经过的毫秒数。

time

字符串

时间格式为 HH:mm。

start_now

布尔值

立即开始。

选项

  • false

  • true

state

字符串

访问规则的状态(存在或不存在)。

选项

  • "present" ← (默认)

  • "absent"

tags

列表 / 元素=字符串

标签标识符集合。

version

字符串

checkpoint 版本。如果未给出版本,则采用最新版本。

wait_for_task

布尔值

等待任务结束。例如发布任务。

选项

  • false

  • true ← (默认)

wait_for_task_timeout

整数

在抛出超时错误之前等待多少分钟。

默认: 30

示例

- name: add-time
  cp_mgmt_time:
    end:
      date: 24-Nov-2014
      time: '21:22'
    end_never: 'false'
    hours_ranges:
    - enabled: true
      from: 00:00
      index: 1
      to: 00:00
    - enabled: false
      from: 00:00
      index: 2
      to: 00:00
    name: timeObject1
    recurrence:
      days:
      - '1'
      month: Any
      pattern: Daily
      weekdays:
      - Sun
      - Mon
    start_now: 'true'
    state: present

- name: set-time
  cp_mgmt_time:
    hours_ranges:
    - from: 00:22
      to: 00:33
    name: timeObject1
    recurrence:
      month: Any
      pattern: Weekly
      weekdays:
      - Fri
    state: present

- name: delete-time
  cp_mgmt_time:
    name: timeObject1
    state: absent

返回值

常见的返回值已在 此处 记录,以下是此模块独有的字段

描述

cp_mgmt_time

字典

已创建或更新的检查点对象。

返回:始终返回,除非删除对象。

作者

  • Or Soffer (@chkp-orso)