1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-28 17:57:22 +03:00

F #4163: Tunrkey Linux automatic configuration for OpenNebula

This commit is contained in:
Ruben S. Montero 2020-02-07 10:50:23 +01:00
parent dfc5a2619c
commit 0d3aba8cab
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 29 additions and 1 deletions

View File

@ -753,7 +753,7 @@ DATASTORE_MAD = [
MARKET_MAD = [
EXECUTABLE = "one_market",
ARGUMENTS = "-t 15 -m http,s3,one,linuxcontainers"
ARGUMENTS = "-t 15 -m http,s3,one,linuxcontainers,turnkeylinux"
]
#*******************************************************************************
@ -1364,6 +1364,14 @@ MARKET_MAD_CONF = [
PUBLIC = "yes"
]
MARKET_MAD_CONF = [
NAME = "turnkeylinux",
SUNSTONE_NAME = "TurnkeyLinux",
REQUIRED_ATTRS = "",
APP_ACTIONS = "monitor",
PUBLIC = "yes"
]
#*******************************************************************************
# Authentication Driver Behavior Definition
#*******************************************************************************

View File

@ -45,6 +45,12 @@ MarketPlacePool::MarketPlacePool(SqlDB * db, bool is_federation_slave)
"DESCRIPTION=\"MarketPlace for the public image server fo LXC &"
" LXD hosted at linuxcontainers.org\"";
string tk_market =
"NAME=\"TurnKey Linux Containers\"\n"
"MARKET_MAD=turnkeylinux\n"
"DESCRIPTION=\"TurnKey linux is a free software repository"
" based on Debian images hosted at turnkeylinux.org\"";
Nebula& nd = Nebula::instance();
UserPool * upool = nd.get_upool();
User * oneadmin = upool->get_ro(0);
@ -53,11 +59,13 @@ MarketPlacePool::MarketPlacePool(SqlDB * db, bool is_federation_slave)
MarketPlaceTemplate * default_tmpl = new MarketPlaceTemplate;
MarketPlaceTemplate * lxc_tmpl = new MarketPlaceTemplate;
MarketPlaceTemplate * tk_tmpl = new MarketPlaceTemplate;
char * error_parse;
default_tmpl->parse(default_market, &error_parse);
lxc_tmpl->parse(lxc_market, &error_parse);
tk_tmpl->parse(tk_market, &error_parse);
MarketPlace * marketplace = new MarketPlace(
oneadmin->get_uid(),
@ -75,20 +83,32 @@ MarketPlacePool::MarketPlacePool(SqlDB * db, bool is_federation_slave)
oneadmin->get_umask(),
lxc_tmpl);
MarketPlace * tk_marketplace = new MarketPlace(
oneadmin->get_uid(),
oneadmin->get_gid(),
oneadmin->get_uname(),
oneadmin->get_gname(),
oneadmin->get_umask(),
tk_tmpl);
oneadmin->unlock();
marketplace->set_permissions(1,1,1, 1,0,0, 1,0,0, error);
lxc_marketplace->set_permissions(1,1,1, 1,0,0, 1,0,0, error);
tk_marketplace->set_permissions(1,1,1, 1,0,0, 1,0,0, error);
marketplace->zone_id = Nebula::instance().get_zone_id();
lxc_marketplace->zone_id = Nebula::instance().get_zone_id();
tk_marketplace->zone_id = Nebula::instance().get_zone_id();
marketplace->parse_template(error);
lxc_marketplace->parse_template(error);
tk_marketplace->parse_template(error);
int rc = PoolSQL::allocate(marketplace, error);
rc += PoolSQL::allocate(lxc_marketplace, error);
rc += PoolSQL::allocate(tk_marketplace, error);
if (rc < 0)
{