ansible - 无法创建 Azure 网络安全组

ansible - unable to create Azure network security group

虽然我正确地遵循了官方 ansible 文档中的这个 YAML tutorial (for formatting a YAML file) and this ansible example 来使用以下 ansible playbook 创建一个 Azure Network Security Group。但是当我 运行 Azure Cloud Shell 中的剧本时,我得到如下所示的错误:

Create_network_security_group.yaml:

---
- hosts: localhost

  tasks:
  - azure_rm_securitygroup:
      resource_group: rg-cs-ansible
      name: nsg-cs-web
      rules:
          - name: 'allow_rdp'
            protocol: TCP
            destination_port_range: 3389
            access: Allow
            priority: 1001
            direction: Inbound
          - name: 'allow_web_traffic'
            protocol: TCP
            destination_port_range:
              - 80
              - 443
            access: Allow
            priority: 1002
            direction: Inbound
          - name: 'allow_powershell_remoting'
            protocol: TCP
            destination_port_range:
              - 5985
              - 5986

错误:

[localhost]: FAILED! => {"changed": false, "msg": "value of protocol must be one of: Udp, Tcp, *, got: TCP found in rules"}

基于 this URL 上的官方和“最新”文档。注意这个例子,协议的大小写是“Tcp”,而不是“TCP

此外,您分享的错误消息还建议使用 TcpUdp* 作为可能的输入,它得到了 TCP.

[localhost]: FAILED! => {"changed": false, "msg": "value of protocol must be one of: Udp, Tcp, *, got: TCP found in rules"}