【发布时间】:2020-10-29 18:04:50
【问题描述】:
尽管我正确地遵循了YAML tutorial(用于格式化 YAML 文件)和来自官方 ansible 文档的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
错误:
[本地主机]:失败! => {"changed": false, "msg": "协议的值必须是以下之一:Udp, Tcp, *, got: TCP found in rules"}
【问题讨论】: