Commit 8b69ad56 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy/ci: Add dummy node

Remove all roles from DEFAULT section in setups.conf. This way each
setup has only the roles/nodes that are included in the corresponding
section. Since currently the Context() class expects to find all
roles in each setup (db, mq, etc.) we have to introduce a dummy node
that eventually should not be used.

Set DEFAULT_NODE and DEFAULT_CLUSTER to None. One should only
specify the desired setup (with --setup option) and the nodes, and
clusters should be derived from it.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent 9eb64f50
......@@ -96,3 +96,9 @@ name = vc4
ip = 10.1.2.4
public_iface = eth0
domain = vcluster.synnefo.live
[dummy]
name = dummy
ip = 1.2.3.4
public_iface = eth0
domain = synnefo.live
[DEFAULT]
#################################
# snf-deploy synnefo --autoconf #
#################################
[auto]
ns = node
client = node
router = node
......@@ -11,12 +17,6 @@ pithos = node
cms = node
stats = node
dev = node
#################################################
# snf-deploy synnefo --setup synnefo --autoconf #
#################################################
[synnefo]
clusters =
ganeti
......
......@@ -96,3 +96,9 @@ name = vc4
ip = 10.1.2.4
public_iface = eth0
domain = vcluster.synnefo.live
[dummy]
name = dummy
ip = 1.2.3.4
public_iface = eth0
domain = synnefo.live
[DEFAULT]
#################################
# snf-deploy synnefo --autoconf #
#################################
[auto]
ns = node
client = node
router = node
......@@ -11,12 +17,6 @@ pithos = node
cms = node
stats = node
dev = node
#################################################
# snf-deploy synnefo --setup synnefo --autoconf #
#################################################
[synnefo]
clusters =
ganeti
......
......@@ -33,9 +33,10 @@ BACKEND = "backend"
VALUE_OK = "ok"
STATUS_FILE = "snf_deploy_status"
DEFAULT_NODE = "node"
DEFAULT_CLUSTER = "ganeti"
DEFAULT_SETUP = "synnefo"
DEFAULT_NODE = None
DEFAULT_CLUSTER = None
DEFAULT_SETUP = "auto"
DUMMY_NODE = "dummy"
CERT_OVERRIDE = "cert_override.txt"
CERT_PATH = "/etc/ssl/certs/ssl-cert-snakeoil.pem"
......
......@@ -15,6 +15,7 @@
import sys
import datetime
import ConfigParser
from snfdeploy import constants
from snfdeploy import config
from snfdeploy import status
......@@ -28,7 +29,7 @@ class Context(object):
ret = "[%s]" % datetime.datetime.now().strftime("%H:%M:%S")
ret += " [%s %s]" % (self.node_info.ip, self.node_info.name)
ret += " [%s %s %s %s]" % \
(self.node, self.role, self.setup, self.cluster)
(self.node, self.role, self.cluster, self.setup)
return ret
def __init__(self, node=None, role=None, cluster=None, setup=None):
......@@ -71,7 +72,10 @@ class Context(object):
self.client = self._get(constants.CLIENT)
def _get(self, role):
return config.get_single_node_role_info(self.setup, role)
try:
return config.get_single_node_role_info(self.setup, role)
except ConfigParser.NoOptionError:
return config.get_node_info(constants.DUMMY_NODE)
@property
def node_info(self):
......
......@@ -258,7 +258,6 @@ def dnsmasq():
def launch():
ctx = context.Context()
assert len(ctx.clusters) == 1
assert ctx.cluster
assert ctx.all_nodes
network()
create_dnsmasq_files(ctx)
......
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