79 |
79 |
host_info = env.env.ips_info[env.host]
|
80 |
80 |
if ast.literal_eval(env.env.use_local_packages):
|
81 |
81 |
with settings(warn_only=True):
|
82 |
|
deb = local("ls %s/%s*%s_all.deb" % (env.env.packages, package, host_info[os]))
|
|
82 |
deb = local("ls %s/%s*%s_all.deb" % (env.env.packages, package, host_info.os))
|
83 |
83 |
if deb:
|
84 |
84 |
debug(env.host, " * Package %s found in %s..." % (package, env.env.packages))
|
85 |
85 |
put(deb, "/tmp/")
|
... | ... | |
89 |
89 |
|
90 |
90 |
info = getattr(env.env, package)
|
91 |
91 |
if info in ["squeeze-backports", "stable", "testing", "unstable"]:
|
92 |
|
if info == "squeeze-backports" and host_infa.os == "wheezy":
|
|
92 |
if info == "squeeze-backports" and host_info.os == "wheezy":
|
93 |
93 |
info = host_info.os
|
94 |
94 |
APT_GET += " -t %s %s " % (info, package)
|
95 |
95 |
elif info:
|
... | ... | |
542 |
542 |
snf-manage component-add "pithos" {2}ui/
|
543 |
543 |
snf-manage component-add "astakos" {3}ui/
|
544 |
544 |
""".format(env.env.cms.fqdn, cyclades_base_url,
|
545 |
|
pithos.base_url, astakos_base_url)
|
|
545 |
pithos_base_url, astakos_base_url)
|
546 |
546 |
try_run(cmd)
|
547 |
547 |
import_service("astakos", astakos_base_url)
|
548 |
548 |
import_service("pithos", pithos_base_url)
|
... | ... | |
633 |
633 |
|
634 |
634 |
|
635 |
635 |
def import_service(service, base_url):
|
636 |
|
try_run("snf-service-export %s %s | snf-manage service-import -" %
|
|
636 |
try_run("snf-service-export %s %s | snf-manage service-import --json -" %
|
637 |
637 |
(service, base_url))
|
638 |
638 |
|
639 |
639 |
|
... | ... | |
821 |
821 |
#try_run("pithos-migrate upgrade head")
|
822 |
822 |
|
823 |
823 |
|
824 |
|
def add_wheezy():
|
825 |
|
tmpl = "/etc/apt/sources.list.d/wheezy.list"
|
826 |
|
replace = {}
|
827 |
|
custom = customize_settings_from_tmpl(tmpl, replace)
|
828 |
|
put(custom, tmpl)
|
829 |
|
apt_get_update()
|
830 |
|
|
831 |
|
|
832 |
|
def remove_wheezy():
|
833 |
|
try_run("rm -f /etc/apt/sources.list.d/wheezy.list")
|
834 |
|
apt_get_update()
|
835 |
|
|
836 |
|
|
837 |
824 |
@roles("ganeti")
|
838 |
825 |
def setup_ganeti():
|
839 |
826 |
debug(env.host, "Setting up snf-ganeti...")
|
... | ... | |
849 |
836 |
#try_run("apt-get update")
|
850 |
837 |
install_package("qemu-kvm")
|
851 |
838 |
install_package("python-bitarray")
|
852 |
|
add_wheezy()
|
853 |
839 |
install_package("ganeti-htools")
|
854 |
|
remove_wheezy()
|
855 |
840 |
install_package("snf-ganeti")
|
856 |
841 |
try_run("mkdir -p /srv/ganeti/file-storage/")
|
857 |
842 |
cmd = """
|