klarna/vagrant-cloudstack — pull request #24 by nicolasbrechet (2013-12-23 22:25:02+00:00)
Title: [Basic Networking] New Security Groups can be created from Vagrantfile

It's easier if the Security Group can be defined in the Vagrantfile.
For example like this:

```ruby
[...]
config.vm.provider :cloudstack do |cloudstack, override|
cloudstack.host = "api.exoscale.ch"
cloudstack.path = "/compute"
cloudstack.port = "443"
cloudstack.scheme = "https"
cloudstack.keypair = "exoscale"

cloudstack.api_key = "your_api_key"
cloudstack.secret_key = "your_secret_key"

cloudstack.template_id = "a17b40d6-83e4-4f2a-9ef0-dce6af575789" #Ubuntu 12.04
cloudstack.service_offering_id = "71004023-bb72-4a97-b1e9-bc66dfce9470" # Micro instance with 10GB disk
cloudstack.zone_id = "1128bd56-b4d9-4ac6-a7b9-c715b187ce11" #GV2
cloudstack.network_type = "Basic"
cloudstack.security_groups = [
{
:name => "common",
:description => "created in the Vagrantfile",
:rules => [
{:type => "ingress", :protocol => "TCP", :startport => 22, :endport => 22, :cidrlist => "0.0.0.0/0"},
{:type => "egress", :protocol => "TCP", :startport => 23, :endport => 23, :cidrlist => "0.0.0.0/0"}
]
},
{ :name => "test",
:description => "Also created in Vagrantfile",
:rules => [
{:type => "ingress", :protocol => "TCP", :startport => 80, :endport => 80, :cidrlist => "0.0.0.0/0"},
{:type => "ingress", :protocol => "TCP", :startport => 443, :endport => 443, :cidrlist => "0.0.0.0/0"},
{:type => "egress", :protocol => "TCP", :startport => 8080, :endport => 8080, :cidrlist => "0.0.0.0/0"}
]
}
]
end

[...]
```

Tested with cloud provider exoscale.ch but I haven't been able to test if there's any impact when using Advanced Networking.