fortinet.fortimanager.fmgr_system_admin_profile 模块 – 管理员配置文件。

注意

此模块是 fortinet.fortimanager 集合(版本 2.8.2)的一部分。

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

要安装它,请使用:ansible-galaxy collection install fortinet.fortimanager

要在 playbook 中使用它,请指定:fortinet.fortimanager.fmgr_system_admin_profile

fortinet.fortimanager 2.0.0 中的新增功能

概要

  • 此模块能够配置 FortiManager 设备。

  • 示例包括所有参数和值,这些参数和值在使用前需要调整为数据源。

参数

参数

注释

access_token

字符串

用于在不使用用户名和密码的情况下访问 FortiManager 的令牌。

bypass_validation

布尔值

仅当模块模式与 FortiManager API 结构不同时才设置为 True,模块将继续执行而不验证参数。

选择

  • false ← (默认)

  • true

enable_log

布尔值

启用/禁用任务日志记录。

选择

  • false ← (默认)

  • true

forticloud_access_token

字符串

使用 forticloud API 访问令牌验证 Ansible 客户端。

proposed_method

字符串

底层 Json RPC 请求的覆盖方法。

选择

  • "update"

  • "set"

  • "add"

rc_failed

列表 / elements=整数

将覆盖失败条件的 rc 代码列表。

rc_succeeded

列表 / elements=整数

将覆盖成功条件的 rc 代码列表。

state

字符串 / 必需

用于创建、更新或删除对象的指令。

选择

  • "present"

  • "absent"

system_admin_profile

字典

设置的顶级参数。

adom_admin

别名: adom-admin

字符串

启用 Adom 管理员。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

adom_lock

别名: adom-lock

字符串

ADOM 锁定

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

adom_policy_packages

别名: adom-policy-packages

字符串

ADOM 策略包。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

adom_switch

别名: adom-switch

字符串

管理员域。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

allow_to_install

别名: allow-to-install

字符串

启用/禁用受限用户将对象安装到设备。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

app_filter

别名: app-filter

字符串

应用过滤器。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

assignment

字符串

分配权限。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

change_password

别名: change-password

字符串

启用/禁用受限用户更改自己的密码。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

config_retrieve

别名: config-retrieve

字符串

配置检索。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

config_revert

别名: config-revert

字符串

从修订历史还原配置

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

consistency_check

别名: consistency-check

字符串

一致性检查。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

datamask

字符串

启用/禁用数据屏蔽。

disable - 禁用数据屏蔽。

enable - 启用数据屏蔽。

选择

  • "disable"

  • "enable"

datamask_custom_fields

别名: datamask-custom-fields

列表 / elements=字典

数据屏蔽自定义字段。

field_category

别名: field-category

列表 / elements=字符串

字段类别。

log - 日志。

fortiview - FortiView。

alert - 事件管理。

ueba - UEBA。

all - 全部。

选择

  • "log"

  • "fortiview"

  • "alert"

  • "ueba"

  • "all"

field_name

别名: field-name

字符串

字段名称。

field_status

别名: field-status

字符串

字段状态。

disable - 禁用字段。

enable - 启用字段。

选择

  • "disable"

  • "enable"

field_type

别名: field-type

字符串

字段类型。

string - 字符串。

ip - IP。

mac - MAC 地址。

email - 电子邮件地址。

unknown - 未知。

选择

  • "string"

  • "ip"

  • "mac"

  • "email"

  • "unknown"

datamask_custom_priority

别名: datamask-custom-priority

字符串

确定自定义字段的优先级。

disable - 禁用自定义字段搜索优先级。

enable - 启用自定义字段搜索优先级。

选择

  • "disable"

  • "enable"

datamask_fields

别名: datamask-fields

列表 / elements=字符串

数据屏蔽字段。

user - 用户名。

srcip - 源 IP 地址。

srcname - 源名称。

srcmac - 源 MAC 地址。

dstip - 目标 IP 地址。

dstname - 目标名称。

email - 电子邮件。

message - 消息。

domain - 域名。

选择

  • "user" - “用户”

  • "srcip" - “源IP”

  • "srcname" - “源名称”

  • "srcmac" - “源MAC”

  • "dstip" - “目标IP”

  • "dstname" - “目标名称”

  • "email"

  • "message" - “消息”

  • "domain" - “域名”

datamask_key

aliases: datamask-key

any

(list) 数据掩码加密密钥。

datamask_unmasked_time

aliases: datamask-unmasked-time

integer

不进行数据掩码的天数。

deploy_management

aliases: deploy-management

字符串

安装到设备。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

description

字符串

描述。

device_ap

aliases: device-ap

字符串

管理 AP。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_config

aliases: device-config

字符串

管理设备配置。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_forticlient

aliases: device-forticlient

字符串

管理 FortiClient。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_fortiextender

aliases: device-fortiextender

字符串

管理 FortiExtender。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_fortiswitch

aliases: device-fortiswitch

字符串

管理 FortiSwitch。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_manager

aliases: device-manager

字符串

设备管理器。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_op

aliases: device-op

字符串

设备添加/删除/编辑。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_policy_package_lock

aliases: device-policy-package-lock

字符串

设备/策略包锁定

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_profile

aliases: device-profile

字符串

设备配置文件权限。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_revision_deletion

aliases: device-revision-deletion

字符串

删除设备修订版本。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

device_wan_link_load_balance

aliases: device-wan-link-load-balance

字符串

管理 WAN 链路负载均衡。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

event_management

aliases: event-management

字符串

事件管理。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

extension_access

aliases: extension-access

字符串

管理扩展访问。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fabric_viewer

aliases: fabric-viewer

字符串

Fabric 查看器。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fgd_center

字符串

FortiGuard 中心。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fgd_center_advanced

aliases: fgd-center-advanced

字符串

FortiGuard 中心高级。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fgd_center_fmw_mgmt

aliases: fgd-center-fmw-mgmt

字符串

FortiGuard 中心固件管理。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fgd_center_licensing

aliases: fgd-center-licensing

字符串

FortiGuard 中心许可。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

fgt_gui_proxy

aliases: fgt-gui-proxy

字符串

FortiGate GUI 代理。

disable - 无权限。

enable - 有权限。

选择

  • "disable"

  • "enable"

global_policy_packages

aliases: global-policy-packages

字符串

全局策略包。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

import_policy_packages

aliases: import-policy-packages

字符串

导入策略包。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

intf_mapping

aliases: intf-mapping

字符串

接口映射

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

ips_baseline_cfg

aliases: ips-baseline-cfg

字符串

IPS 基线传感器配置。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

ips_baseline_ovrd

aliases: ips-baseline-ovrd

字符串

启用/禁用覆盖基线 IPS 传感器。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

ips_filter

aliases: ips-filter

字符串

IPS 过滤器。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

ips_lock

aliases: ips-lock

字符串

IPS 锁定

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

ips_objects

aliases: ips-objects

字符串

IPS 对象配置。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

ipv6_trusthost1

字符串

管理员用户可信主机 IPv6,默认值。

ipv6_trusthost10

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost2

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost3

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost4

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost5

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost6

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost7

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost8

字符串

管理员用户可信主机 IPv6,默认值 ffff。

ipv6_trusthost9

字符串

管理员用户可信主机 IPv6,默认值 ffff。

log_viewer

aliases: log-viewer

字符串

日志查看器。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

policy_ips_attrs

aliases: policy-ips-attrs

字符串

策略 IPS 属性配置。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

policy_objects

aliases: policy-objects

字符串

策略对象权限。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

profileid

字符串 / 必需

配置文件 ID。

read_passwd

aliases: read-passwd

字符串

以明文查看密码。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

realtime_monitor

aliases: realtime-monitor

字符串

实时监控。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

report_viewer

aliases: report-viewer

字符串

报表查看器。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

rpc_permit

aliases: rpc-permit

字符串

设置 none/read/read-write RPC 权限。

read-write - 读取-写入权限。

none - 无权限。

read - 只读权限。

选择

  • "read-write"

  • "none"

  • "read"

run_report

aliases: run-report

字符串

运行报表。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

scope

字符串

范围。

global - 全局范围。

adom - ADOM 范围。

选择

  • "global" - “全局”

  • "adom" - “ADOM”

script_access

aliases: script-access

字符串

脚本访问。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

set_install_targets

aliases: set-install-targets

字符串

编辑安装目标。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

super_user_profile

aliases: super-user-profile

字符串

启用/禁用超级用户配置文件

disable - 禁用超级用户配置文件

enable - 启用超级用户配置文件

选择

  • "disable"

  • "enable"

system_setting

aliases: system-setting

字符串

系统设置。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

term_access

aliases: term-access

字符串

终端访问。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

triage_events

aliases: triage-events

字符串

分类事件。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

trusthost1

字符串

管理员用户可信主机 IP,默认值 0。

trusthost10

字符串

管理员用户可信主机 IP,默认值 255。

trusthost2

字符串

管理员用户可信主机 IP,默认值 255。

trusthost3

字符串

管理员用户可信主机 IP,默认值 255。

trusthost4

字符串

管理员用户可信主机 IP,默认值 255。

trusthost5

字符串

管理员用户可信主机 IP,默认值 255。

trusthost6

字符串

管理员用户可信主机 IP,默认值 255。

trusthost7

字符串

管理员用户可信主机 IP,默认值 255。

trusthost8

字符串

管理员用户可信主机 IP,默认值 255。

trusthost9

字符串

管理员用户可信主机 IP,默认值 255。

type

字符串

配置文件类型。

system - 系统管理员。

restricted - 受限管理员。

选择

  • "system" - “系统”

  • "restricted" - “受限”

update_incidents

aliases: update-incidents

字符串

创建/更新事件。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

vpn_manager

aliases: vpn-manager

字符串

VPN 管理器。

none - 无权限。

read - 读取权限。

read-write - 读取-写入权限。

选择

  • "none"

  • "read"

  • "read-write"

web_filter

aliases: web-filter

字符串

Web 过滤器。

disable - 禁用设置。

enable - 启用设置。

选择

  • "disable"

  • "enable"

write_passwd_access

aliases: write-passwd-access

字符串

设置所有/按用户指定/按配置文件指定写入密码访问模式。

all - 除了超级用户之外的所有用户。

specify-by-user - 按用户指定。

specify-by-profile - 按配置文件指定。

选择

  • "all"

  • "specify-by-user" - “按用户指定”

  • "specify-by-profile" - “按配置文件指定”

write_passwd_profiles

aliases: write-passwd-profiles

列表 / elements=字典

写入密码配置文件。

profileid

字符串

配置文件 ID。

write_passwd_user_list

aliases: write-passwd-user-list

列表 / elements=字典

写入密码用户列表。

userid

字符串

用户 ID。

workspace_locking_adom

字符串

在工作区模式下运行的 FortiManager 要锁定的 ADOM,该值可以是 global 和其他值,包括 root。

workspace_locking_timeout

integer

等待其他用户释放工作区锁定的最长时间(以秒为单位)。

Default: 300

Notes

注意

  • 从 2.4.0 版本开始,所有输入参数都使用下划线命名约定 (snake_case) 命名。请将参数(例如“var-name”)更改为“var_name”。旧的参数名称仍然可用,但您将收到弃用警告。您可以在 ansible.cfg 中设置 deprecation_warnings=False 来忽略此警告。

  • 此 FortiManager 模块支持在工作区锁定模式下运行,顶层参数 workspace_locking_adom 和 workspace_locking_timeout 可以帮助完成这项工作。

  • 要创建或更新对象,请使用 state present 指令。

  • 要删除对象,请使用 state absent 指令。

  • 通常,当返回非零 rc 时,运行一个模块可能会失败。您还可以使用参数 rc_failed 和 rc_succeeded 覆盖失败或成功的条件

Examples

- name: Example playbook
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Admin profile.
      fortinet.fortimanager.fmgr_system_admin_profile:
        bypass_validation: false
        state: present
        system_admin_profile:
          description: ansible-test-description
          profileid: ansible-test-profile
          scope: adom # <value in [global, adom]>
          type: system # <value in [system, restricted]>

- name: Gathering fortimanager facts
  hosts: fortimanagers
  gather_facts: false
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Retrieve all the admin profiles
      fortinet.fortimanager.fmgr_fact:
        facts:
          selector: "system_admin_profile"
          params:
            profile: "your_value"

Return Values

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

Key

描述

meta

字典

请求的结果。

Returned: always

request_url

字符串

请求的完整 URL。

Returned: always

Sample: "/sys/login/user"

response_code

integer

api 请求的状态。

Returned: always

示例: 0

response_data

列表 / elements=字符串

api 响应。

Returned: always

response_message

字符串

api 响应的描述性消息。

Returned: always

示例: "OK."

system_information

字典

目标系统的信息。

Returned: always

rc

integer

请求的状态。

Returned: always

示例: 0

version_check_warning

列表 / elements=字符串

如果 playbook 中使用的参数不被当前 FortiManager 版本支持,则会发出警告。

返回: 复杂类型

作者

  • Xinwei Du (@dux-fortinet)

  • Xing Li (@lix-fortinet)

  • Jie Xue (@JieX19)

  • Link Zheng (@chillancezen)

  • Frank Shen (@fshen01)

  • Hongbin Lu (@fgtdev-hblu)