check_point.mgmt.cp_mgmt_run_script 模块 – 在给定的目标列表上执行脚本。

注意

此模块是 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_run_script

check_point.mgmt 1.0.0 中的新增功能

概要

  • 在给定的目标列表上执行脚本。

  • 所有操作都通过 Web 服务 API 执行。

参数

参数

注释

args

字符串

脚本参数。

auto_publish_session

布尔值

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

选项

  • false ← (默认)

  • true

comments

字符串

注释字符串。

script

字符串

脚本正文。

script_name

字符串

脚本名称。

targets

列表 / 元素=字符串

在哪些目标上执行此命令。目标可以通过其名称或对象唯一标识符来识别。

version

字符串

检查点版本。 如果未给定版本,则采用最新版本。

wait_for_task

布尔值

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

选项

  • false

  • true ← (默认)

wait_for_task_timeout

整数

等待多少分钟后抛出超时错误。

默认: 30

示例

- name: run-script
  cp_mgmt_run_script:
    script: ls -l /
    script_name: 'Script Example: List files under / dir'
    targets:
    - corporate-gateway

返回值

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

描述

cp_mgmt_run_script

字典

检查点运行脚本输出。

返回: 总是。

作者

  • Or Soffer (@chkp-orso)