首页 > 解决方案 > 当策略中有多个服务时,Ansible for Fortigate 策略不起作用

问题描述

我尝试使用 ansible 来创建具有多个服务的防火墙策略并出现错误。就像下面的例子。

如果只有一个服务,比如只有 HTTP,那么 ansible 不会产生任何问题。

有任何想法吗?

        -name: Add Policy
         fortios_firewall_policy:
           vdom: FG-traffic      
           state: "present"       
           firewall_policy:
             name: "test_policy"
             policyid: 0
             action: "accept"
             dstaddr:
              -
               name: "192.168.30.101"
             dstintf: 
              -
               name: "Port2_VLAN30"
             srcaddr: 
              -
               name: "192.168.20.101"
             srcintf: 
              -
               name: "Port1_VLAN20"
             service: 
              -
               name: "HTTP" "HTTPS"
             schedule: "always"
             nat: "enable"

标签: serviceansiblefortigate

解决方案


推荐阅读