Commit 255795bd authored by Konstantinos Tompoulidis's avatar Konstantinos Tompoulidis Committed by Stratos Psomadakis

deploy: minor revamp

 * Add/split repositories to their respective files - helps with updates/maint
 * Add ceph repo key
 * Use a metadata file to register an image with kamaki - proposed by dgrig
 * Linting
parent ad728009
# This is for archipelago packages
deb http://apt.dev.grnet.gr experimental/
# Ceph repo - LTS (April 2015) Hammer release
deb http://eu.ceph.com/debian-hammer/ wheezy main
# Debian backports
deb http://ftp.gr.debian.org/debian wheezy-backports main
deb http://ftp.de.debian.org/debian wheezy main # Synnefo packages
deb http://ftp.de.debian.org/debian wheezy-backports main
deb http://apt.dev.grnet.gr wheezy/ deb http://apt.dev.grnet.gr wheezy/
deb http://apt.dev.grnet.gr unstable/ deb http://apt.dev.grnet.gr unstable/
# This is for archipelago packages
deb http://apt.dev.grnet.gr experimental/
deb http://eu.ceph.com/debian-dumpling/ wheezy main # X2Go repo
deb http://packages.x2go.org/debian wheezy main
# Copyright (C) 2010-2014 GRNET S.A. # Copyright (C) 2010-2015 GRNET S.A.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -352,13 +352,20 @@ class APT(base.Component): ...@@ -352,13 +352,20 @@ class APT(base.Component):
def prepare(self): def prepare(self):
return [ return [
"echo 'APT::Install-Suggests \"false\";' >> /etc/apt/apt.conf", "echo 'APT::Install-Suggests \"false\";' >> /etc/apt/apt.conf",
"curl -k https://dev.grnet.gr/files/apt-grnetdev.pub | \ "curl https://dev.grnet.gr/files/apt-grnetdev.pub | \
apt-key add -", apt-key add -",
# Add key for ceph repo
"curl -L \
'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' \
| apt-key add -"
] ]
def _configure(self): def _configure(self):
return [ return [
("/etc/apt/sources.list.d/synnefo.wheezy.list", {}, {}) ("/etc/apt/sources.list.d/debian.backports.wheezy.list", {}, {}),
("/etc/apt/sources.list.d/archipelago.wheezy.list", {}, {}),
("/etc/apt/sources.list.d/synnefo.wheezy.list", {}, {}),
("/etc/apt/sources.list.d/ceph.list", {}, {}),
] ]
@base.run_cmds @base.run_cmds
...@@ -877,19 +884,19 @@ class Network(base.Component): ...@@ -877,19 +884,19 @@ class Network(base.Component):
"gateway": config.synnefo_public_network_gateway, "gateway": config.synnefo_public_network_gateway,
"router": 1 if is_router else 0, "router": 1 if is_router else 0,
"vm_public_iface": self.node.vm_public_iface "vm_public_iface": self.node.vm_public_iface
if self.node.vm_public_iface else self.node.public_iface, if self.node.vm_public_iface else self.node.public_iface,
} }
r5 = { r5 = {
"vm_public_bridge": config.vm_public_bridge, "vm_public_bridge": config.vm_public_bridge,
"vm_public_iface": self.node.vm_public_iface "vm_public_iface": self.node.vm_public_iface
if self.node.vm_public_iface else "none", if self.node.vm_public_iface else "none",
"address": config.synnefo_public_network_gateway \ "address": config.synnefo_public_network_gateway
if is_router else "0.0.0.0", if is_router else "0.0.0.0",
"netmask": config.synnefo_public_network_netmask \ "netmask": config.synnefo_public_network_netmask
if is_router else "255.255.255.255", if is_router else "255.255.255.255",
"vm_private_bridge": config.vm_private_bridge, "vm_private_bridge": config.vm_private_bridge,
"vm_private_iface": self.node.vm_private_iface "vm_private_iface": self.node.vm_private_iface
if self.node.vm_private_iface else "none", if self.node.vm_private_iface else "none",
} }
return [ return [
...@@ -1340,8 +1347,8 @@ class NFS(base.Component): ...@@ -1340,8 +1347,8 @@ class NFS(base.Component):
"mkdir -p %s" % config.ganeti_dir, "mkdir -p %s" % config.ganeti_dir,
"mkdir -p %s" % config.archip_dir, "mkdir -p %s" % config.archip_dir,
"cd %s && mkdir {maps,blocks,locks}" % config.archip_dir, "cd %s && mkdir {maps,blocks,locks}" % config.archip_dir,
"cd %s && chown archipelago:synnefo {maps,blocks,locks}" % \ "cd %s && chown archipelago:synnefo {maps,blocks,locks}" %
config.archip_dir, config.archip_dir,
"cd %s && chmod 770 {maps,blocks,locks}" % config.archip_dir, "cd %s && chmod 770 {maps,blocks,locks}" % config.archip_dir,
"cd %s && chmod g+s {maps,blocks,locks}" % config.archip_dir, "cd %s && chmod g+s {maps,blocks,locks}" % config.archip_dir,
] ]
...@@ -1399,7 +1406,7 @@ class Pithos(base.Component): ...@@ -1399,7 +1406,7 @@ class Pithos(base.Component):
@base.run_cmds @base.run_cmds
def prepare(self): def prepare(self):
return [ return [
#FIXME: Workaround until snf-pithos-webclient creates conf # FIXME: Workaround until snf-pithos-webclient creates conf
# files properly with root:synnefo # files properly with root:synnefo
"chown root:synnefo /etc/synnefo/*snf-pithos-webclient*conf", "chown root:synnefo /etc/synnefo/*snf-pithos-webclient*conf",
] ]
...@@ -1741,7 +1748,7 @@ class Kamaki(base.Component): ...@@ -1741,7 +1748,7 @@ class Kamaki(base.Component):
self.ASTAKOS.make_user_admin_user() self.ASTAKOS.make_user_admin_user()
self.CA.get("/root/ca/cacert.pem", "/tmp/cacert.pem") self.CA.get("/root/ca/cacert.pem", "/tmp/cacert.pem")
self.put("/tmp/cacert.pem", self.put("/tmp/cacert.pem",
"/usr/local/share/ca-certificates/Synnefo_Root_CA.crt") "/usr/local/share/ca-certificates/Synnefo_Root_CA.crt")
@base.run_cmds @base.run_cmds
def prepare(self): def prepare(self):
...@@ -1766,23 +1773,31 @@ class Kamaki(base.Component): ...@@ -1766,23 +1773,31 @@ class Kamaki(base.Component):
"test -e /tmp/%s || wget -4 %s -O /tmp/%s" % (image, url, image) "test -e /tmp/%s || wget -4 %s -O /tmp/%s" % (image, url, image)
] ]
def _fetch_image_meta(self):
url = config.debian_base_url + ".meta"
meta = "debian_base.diskdump.meta"
return [
"test -e /srv/images/%s || wget -4 %s -O /srv/images/%s" % (meta, url, meta)
]
def _upload_image(self): def _upload_image(self):
image = "debian_base.diskdump" image = "debian_base.diskdump"
return [ return [
"kamaki file upload --container images /tmp/%s %s" % (image, image) "kamaki file upload --container images /tmp/%s %s" % (image, image)
] ]
def _upload_image_meta(self):
image = "debian_base.diskdump.meta"
return [
"kamaki file upload --container images /srv/images/%s %s" % (image, image)
]
def _register_image(self): def _register_image(self):
image = "debian_base.diskdump" image = "debian_base.diskdump"
image_location = "/images/%s" % image image_location = "/images/%s" % image
cmd = """ cmd = """
kamaki image register --name "Debian Base" --location {0} \ kamaki image register --name "Debian Base" --location {0} --public \
--public --disk-format=diskdump \ --force --metafile /srv/{0}.meta
--property OSFAMILY=linux --property ROOT_PARTITION=1 \
--property description="Debian Squeeze Base System" \
--property size=450M --property kernel=2.6.32 \
--property GUI="No GUI" --property sortorder=1 \
--property USERS=root --property OS=debian
""".format(image_location) """.format(image_location)
return [ return [
"sleep 5", "sleep 5",
...@@ -1792,6 +1807,7 @@ class Kamaki(base.Component): ...@@ -1792,6 +1807,7 @@ class Kamaki(base.Component):
@base.run_cmds @base.run_cmds
def test(self): def test(self):
return self._fetch_image() + self._upload_image() + \ return self._fetch_image() + self._upload_image() + \
self._fetch_image_meta() + self._upload_image_meta() + \
self._register_image() self._register_image()
...@@ -1907,7 +1923,7 @@ class Archip(base.Component): ...@@ -1907,7 +1923,7 @@ class Archip(base.Component):
@base.run_cmds @base.run_cmds
def restart(self): def restart(self):
return [ return [
#FIXME: See https://github.com/grnet/archipelago/pull/44 # FIXME: See https://github.com/grnet/archipelago/pull/44
"mkdir -p /dev/shm/posixfd", "mkdir -p /dev/shm/posixfd",
"chown -R synnefo:synnefo /dev/shm/posixfd", "chown -R synnefo:synnefo /dev/shm/posixfd",
"archipelago restart", "archipelago restart",
......
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