Fix redis install

This commit is contained in:
VirtuBox
2019-09-06 14:37:47 +02:00
parent ecc938c11f
commit 322ba45662
2 changed files with 10 additions and 16 deletions

View File

@@ -192,7 +192,7 @@ class WOStackController(CementBaseController):
if pargs.redis: if pargs.redis:
pargs.php = True pargs.php = True
if not WOAptGet.is_installed(self, 'redis-server'): if not WOAptGet.is_installed(self, 'redis-server'):
apt_packages = apt_packages + ["redis-server"] apt_packages = apt_packages + WOVariables.wo_redis
else: else:
Log.info(self, "Redis already installed") Log.info(self, "Redis already installed")
@@ -201,11 +201,8 @@ class WOStackController(CementBaseController):
if pargs.php: if pargs.php:
Log.debug(self, "Setting apt_packages variable for PHP 7.2") Log.debug(self, "Setting apt_packages variable for PHP 7.2")
if not (WOAptGet.is_installed(self, 'php7.2-fpm')): if not (WOAptGet.is_installed(self, 'php7.2-fpm')):
if not (WOAptGet.is_installed(self, 'php7.3-fpm')): apt_packages = (apt_packages + WOVariables.wo_php +
apt_packages = (apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra)
WOVariables.wo_php_extra)
else:
apt_packages = apt_packages + WOVariables.wo_php
else: else:
Log.debug(self, "PHP 7.2 already installed") Log.debug(self, "PHP 7.2 already installed")
Log.info(self, "PHP 7.2 already installed") Log.info(self, "PHP 7.2 already installed")
@@ -214,12 +211,9 @@ class WOStackController(CementBaseController):
if pargs.php73: if pargs.php73:
Log.debug(self, "Setting apt_packages variable for PHP 7.3") Log.debug(self, "Setting apt_packages variable for PHP 7.3")
if not WOAptGet.is_installed(self, 'php7.3-fpm'): if not WOAptGet.is_installed(self, 'php7.3-fpm'):
if not (WOAptGet.is_installed(self, 'php7.2-fpm')): apt_packages = (apt_packages + WOVariables.wo_php +
apt_packages = (apt_packages + WOVariables.wo_php + WOVariables.wo_php73 +
WOVariables.wo_php73 + WOVariables.wo_php_extra)
WOVariables.wo_php_extra)
else:
apt_packages = apt_packages + WOVariables.wo_php73
else: else:
Log.debug(self, "PHP 7.3 already installed") Log.debug(self, "PHP 7.3 already installed")
Log.info(self, "PHP 7.3 already installed") Log.info(self, "PHP 7.3 already installed")

View File

@@ -137,7 +137,7 @@ def pre_pref(self, apt_packages):
Log.debug(self, 'Adding deb.sury GPG key') Log.debug(self, 'Adding deb.sury GPG key')
WORepo.add_key(self, WOVariables.wo_php_key) WORepo.add_key(self, WOVariables.wo_php_key)
# add redis repository # add redis repository
if set(['redis-server']).issubset(set(apt_packages)): if set(WOVariables.wo_redis).issubset(set(apt_packages)):
Log.info(self, "Adding repository for Redis, please wait...") Log.info(self, "Adding repository for Redis, please wait...")
if WOVariables.wo_distro == 'ubuntu': if WOVariables.wo_distro == 'ubuntu':
Log.debug(self, 'Adding ppa for redis') Log.debug(self, 'Adding ppa for redis')
@@ -837,7 +837,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
WOService.restart_service(self, 'php7.3-fpm') WOService.restart_service(self, 'php7.3-fpm')
# create mysql config if it doesn't exist # create mysql config if it doesn't exist
if set(["mariadb-server"]).issubset(set(apt_packages)): if "mariadb-server" in apt_packages:
if not os.path.isfile("/etc/mysql/my.cnf"): if not os.path.isfile("/etc/mysql/my.cnf"):
config = ("[mysqld]\nwait_timeout = 30\n" config = ("[mysqld]\nwait_timeout = 30\n"
"interactive_timeout=60\nperformance_schema = 0" "interactive_timeout=60\nperformance_schema = 0"
@@ -914,7 +914,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
WOService.reload_service(self, 'fail2ban') WOService.reload_service(self, 'fail2ban')
# Proftpd configuration # Proftpd configuration
if set(["proftpd-basic"]).issubset(set(apt_packages)): if "proftpd-basic" in apt_packages:
if os.path.isfile("/etc/proftpd/proftpd.conf"): if os.path.isfile("/etc/proftpd/proftpd.conf"):
Log.info(self, "Configuring ProFTPd") Log.info(self, "Configuring ProFTPd")
Log.debug(self, "Setting up Proftpd configuration") Log.debug(self, "Setting up Proftpd configuration")
@@ -1002,7 +1002,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
WOService.reload_service(self, 'proftpd') WOService.reload_service(self, 'proftpd')
# Redis configuration # Redis configuration
if set(['redus-server']).issubset(set(apt_packages)): if "redis-server" in apt_packages:
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"): if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not WOFileUtils.grep(self, "/etc/nginx/conf.d/" if not WOFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf", "upstream.conf",