Use WOConf in stack_pref
This commit is contained in:
@@ -891,28 +891,19 @@ def site_package_check(self, stype):
|
|||||||
'wpsubdomain']):
|
'wpsubdomain']):
|
||||||
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')):
|
||||||
apt_packages = apt_packages + WOVar.wo_php72
|
apt_packages = apt_packages + WOVar.wo_php72 + WOVar.wo_php_extra
|
||||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
|
||||||
WOAptGet.is_installed(self, 'php7.4-fpm')):
|
|
||||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
|
||||||
|
|
||||||
if pargs.php73 and stype in ['php73', 'mysql', 'wp',
|
if pargs.php73 and stype in ['php73', 'mysql', 'wp',
|
||||||
'wpsubdir', 'wpsubdomain']:
|
'wpsubdir', 'wpsubdomain']:
|
||||||
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'):
|
||||||
apt_packages = apt_packages + WOVar.wo_php73
|
apt_packages = apt_packages + WOVar.wo_php73 + WOVar.wo_php_extra
|
||||||
if not (WOAptGet.is_installed(self, 'php7.2-fpm') or
|
|
||||||
WOAptGet.is_installed(self, 'php7.4-fpm')):
|
|
||||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
|
||||||
|
|
||||||
if pargs.php74 and stype in ['php74', 'mysql', 'wp',
|
if pargs.php74 and stype in ['php74', 'mysql', 'wp',
|
||||||
'wpsubdir', 'wpsubdomain']:
|
'wpsubdir', 'wpsubdomain']:
|
||||||
Log.debug(self, "Setting apt_packages variable for PHP 7.4")
|
Log.debug(self, "Setting apt_packages variable for PHP 7.4")
|
||||||
if not WOAptGet.is_installed(self, 'php7.4-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.4-fpm'):
|
||||||
apt_packages = apt_packages + WOVar.wo_php74
|
apt_packages = apt_packages + WOVar.wo_php74 + WOVar.wo_php_extra
|
||||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
|
||||||
WOAptGet.is_installed(self, 'php7.2-fpm')):
|
|
||||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
|
||||||
|
|
||||||
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']:
|
||||||
Log.debug(self, "Setting apt_packages variable for MySQL")
|
Log.debug(self, "Setting apt_packages variable for MySQL")
|
||||||
|
|||||||
@@ -249,34 +249,7 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
for wo_php in wo_php_version:
|
for wo_php in wo_php_version:
|
||||||
data = dict(upstream="{0}".format(wo_php),
|
data = dict(upstream="{0}".format(wo_php),
|
||||||
release=WOVar.wo_version)
|
release=WOVar.wo_version)
|
||||||
WOTemplate.deploy(self,
|
WOConf.nginxcommon(self)
|
||||||
'{0}/{1}.conf'
|
|
||||||
.format(ngxcom, wo_php),
|
|
||||||
'php.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/redis-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'redis.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/wpcommon-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'wpcommon.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/wpfc-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'wpfc.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/wpsc-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'wpsc.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/wprocket-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'wprocket.mustache', data)
|
|
||||||
|
|
||||||
WOTemplate.deploy(
|
|
||||||
self, '{0}/wpce-{1}.conf'.format(ngxcom, wo_php),
|
|
||||||
'wpce.mustache', data)
|
|
||||||
|
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ class WOConf():
|
|||||||
"""nginx common configuration deployment"""
|
"""nginx common configuration deployment"""
|
||||||
wo_php_version = ["php72", "php73", "php74"]
|
wo_php_version = ["php72", "php73", "php74"]
|
||||||
ngxcom = '/etc/nginx/common'
|
ngxcom = '/etc/nginx/common'
|
||||||
|
if not os.path.exists(ngxcom):
|
||||||
|
os.mkdir(ngxcom)
|
||||||
for wo_php in wo_php_version:
|
for wo_php in wo_php_version:
|
||||||
if not os.path.exists(ngxcom):
|
|
||||||
os.mkdir(ngxcom)
|
|
||||||
Log.debug(self, 'deploying templates for {0}'.format(wo_php))
|
Log.debug(self, 'deploying templates for {0}'.format(wo_php))
|
||||||
data = dict(upstream="{0}".format(wo_php),
|
data = dict(upstream="{0}".format(wo_php),
|
||||||
release=WOVar.wo_version)
|
release=WOVar.wo_version)
|
||||||
|
|||||||
Reference in New Issue
Block a user