Revision f1b4fdfc
b/snf-deploy/conf/nodes.conf | ||
---|---|---|
5 | 5 |
subnet = 192.168.0.0/28 |
6 | 6 |
gateway = 192.168.0.14 |
7 | 7 |
|
8 |
[os] |
|
9 |
node1 = squeeze |
|
10 |
# node2 = wheezy |
|
8 | 11 |
|
9 | 12 |
[hostnames] |
10 | 13 |
node1 = auto1 |
b/snf-deploy/fabfile.py | ||
---|---|---|
76 | 76 |
debug(env.host, " * Installing package %s..." % package) |
77 | 77 |
APT_GET = "export DEBIAN_FRONTEND=noninteractive ;apt-get install -y --force-yes " |
78 | 78 |
|
79 |
host_info = env.env.ips_info[env.host] |
|
79 | 80 |
if ast.literal_eval(env.env.use_local_packages): |
80 | 81 |
with settings(warn_only=True): |
81 |
deb = local("ls %s/%s*deb" % (env.env.packages, package))
|
|
82 |
deb = local("ls %s/%s*%s.deb" % (env.env.packages, package, host_info[os]))
|
|
82 | 83 |
if deb: |
83 | 84 |
debug(env.host, " * Package %s found in %s..." % (package, env.env.packages)) |
84 | 85 |
put(deb, "/tmp/") |
... | ... | |
87 | 88 |
return |
88 | 89 |
|
89 | 90 |
info = getattr(env.env, package) |
90 |
if info in ["stable", "squeeze-backports", "testing", "unstable"]: |
|
91 |
if info in ["squeeze-backports", "stable", "testing", "unstable"]: |
|
92 |
if info == "squeeze-backports" and host_infa.os = "wheezy": |
|
93 |
info = host_info.os |
|
91 | 94 |
APT_GET += " -t %s %s " % (info, package) |
92 | 95 |
elif info: |
93 | 96 |
APT_GET += " %s=%s " % (package, info) |
... | ... | |
358 | 361 |
curl -k https://dev.grnet.gr/files/apt-grnetdev.pub | apt-key add - |
359 | 362 |
""" |
360 | 363 |
try_run(cmd) |
361 |
tmpl = "/etc/apt/sources.list.d/okeanos.list" |
|
364 |
host_info = env.env.ips_info[env.host] |
|
365 |
if host_info.os == "squeeze": |
|
366 |
tmpl = "/etc/apt/sources.list.d/synnefo.squeeze.list" |
|
367 |
else: |
|
368 |
tmpl = "/etc/apt/sources.list.d/synnefo.wheezy.list" |
|
362 | 369 |
replace = {} |
363 | 370 |
custom = customize_settings_from_tmpl(tmpl, replace) |
364 | 371 |
put(custom, tmpl) |
/dev/null | ||
---|---|---|
1 |
# Backports repository |
|
2 |
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free |
|
3 |
|
|
4 |
deb http://www.rabbitmq.com/debian/ testing main |
|
5 |
|
|
6 |
deb http://apt.dev.grnet.gr squeeze/ |
b/snf-deploy/files/etc/apt/sources.list.d/synnefo.squeeze.list | ||
---|---|---|
1 |
# Backports repository |
|
2 |
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free |
|
3 |
|
|
4 |
deb http://www.rabbitmq.com/debian/ testing main |
|
5 |
|
|
6 |
deb http://apt.dev.grnet.gr squeeze/ |
b/snf-deploy/files/etc/apt/sources.list.d/synnefo.wheezy.list | ||
---|---|---|
1 |
deb http://ftp.de.debian.org/debian wheezy main non-free contrib |
|
2 |
|
|
3 |
deb http://apt.dev.grnet.gr wheezy/ |
|
4 |
deb http://www.rabbitmq.com/debian/ testing main |
/dev/null | ||
---|---|---|
1 |
deb http://ftp.de.debian.org/debian wheezy main non-free contrib |
b/snf-deploy/snfdeploy/lib.py | ||
---|---|---|
45 | 45 |
|
46 | 46 |
|
47 | 47 |
class Host(object): |
48 |
def __init__(self, hostname, ip, mac, domain): |
|
48 |
def __init__(self, hostname, ip, mac, domain, os):
|
|
49 | 49 |
self.hostname = hostname |
50 | 50 |
self.ip = ip |
51 | 51 |
self.mac = mac |
52 | 52 |
self.domain = domain |
53 |
self.os = os |
|
53 | 54 |
|
54 | 55 |
@property |
55 | 56 |
def fqdn(self): |
... | ... | |
67 | 68 |
class Alias(Host): |
68 | 69 |
def __init__(self, host, alias): |
69 | 70 |
super(Alias, self).__init__(host.hostname, host.ip, host.mac, |
70 |
host.domain) |
|
71 |
host.domain, host.os)
|
|
71 | 72 |
self.alias = alias |
72 | 73 |
|
73 | 74 |
@property |
... | ... | |
95 | 96 |
self.node2hostname = dict(conf.get_section("nodes", "hostnames")) |
96 | 97 |
self.node2ip = dict(conf.get_section("nodes", "ips")) |
97 | 98 |
self.node2mac = dict(conf.get_section("nodes", "macs")) |
99 |
self.node2os = dict(conf.get_section("nodes", "os")) |
|
98 | 100 |
self.hostnames = [self.node2hostname[n] |
99 | 101 |
for n in self.nodes.split(",")] |
100 | 102 |
|
... | ... | |
115 | 117 |
for node in self.nodes.split(","): |
116 | 118 |
host = Host(self.node2hostname[node], |
117 | 119 |
self.node2ip[node], |
118 |
self.node2mac[node], self.domain) |
|
120 |
self.node2mac[node], self.domain, self.node2os[node])
|
|
119 | 121 |
|
120 | 122 |
self.nodes_info[node] = host |
121 | 123 |
self.hosts_info[host.hostname] = host |
Also available in: Unified diff