fortinet.fortimanager.fmgr_fsp_vlan_dhcpserver 模块 – 配置 DHCP 服务器。
注意
此模块是 fortinet.fortimanager 集合 (版本 2.8.2) 的一部分。
如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager。
要在 playbook 中使用它,请指定: fortinet.fortimanager.fmgr_fsp_vlan_dhcpserver。
fortinet.fortimanager 2.0.0 中的新增功能
概要
- 此模块能够配置 FortiManager 设备。 
- 示例包括所有需要在使用前调整为数据源的参数和值。 
参数
| 参数 | 注释 | 
|---|---|
| 无需用户名和密码即可访问 FortiManager 的令牌。 | |
| 请求 URL 中的参数 (adom)。 | |
| 仅当模块模式与 FortiManager API 结构不同时设置为 True,模块将继续执行而无需验证参数。 选项 
 | |
| 启用/禁用任务日志记录。 选项 
 | |
| 使用 FortiCloud API 访问令牌对 Ansible 客户端进行身份验证。 | |
| 设置的顶级参数。 | |
| 自动配置。 选项 
 | |
| 自动管理状态。 选项 
 | |
| 冲突 IP 超时。 | |
| DDNS 认证。 选项 
 | |
| (列表或字符串) DDNS 密钥。 | |
| DDNS 密钥名称。 | |
| DDNS 服务器 IP。 | |
| DDNS TTL。 | |
| DDNS 更新。 选项 
 | |
| DDNS 更新覆盖。 选项 
 | |
| DDNS 区域。 | |
| 默认网关。 | |
| 来自 FortiIPAM 的 DHCP 设置。 选项 
 | |
| DNS 服务器 1。 | |
| DNS 服务器 2。 | |
| DNS 服务器 3。 | |
| DNS 服务器 4。 | |
| DNS 服务。 选项 
 | |
| 域名。 | |
| 启用。 选项 
 | |
| 排除范围。 | |
| 结束IP。 | |
| ID。 | |
| 租期时间(秒),0表示默认租期时间。 | |
| 起始IP。 | |
| 启用/禁用用户类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的UCI字符串。 | |
| 启用/禁用供应商类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的VCI字符串。 | |
| 文件名。 | |
| FortiClient网络状态。 选项 
 | |
| ID。 | |
| 接口。 | |
| IP模式。 选项 
 | |
| IP范围。 | |
| 结束IP。 | |
| ID。 | |
| 租期时间(秒),0表示默认租期时间。 | |
| 起始IP。 | |
| 启用/禁用用户类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的UCI字符串。 | |
| 启用/禁用供应商类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的VCI字符串。 | |
| IPsec租期保持时间。 | |
| 租期时间。 | |
| MAC ACL默认动作。 选项 
 | |
| 子网掩码。 | |
| 下一跳服务器。 | |
| NTP服务器1。 | |
| NTP服务器2。 | |
| NTP服务器3。 | |
| NTP服务。 选项 
 | |
| (列表)Option1。 | |
| (列表)Option2。 | |
| (列表)Option3。 | |
| Option4。 | |
| Option5。 | |
| Option6。 | |
| 选项。 | |
| 代码。 | |
| ID。 | |
| (列表)IP。 | |
| 类型。 选项 
 | |
| 启用/禁用用户类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的UCI字符串。 | |
| 值。 | |
| 启用/禁用供应商类标识符 选项 
 | |
| (列表)用空格分隔的一个或多个用引号括起来的VCI字符串。 | |
| 中继代理IP。 | |
| 保留地址。 | |
| 动作。 选项 
 | |
| 电路ID。 | |
| 电路ID类型。 选项 
 | |
| 描述。 | |
| ID。 | |
| IP。 | |
| MAC地址。 | |
| 远程ID。 | |
| 远程ID类型。 选项 
 | |
| 类型。 选项 
 | |
| 服务器类型。 选项 
 | |
| 启用/禁用共享子网。 选项 
 | |
| 状态。 选项 
 | |
| (列表)TFTP服务器。 | |
| 时区。 选项 
 | |
| 时区选项。 选项 
 | |
| VCI匹配。 选项 
 | |
| (列表)VCI字符串。 | |
| Wifi AC1。 | |
| Wifi AC2。 | |
| Wifi AC3。 | |
| Wifi AC服务。 选项 
 | |
| WINS服务器1。 | |
| WINS服务器2。 | |
| 底层Json RPC请求的覆盖方法。 选项 
 | |
| 将被覆盖的失败条件的RC代码列表。 | |
| 将被覆盖的成功条件的RC代码列表。 | |
| 请求URL中的参数(vlan)。 | |
| 在工作区模式下运行FortiManager时要锁定的ADOM,值可以是global和其他包括root。 | |
| 等待其他用户释放工作区锁的最大时间(秒)。 默认值:  | 
注释
注意
- 从2.4.0版本开始,所有输入参数都使用下划线命名约定(snake_case)。请将诸如“var-name”之类的参数更改为“var_name”。旧的参数名仍然可用,但您会收到弃用警告。您可以通过在ansible.cfg中设置deprecation_warnings=False来忽略此警告。 
- 此FortiManager模块支持在工作区锁定模式下运行,顶级参数workspace_locking_adom和workspace_locking_timeout有助于完成这项工作。 
- 通常,当返回非零RC时,运行一个模块可能会失败。您还可以使用参数rc_failed和rc_succeeded覆盖失败或成功的条件。 
示例
- name: Example playbook (generated based on argument schema)
  hosts: fortimanagers
  connection: httpapi
  vars:
    ansible_httpapi_use_ssl: true
    ansible_httpapi_validate_certs: false
    ansible_httpapi_port: 443
  tasks:
    - name: Configure DHCP servers.
      fortinet.fortimanager.fmgr_fsp_vlan_dhcpserver:
        # bypass_validation: false
        workspace_locking_adom: <value in [global, custom adom including root]>
        workspace_locking_timeout: 300
        # rc_succeeded: [0, -2, -3, ...]
        # rc_failed: [-2, -3, ...]
        adom: <your own value>
        vlan: <your own value>
        fsp_vlan_dhcpserver:
          auto_configuration: <value in [disable, enable]>
          conflicted_ip_timeout: <integer>
          ddns_auth: <value in [disable, tsig]>
          ddns_key: <list or string>
          ddns_keyname: <string>
          ddns_server_ip: <string>
          ddns_ttl: <integer>
          ddns_update: <value in [disable, enable]>
          ddns_update_override: <value in [disable, enable]>
          ddns_zone: <string>
          default_gateway: <string>
          dns_server1: <string>
          dns_server2: <string>
          dns_server3: <string>
          dns_service: <value in [default, specify, local]>
          domain: <string>
          enable: <value in [disable, enable]>
          exclude_range:
            -
              end_ip: <string>
              id: <integer>
              start_ip: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              lease_time: <integer>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          filename: <string>
          forticlient_on_net_status: <value in [disable, enable]>
          id: <integer>
          interface: <string>
          ip_mode: <value in [range, usrgrp]>
          ip_range:
            -
              end_ip: <string>
              id: <integer>
              start_ip: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              lease_time: <integer>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          ipsec_lease_hold: <integer>
          lease_time: <integer>
          mac_acl_default_action: <value in [assign, block]>
          netmask: <string>
          next_server: <string>
          ntp_server1: <string>
          ntp_server2: <string>
          ntp_server3: <string>
          ntp_service: <value in [default, specify, local]>
          option1: <list or string>
          option2: <list or string>
          option3: <list or string>
          option4: <string>
          option5: <string>
          option6: <string>
          options:
            -
              code: <integer>
              id: <integer>
              ip: <list or string>
              type: <value in [hex, string, ip, ...]>
              value: <string>
              vci_match: <value in [disable, enable]>
              vci_string: <list or string>
              uci_match: <value in [disable, enable]>
              uci_string: <list or string>
          reserved_address:
            -
              action: <value in [assign, block, reserved]>
              circuit_id: <string>
              circuit_id_type: <value in [hex, string]>
              description: <string>
              id: <integer>
              ip: <string>
              mac: <string>
              remote_id: <string>
              remote_id_type: <value in [hex, string]>
              type: <value in [mac, option82]>
          server_type: <value in [regular, ipsec]>
          status: <value in [disable, enable]>
          tftp_server: <list or string>
          timezone: <value in [00, 01, 02, ...]>
          timezone_option: <value in [disable, default, specify]>
          vci_match: <value in [disable, enable]>
          vci_string: <list or string>
          wifi_ac1: <string>
          wifi_ac2: <string>
          wifi_ac3: <string>
          wins_server1: <string>
          wins_server2: <string>
          dns_server4: <string>
          wifi_ac_service: <value in [specify, local]>
          auto_managed_status: <value in [disable, enable]>
          dhcp_settings_from_fortiipam: <value in [disable, enable]>
          relay_agent: <string>
          shared_subnet: <value in [disable, enable]>
返回值
公共返回值已在此处记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 请求的结果。 返回:始终 | |
| 请求的完整URL。 返回:始终 示例:  | |
| API请求的状态。 返回:始终 示例:  | |
| API响应。 返回:始终 | |
| API 响应的描述性消息。 返回:始终 示例:  | |
| 目标系统的信息。 返回:始终 | |
| 请求的状态。 返回:始终 示例:  | |
| 如果剧本中使用的参数不受当前 FortiManager 版本支持,则会发出警告。 返回: complex | 
