Browse Source

nginx repo add code

bugfixes
harshadyeola 10 years ago
parent
commit
51e093dab1
  1. 9
      ee/cli/plugins/stack.py
  2. 13
      ee/core/apt_repo.py
  3. 13
      ee/core/variables.py

9
ee/cli/plugins/stack.py

@ -51,15 +51,18 @@ class EEStackController(CementBaseController):
@expose(hide=True)
def pre_pref(self, apt_packages):
if set(EEVariables.ee_postfix).issubset(set(apt_packages)):
print("Pre-seeding postfix variables ... ")
EEShellExec.cmd_exec("echo \"postfix postfix/main_mailer_type "
"string 'Internet Site'\" | "
"debconf-set-selections")
EEShellExec.cmd_exec("echo \"postfix postfix/mailname string "
"$(hostname -f)\" | debconf-set-selections")
if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
print("Adding repository for mysql ... ")
EERepo.add(ppa=EEVariables.ee_mysql_repo)
EERepo.add_key('hkp://keys.gnupg.net', '1C4CBDCDCD2EFD2A')
chars = ''.join(random.sample(string.ascii_letters, 8))
print("Pre-seeding mysql variables ... ")
EEShellExec.cmd_exec("echo \"percona-server-server-5.6 "
"percona-server-server/root_password "
"password {chars}\" | "
@ -68,6 +71,12 @@ class EEStackController(CementBaseController):
"percona-server-server/root_password_again "
"password {chars}\" | "
"debconf-set-selections".format(chars=chars))
if set(EEVariables.ee_nginx).issubset(set(apt_packages)):
print("Adding repository for nginx ... ")
if EEVariables.ee_platform_codename == 'squeeze':
EERepo.add(repo_url=EEVariables.ee_mysql_repo)
else:
EERepo.add(repo_url=EEVariables.ee_mysql_repo)
@expose(hide=True)
def post_pref(self, apt_packages, packages):

13
ee/core/apt_repo.py

@ -40,11 +40,14 @@ class EERepo():
"--remove '{ppa_name}'".format(ppa_name=repo_url))
pass
def add_key(keyserver, keyids):
EEShellExec.cmd_exec("gpg --keyserver {serv}".format(serv=keyserver)
+ " --recv-keys {key}".format(key=keyids))
EEShellExec.cmd_exec("gpg -a --export --armor {0}".format(keyids)
+ " | apt-key add - ")
def add_key(keyserver=None, keyids):
if keyserver is None:
EEShellExec.cmd_exec("gpg --keyserver {serv}"
.format(serv=(keyserver
or "hkp://keys.gnupg.net"))
+ " --recv-keys {key}".format(key=keyids))
EEShellExec.cmd_exec("gpg -a --export --armor {0}".format(keyids)
+ " | apt-key add - ")
# if __name__ == '__main__':
# EERepo().add(repo_url="http://ds.asf", codename="trusty", repo_type="main")

13
ee/core/variables.py

@ -6,10 +6,17 @@ class EEVariables():
"""Intialization of core variables"""
# EasyEngine core variables
ee_platform_distro = platform.linux_distribution()[0]
ee_platform_version = platform.linux_distribution()[1]
ee_platform_codename = platform.linux_distribution()[2]
# EasyEngine stack installation varibales
# Nginx repo and packages
ee_nginx_repo = "ppa:rtcamp/nginx"
if ee_platform_distro == 'Ubuntu':
ee_nginx_repo = "ppa:rtcamp/nginx"
elif ee_platform_distro == 'Debian':
ee_nginx_repo = ("deb http://packages.dotdeb.org {codename} all"
.format(codename=ee_platform_codename))
ee_nginx = ["nginx-custom"]
# PHP repo and packages
@ -25,10 +32,6 @@ class EEVariables():
ee_postfix_repo = ""
ee_postfix = ["postfix"]
ee_platform_distro = platform.linux_distribution()[0]
ee_platform_version = platform.linux_distribution()[1]
ee_platform_codename = platform.linux_distribution()[2]
# Repo
ee_repo_file = "ee-repo.list"
ee_repo_file_path = ("/etc/apt/sources.list.d/" + ee_repo_file)

Loading…
Cancel
Save