vmware-archive / vmware-vcenter

VMware vCenter Module
Other
87 stars 102 forks source link

New type to manage ESX firewall rulesets. #206

Closed crayfishx closed 8 years ago

crayfishx commented 8 years ago

Summary

This PR introduces a new resource type and provider to manage ESX firewall rulesets on a host, it supports enabling and disabling the ruleset and adding and removing allowed hosts.

Smoke testing/examples....

Esx_firewall_ruleset {
  path      => '/vc1/vc.dc',
  transport => Transport['vcenter'],
}

esx_firewall_ruleset { '192.168.245.212:ntpClient':
  ensure        => 'enabled',
  allowed_hosts => 'all',
}
Notice: /Stage[main]/Main/Esx_firewall_ruleset[192.168.245.212:ntpClient]/ensure: ensure changed 'disabled' to 'enabled'
esx_firewall_ruleset { '192.168.245.212:ntpClient':
  ensure        => enabled,
  allowed_hosts => [
    "10.0.0.1",
    "192.168.100.0/24"
  ],
}
Notice: /Stage[main]/Main/Esx_firewall_ruleset[192.168.245.212:ntpClient]/allowed_hosts: allowed_hosts changed 'all' to '10.0.0.1 192.168.100.0/24'
esx_firewall_ruleset { '192.168.245.212:ntpClient':
  ensure        => disabled
}
Notice: /Stage[main]/Main/Esx_firewall_ruleset[192.168.245.212:ntpClient]/ensure: ensure changed 'enabled' to 'disabled'
esx_firewall_ruleset { 'random title':
  ensure        => enabled,
  name          => 'ntpClient',
  host          => '192.168.245.212',
  allowed_hosts => 'all',
}
Notice: /Stage[main]/Main/Esx_firewall_ruleset[random title]/ensure: ensure changed 'disabled' to 'enabled'
ggeldenhuis commented 8 years ago

This is really cool, looking forward in using it.