Commit a03c0698 authored by Alex Pyrgiotis's avatar Alex Pyrgiotis

deploy: Add admin app in deploy

parent b2089c14
......@@ -7,5 +7,6 @@ curl = 7.26.0-1+wheezy9
snf-image = unstable
snf-ganeti = unstable
ganeti2 = unstable
python-django-eztables = 0.3.3-1~snf~0.2
[ubuntu]
......@@ -13,6 +13,7 @@ db = node
mq = node
astakos = node
cyclades = node
admin = node
pithos = node
cms = node
stats = node
......
......@@ -7,5 +7,6 @@ curl = 7.26.0-1+wheezy9
snf-image = 0.14-1~wheezy
snf-ganeti = unstable
ganeti2 = unstable
python-django-eztables = 0.3.3-1~snf~0.2
[ubuntu]
......@@ -13,6 +13,7 @@ db = node
mq = node
astakos = node
cyclades = node
admin = node
pithos = node
cms = node
stats = node
......
## Uncomment the following line when admin is installed in a separate node.
## This setting cuts all other urls and uses only the urls of admin.
#ROOT_URLCONF="synnefo_admin.admin.urls"
......@@ -80,6 +80,7 @@ def update_admin(fn):
cl.DB = DB(node=ctx.db.node, ctx=ctx)
cl.ASTAKOS = Astakos(node=ctx.astakos.node, ctx=ctx)
cl.CYCLADES = Cyclades(node=ctx.cyclades.node, ctx=ctx)
cl.ADMIN = Admin(node=ctx.admin.node, ctx=ctx)
cl.CLIENT = Client(node=ctx.client.node, ctx=ctx)
return fn(*args, **kwargs)
return wrapper
......@@ -1535,6 +1536,68 @@ class VNC(base.Component):
]
class Admin(base.Component):
REQUIRED_PACKAGES = [
"python-django-eztables",
"snf-admin-app"
]
alias = constants.ADMIN
service = constants.ADMIN
def required_components(self):
return [
HW, SSH, DNS, APT,
Apache, Gunicorn, Common, Webproject,
]
@update_admin
def admin_pre(self):
self.NS.update_ns()
self.DB.allow_db_access()
self.DB.restart()
@base.run_cmds
@update_admin
def prepare(self):
f = "/etc/synnefo/astakos.conf"
self.ASTAKOS.get(f, "/tmp/astakos.conf")
self.put("/tmp/astakos.conf", f)
f = "/etc/synnefo/cyclades.conf"
self.CYCLADES.get(f, "/tmp/cyclades.conf")
self.put("/tmp/cyclades.conf", f)
return []
def _configure(self):
return [
("/etc/synnefo/admin.conf", {}, {})
]
@base.run_cmds
def initialize(self):
return [
"snf-manage group-add admin"
]
@base.run_cmds
def restart(self):
return [
"/etc/init.d/gunicorn restart"
]
@base.run_cmds
def make_user_admin_user(self):
user_id = context.user_id
return [
"snf-manage user-modify %s --add-group=admin" % user_id
]
@update_admin
@cert_override
def admin_post(self):
pass
class Kamaki(base.Component):
REQUIRED_PACKAGES = [
"python-progress",
......@@ -1546,6 +1609,7 @@ class Kamaki(base.Component):
self.ASTAKOS.add_user()
self.ASTAKOS.activate_user()
self.DB.get_user_info_from_db(config.user_email)
self.ADMIN.make_user_admin_user()
@base.run_cmds
def initialize(self):
......
......@@ -18,6 +18,7 @@ DB = "db"
MQ = "mq"
ASTAKOS = "astakos"
CYCLADES = "cyclades"
ADMIN = "admin"
PITHOS = "pithos"
CLIENT = "client"
ROUTER = "router"
......
......@@ -65,6 +65,7 @@ class Context(object):
self.db = self._get(constants.DB)
self.astakos = self._get(constants.ASTAKOS)
self.cyclades = self._get(constants.CYCLADES)
self.admin = self._get(constants.ADMIN)
self.pithos = self._get(constants.PITHOS)
self.stats = self._get(constants.STATS)
self.cms = self._get(constants.CMS)
......
......@@ -107,6 +107,7 @@ def setup_synnefo():
setup_role(constants.ASTAKOS)
setup_role(constants.PITHOS)
setup_role(constants.CYCLADES)
setup_role(constants.ADMIN)
setup_role(constants.CMS)
setup_cluster()
......
......@@ -24,6 +24,7 @@ _ROLE_MAP = {
constants.MQ: components.MQ,
constants.ASTAKOS: components.Astakos,
constants.CYCLADES: components.Cyclades,
constants.ADMIN: components.Admin,
constants.PITHOS: components.Pithos,
constants.CMS: components.CMS,
constants.STATS: components.Stats,
......
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