|
@ -7,6 +7,7 @@ from ee.core.aptget import EEAptGet |
|
|
from ee.core.download import EEDownload |
|
|
from ee.core.download import EEDownload |
|
|
from ee.core.shellexec import EEShellExec |
|
|
from ee.core.shellexec import EEShellExec |
|
|
from ee.core.fileutils import EEFileUtils |
|
|
from ee.core.fileutils import EEFileUtils |
|
|
|
|
|
from ee.core.apt_repo import EERepo |
|
|
from pynginxconfig import NginxConfig |
|
|
from pynginxconfig import NginxConfig |
|
|
import random |
|
|
import random |
|
|
import string |
|
|
import string |
|
@ -49,16 +50,17 @@ class EEStackController(CementBaseController): |
|
|
|
|
|
|
|
|
@expose(hide=True) |
|
|
@expose(hide=True) |
|
|
def pre_pref(self, apt_packages): |
|
|
def pre_pref(self, apt_packages): |
|
|
if "postfix" in apt_packages: |
|
|
if set(EEVariables.ee_postfix).issubset(set(apt_packages)): |
|
|
EEShellExec.cmd_exec("echo \"postfix postfix/main_mailer_type " |
|
|
EEShellExec.cmd_exec("echo \"postfix postfix/main_mailer_type " |
|
|
"string 'Internet Site'\" | " |
|
|
"string 'Internet Site'\" | " |
|
|
"debconf-set-selections") |
|
|
"debconf-set-selections") |
|
|
EEShellExec.cmd_exec("echo \"postfix postfix/mailname string " |
|
|
EEShellExec.cmd_exec("echo \"postfix postfix/mailname string " |
|
|
"$(hostname -f)\" | debconf-set-selections") |
|
|
"$(hostname -f)\" | debconf-set-selections") |
|
|
if "mysql" in apt_packages: |
|
|
if set(EEVariables.ee_mysql).issubset(set(apt_packages)): |
|
|
EERepo.add(repo_url="deb http://repo.percona.com/apt " |
|
|
EERepo.add(ppa='deb http://repo.percona.com/apt ' |
|
|
+ EEVariables.ee_platform_codename + " main") |
|
|
+ EEVariables.ee_platform_codename + " main") |
|
|
EERepo.add_key('hkp://keys.gnupg.net', '1C4CBDCDCD2EFD2A ') |
|
|
EERepo.add_key('hkp://keys.gnupg.net', '1C4CBDCDCD2EFD2A ') |
|
|
|
|
|
|
|
|
chars = ''.join(random.sample(string.letters, 8)) |
|
|
chars = ''.join(random.sample(string.letters, 8)) |
|
|
EEShellExec.cmd_exec("echo \"percona-server-server-5.6 " |
|
|
EEShellExec.cmd_exec("echo \"percona-server-server-5.6 " |
|
|
"percona-server-server/root_password " |
|
|
"percona-server-server/root_password " |
|
@ -72,11 +74,9 @@ class EEStackController(CementBaseController): |
|
|
@expose(hide=True) |
|
|
@expose(hide=True) |
|
|
def post_pref(self, apt_packages, packages): |
|
|
def post_pref(self, apt_packages, packages): |
|
|
if len(apt_packages): |
|
|
if len(apt_packages): |
|
|
print("In post") |
|
|
if set(EEVariables.ee_postfix).issubset(set(apt_packages)): |
|
|
print(apt_packages) |
|
|
|
|
|
if "postfix" in apt_packages: |
|
|
|
|
|
pass |
|
|
pass |
|
|
if 'nginx-custom' in apt_packages: |
|
|
if set(EEVariables.ee_nginx).issubset(set(apt_packages)): |
|
|
# Nginx core configuration change using configparser |
|
|
# Nginx core configuration change using configparser |
|
|
nc = NginxConfig() |
|
|
nc = NginxConfig() |
|
|
print('in nginx') |
|
|
print('in nginx') |
|
|