fortinet.fortimanager.fmgr_system_passwordpolicy 模块 – 密码策略。
注意
此模块是 fortinet.fortimanager 集合 (版本 2.8.2) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install fortinet.fortimanager。
要在playbook中使用它,请指定: fortinet.fortimanager.fmgr_system_passwordpolicy。
fortinet.fortimanager 2.0.0 中的新增功能
概要
- 此模块能够配置FortiManager设备。 
- 示例包含所有需要在使用前调整为数据源的参数和值。 
参数
| 参数 | 注释 | 
|---|---|
| 无需用户名和密码即可访问FortiManager的令牌。 | |
| 仅当模块模式与FortiManager API结构不同时设置为True,模块将继续执行而无需验证参数。 选项 
 | |
| 启用/禁用任务日志记录。 选项 
 | |
| 使用FortiCloud API访问令牌对Ansible客户端进行身份验证。 | |
| 底层Json RPC请求的覆盖方法。 选项 
 | |
| 将覆盖失败条件的rc代码列表。 | |
| 将覆盖成功条件的rc代码列表。 | |
| 设置的顶级参数。 | |
| 启用/禁用更改新密码至少4个字符。 disable - 禁用更改新密码至少4个字符。 enable - 启用更改新密码至少4个字符。 选项 
 | |
| 管理员用户密码过期的天数 | |
| 最小密码长度。 | |
| 密码字符要求。 upper-case-letter - 要求密码包含大写字母。 lower-case-letter - 要求密码包含小写字母。 number - 要求密码包含数字。 non-alphanumeric - 要求密码包含非字母数字字符。 选项 
 | |
| 在可以使用旧密码之前必须使用的唯一新密码数量 | |
| 启用/禁用密码策略。 disable - 禁用密码策略。 enable - 启用密码策略。 选项 
 | |
| 在工作区模式下运行FortiManager时要锁定的ADOM,该值可以是全局的和其他值,包括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: Password policy.
      fortinet.fortimanager.fmgr_system_passwordpolicy:
        # 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, ...]
        system_passwordpolicy:
          change_4_characters: <value in [disable, enable]>
          expire: <integer>
          minimum_length: <integer>
          must_contain:
            - "upper-case-letter"
            - "lower-case-letter"
            - "number"
            - "non-alphanumeric"
          status: <value in [disable, enable]>
          password_history: <integer>
返回值
常见的返回值已记录在 此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 请求的结果。 返回:始终 | |
| 请求的完整URL。 返回:始终 示例:  | |
| API请求的状态。 返回:始终 示例:  | |
| API响应。 返回:始终 | |
| API响应的描述性消息。 返回:始终 示例:  | |
| 目标系统的信息。 返回:始终 | |
| 请求的状态。 返回:始终 示例:  | |
| 如果playbook中使用的参数不受当前FortiManager版本支持,则会发出警告。 返回:复杂类型 | 
