Commit a64397b7 authored by John Hackett's avatar John Hackett

Provisioning groups with sane default ACLs, creating resources with sane permissions.

We now provision working users!

TODO:

* Private network per tenant
* Make bridged networking work
* Multi-host deploy
parent 35fbaeb3
......@@ -2,7 +2,7 @@
auto onebr0
iface onebr0 inet static
bridge_ports
bridge_ports eth1
bridge_stp off
address 192.168.121.240
netmask 255.255.255.0
......
......@@ -89,10 +89,18 @@
command: "oneimage create -d 1 --name boot2docker --path /var/tmp/boot2docker --type OS --prefix vd --type OS --driver raw --description \"boot2docker, OpenNebula contextualised\""
become_user: oneadmin
failed_when: host_create.rc == 1
- name: set open permissions on boot2docker
command: "oneimage chmod boot2docker 744"
become_user: oneadmin
failed_when: host_create.rc == 1
- name: create boot2docker template
command: "onetemplate create /vagrant/boot2docker.tmpl"
become_user: oneadmin
failed_when: host_create.rc == 1
- name: set open permissions on boot2docker
command: "onetemplate chmod boot2docker 744"
become_user: oneadmin
failed_when: host_create.rc == 1
- name: create public network template
command: "onevnet create /vagrant/vnet_public.tmpl"
become_user: oneadmin
......
......@@ -19,40 +19,39 @@ DEFAULT_CLUSTER = [0]
# User ID needs to be mapped onto another system for billing
group_options = {
:resources => "VM+IMAGE+TEMPLATE+DOCUMENT+SECGROUP", # implicitly allow creation
:shared_resources => "VM+NET+IMAGE+TEMPLATE+DOCUMENT+SECGROUP", # implicitly allow use
:views => [:cloud],
:default_view => :cloud,
:group_admin => {
:name => USERNAME,
:password => "password"
},
:name => USERNAME
}
group_xml = Group.build_xml
group = Group.new(group_xml, client)
# More idiomatic form of the above:
#user = User.new(User.build_xml(User::SELF),client)
err = group.allocate(USERNAME)
err = group.create(group_options)
if OpenNebula.is_error?(err)
STDERR.puts "group.allocate: #{err.message}"
else
puts "group.allocate: #{group.id.to_s}"
end
user_xml = User.build_xml
user = User.new(user_xml, client)
# More idiomatic form of the above:
#user = User.new(User.build_xml(User::SELF),client)
err = user.allocate(USERNAME,"pass", "core", [group.id])
if OpenNebula.is_error?(err)
STDERR.puts "user.allocate: #{err.message}"
else
puts "user.allocate: #{user.id.to_s}"
end
vdc_specification = %{
NAME = "#{USERNAME}"
GROUPS = [
ID = #{group.id.to_s}
ID = "#{group.id.to_s}"
]
CLUSTERS = [
ID = 0,
ID = 0
]
DATASTORE = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment