【发布时间】:2020-10-29 20:46:08
【问题描述】:
在 YAML playbook 之后创建 Azure Network Security Group 确实指定了 priority 参数。但是在Azure Cloud Shell 中运行剧本时仍然出现以下错误。错误的原因可能是什么?我们该如何解决?
备注:我在GitHubhere看到一个类似的问题。
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": "missing required arguments: priority found in rules"}
【问题讨论】: