微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何使用防火墙DSC资源使用Puppet创建防火墙规则?

如何解决如何使用防火墙DSC资源使用Puppet创建防火墙规则?

我想创建一个类,该类在我的VM上创建新的防火墙规则。 我正在尝试利用DSC资源-防火墙。 我当前的课程位于新的win_basic_firewall.pp中,看起来像这样

$('.MyDivs').on('mouseenter mouseleave click',function(e) {
    sameOperation();
});

我有一个列出我的规则的json配置文件。我目前有这个:

class osconfig::win_basic_firewall {
  if $dscmoduLeversion != '' {
      $module = {
          'name'    => 'networkingdsc','version' => $dscmoduLeversion,}
  }else{
      $module = 'networkingdsc'
  }
  $fwallow = lookup('myfirewall')

  $fwallow.each |String $fwname,$rule|{
      dsc { $fwname : 
      require       => Dsc['PSModule networkingdsc'],resource_name => 'Firewall',module        => $module,properties    => {
          * => $rule
      },}
  }
}

清单文件中只有一行

"myfirewall":{
        "Newtestrule":{
            "Name":"RDP test","Action": "Allow","Description": "This will allow RDP only from my IP","displayName": "My TEST rule RDP","Direction": "Inbound","Enabled":"True","Encryption": "Notrequired","Ensure": "Present","LocalPort": ["3389"],"RemoteAddress": ["xx.xx.xx.xx/xx"],"Protocol": "TCP"
        }
    },

当我的人偶代理在VM上运行时,我得到的是:

include osconfig::win_basic_firewall

...恰好是通过喷溅的那一行

win_basic_firewall.pp,line: 18,column: 13

我该怎么办?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。