Permalink
Browse files

[bat] Add support for OpenStack manual networks

  • Loading branch information...
1 parent e142a52 commit f12939a3ca785702955f14d9861beae4b32894c3 @frodenas frodenas committed Mar 27, 2013
Showing with 86 additions and 6 deletions.
  1. +47 −0 bat/README.md
  2. +39 −6 bat/templates/openstack.yml.erb
View
@@ -72,6 +72,49 @@ properties:
security_groups:
- bat
```
+
+On OpenStack with DHCP:
+```yaml
+---
+cpi: openstack
+properties:
+ static_ip: 54.235.115.62 # floating IP to use for the bat-release jobs
+ uuid: 25569986-a7ed-4529-ba84-8a03e2c6c78f # BAT_DIRECTOR UUID
+ pool_size: 1
+ stemcell:
+ name: bosh-stemcell
+ version: latest
+ instances: 1
+ key_name: bosh # OpenStack key name
+ mbus: nats://nats:0b450ada9f830085e2cdeff6@10.42.49.80:4222 # Not used now, but don't remove
+```
+
+On OpenStack with manual networking (requires Quantum):
+```yaml
+---
+cpi: openstack
+properties:
+ static_ip: 54.235.115.62 # floating IP to use for the bat-release jobs
+ uuid: 25569986-a7ed-4529-ba84-8a03e2c6c78f # BAT_DIRECTOR UUID
+ pool_size: 1
+ stemcell:
+ name: bosh-stemcell
+ version: latest
+ instances: 1
+ key_name: bosh # OpenStack key name
+ mbus: nats://nats:0b450ada9f830085e2cdeff6@10.42.49.80:4222
+ network:
+ cidr: 10.0.1.0/24
+ reserved:
+ - 10.0.1.2 - 10.0.1.9
+ static:
+ - 10.0.1.10 - 10.0.1.30
+ gateway: 10.0.1.1
+ net_id: 4ef0b0ec-58c9-4478-8382-2099da773fdd #
+ security_groups:
+ - default
+```
+
## EC2 Networking Config
### On EC2 with AWS-provided DHCP networking
@@ -81,6 +124,10 @@ Add TCP port `4567` to the **default** security group.
Create a **bat** security group in the same VPC the BAT_DIRECTOR is running in. Allow inbound access to TCP ports
`22` and `4567` to the bat security group.
+## OpenStack Networking Config
+
+Add TCP ports `22` and `4567` to the **default** security group.
+
## Running BAT
When all of the above is ready, running `bundle exec rake bat:env` will verify environment variables are set correctly.
@@ -7,11 +7,14 @@ release:
version: <%= properties.release || "latest" %>
compilation:
- workers: 1
+ workers: 2
network: default
reuse_compilation_vms: true
cloud_properties:
instance_type: m1.small
+ <% if properties.key_name %>
+ key_name: <%= properties.key_name %>
+ <% end %>
update:
canaries: <%= properties.canaries || 1 %>
@@ -21,22 +24,49 @@ update:
max_errors: 1
networks:
+
+- name: static
+ type: vip
+ cloud_properties: {}
+
- name: default
+<% if p('network.net_id', false) %>
+ type: manual
+ subnets:
+ - range: <%= properties.network.cidr %>
+ reserved:
+ <% properties.network.reserved.each do |range| %>
+ - <%= range %>
+ <% end %>
+ static:
+ <% properties.network.static.each do |range| %>
+ - <%= range %>
+ <% end %>
+ gateway: <%= properties.network.gateway %>
+ dns:
+ <% if_p('dns_nameserver') do |dns_nameserver| %>
+ - <%= dns_nameserver %>
+ <% end %>
+ <% if_p('network.dns') do |dns| %>
+ - <%= dns %>
+ <% end %>
+ cloud_properties:
+ security_groups: <%= p('network.security_groups') %>
+ net_id: <%= p('network.net_id') %>
+<% else %>
type: dynamic
<% if_p('dns_nameserver') do |dns_nameserver| %>
dns:
- <%= dns_nameserver %>
<% end %>
- <% if properties.security_group %>
+ <% if properties.security_groups %>
cloud_properties:
security_groups:
- - <%= properties.security_group %>
+ - <%= properties.security_groups %>
<% else %>
cloud_properties: {}
<% end %>
-- name: static
- type: vip
- cloud_properties: {}
+<% end %>
resource_pools:
- name: common
@@ -47,6 +77,9 @@ resource_pools:
version: <%= properties.stemcell.version %>
cloud_properties:
instance_type: m1.small
+ <% if properties.key_name %>
+ key_name: <%= properties.key_name %>
+ <% end %>
<% if properties.password %>
env:
bosh:

0 comments on commit f12939a

Please sign in to comment.