Merge pull request #131 from WordOps/updating-configuration
Updating configuration
This commit is contained in:
@@ -359,7 +359,6 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
WOTemplate.render(self,
|
WOTemplate.render(self,
|
||||||
'/etc/nginx/sites-available/22222',
|
'/etc/nginx/sites-available/22222',
|
||||||
'22222.mustache', data, overwrite=False)
|
'22222.mustache', data, overwrite=False)
|
||||||
|
|
||||||
passwd = ''.join([random.choice
|
passwd = ''.join([random.choice
|
||||||
(string.ascii_letters + string.digits)
|
(string.ascii_letters + string.digits)
|
||||||
for n in range(24)])
|
for n in range(24)])
|
||||||
@@ -468,23 +467,23 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
"/var/www/22222/cert/22222.key;\n")
|
"/var/www/22222/cert/22222.key;\n")
|
||||||
server_ip = requests.get('http://v4.wordops.eu')
|
server_ip = requests.get('http://v4.wordops.eu')
|
||||||
|
|
||||||
if set(["nginx"]).issubset(set(apt_packages)):
|
if set(["nginx"]).issubset(set(apt_packages)):
|
||||||
print("WordOps backend configuration was successful\n"
|
print("WordOps backend configuration was successful\n"
|
||||||
"You can access it on : https://{0}:22222"
|
"You can access it on : https://{0}:22222"
|
||||||
.format(server_ip))
|
.format(server_ip))
|
||||||
print("HTTP Auth User Name: WordOps" +
|
print("HTTP Auth User Name: WordOps" +
|
||||||
"\nHTTP Auth Password : {0}".format(passwd))
|
"\nHTTP Auth Password : {0}".format(passwd))
|
||||||
WOService.reload_service(self, 'nginx')
|
WOService.reload_service(self, 'nginx')
|
||||||
else:
|
else:
|
||||||
self.msg = (self.msg + ["HTTP Auth User "
|
self.msg = (self.msg + ["HTTP Auth User "
|
||||||
"Name: WordOps"] +
|
"Name: WordOps"] +
|
||||||
["HTTP Auth Password : {0}"
|
["HTTP Auth Password : {0}"
|
||||||
.format(passwd)])
|
.format(passwd)])
|
||||||
self.msg = (self.msg + ["WordOps backend is available "
|
self.msg = (self.msg + ["WordOps backend is available "
|
||||||
"on https://{0}:22222 "
|
"on https://{0}:22222 "
|
||||||
"or https://{1}:22222"
|
"or https://{1}:22222"
|
||||||
.format(server_ip.text,
|
.format(server_ip.text,
|
||||||
WOVariables.wo_fqdn)])
|
WOVariables.wo_fqdn)])
|
||||||
|
|
||||||
if not os.path.isfile("/opt/cf-update.sh"):
|
if not os.path.isfile("/opt/cf-update.sh"):
|
||||||
WOTemplate.render(self, '/opt/cf-update.sh',
|
WOTemplate.render(self, '/opt/cf-update.sh',
|
||||||
|
|||||||
@@ -57,12 +57,13 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
]
|
]
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self, disp_msg=False):
|
||||||
# All package update
|
# All package update
|
||||||
apt_packages = []
|
apt_packages = []
|
||||||
packages = []
|
packages = []
|
||||||
nginx_packages = []
|
nginx_packages = []
|
||||||
empty_packages = []
|
empty_packages = []
|
||||||
|
self.msg = []
|
||||||
pargs = self.app.pargs
|
pargs = self.app.pargs
|
||||||
|
|
||||||
if ((not pargs.web) and (not pargs.nginx) and
|
if ((not pargs.web) and (not pargs.nginx) and
|
||||||
|
|||||||
@@ -147,10 +147,9 @@ class WOVariables():
|
|||||||
if wo_distro == 'raspbian':
|
if wo_distro == 'raspbian':
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
wo_mysql = ["mariadb-server", "percona-toolkit",
|
||||||
"python3-mysqldb"]
|
"python3-mysqldb"]
|
||||||
elif wo_distro == 'debian':
|
elif wo_platform_codename == 'jessie':
|
||||||
if wo_platform_codename == 'jessie':
|
wo_mysql = ["mariadb-server", "percona-toolkit",
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
"python3-mysql.connector"]
|
||||||
"python3-mysql.connector"]
|
|
||||||
else:
|
else:
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
wo_mysql = ["mariadb-server", "percona-toolkit",
|
||||||
"python3-mysqldb", "mariadb-backup"]
|
"python3-mysqldb", "mariadb-backup"]
|
||||||
|
|||||||
Reference in New Issue
Block a user