From 0a375f9b9961f52930ec5ac9c957b05d7b1715fe Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 18 Sep 2022 20:32:55 +0200 Subject: [PATCH] Force Cloudflare script update --- wo/cli/plugins/stack_pref.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 6cb4578..988df46 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -194,11 +194,6 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOTemplate.deploy( self, '{0}/avif.conf'.format(ngxcnf), 'avif.mustache', data, overwrite=False) - - WOTemplate.deploy( - self, '{0}/cloudflare.conf'.format(ngxcnf), - 'cloudflare.mustache', data) - WOTemplate.deploy( self, '{0}/map-wp-fastcgi-cache.conf'.format(ngxcnf), @@ -421,16 +416,17 @@ def post_pref(self, apt_packages, packages, upgrade=False): .format(server_ip.text, WOVar.wo_fqdn)]) - if not os.path.isfile("/opt/cf-update.sh"): - data = dict(release=WOVar.wo_version) - WOTemplate.deploy(self, '/opt/cf-update.sh', - 'cf-update.mustache', - data, overwrite=False) - WOFileUtils.chmod(self, "/opt/cf-update.sh", 0o775) - WOCron.setcron_weekly(self, '/opt/cf-update.sh ' - '> /dev/null 2>&1', - comment='Cloudflare IP refresh cronjob ' - 'added by WordOps') + data = dict(release=WOVar.wo_version) + WOTemplate.deploy(self, '/opt/cf-update.sh', + 'cf-update.mustache', + data, overwrite=True) + WOFileUtils.chmod(self, "/opt/cf-update.sh", 0o775) + Log.debug(self, 'Creating Cloudflare.conf') + WOShellExec.cmd_exec(self, '/opt/cf-update.sh') + WOCron.setcron_weekly(self, '/opt/cf-update.sh ' + '> /dev/null 2>&1', + comment='Cloudflare IP refresh cronjob ' + 'added by WordOps') # Nginx Configation into GIT if not WOService.restart_service(self, 'nginx'):