fix install on raspbian
This commit is contained in:
@@ -111,34 +111,64 @@ class WOStackController(CementBaseController):
|
|||||||
# generate random 24 characters root password
|
# generate random 24 characters root password
|
||||||
chars = ''.join(random.sample(string.ascii_letters, 24))
|
chars = ''.join(random.sample(string.ascii_letters, 24))
|
||||||
# configure MySQL non-interactive install
|
# configure MySQL non-interactive install
|
||||||
Log.debug(self, "Pre-seeding MySQL")
|
if (not WOVariables.wo_platform_distro == 'raspbian'):
|
||||||
Log.debug(self, "echo \"mariadb-server-10.3 "
|
Log.debug(self, "Pre-seeding MySQL")
|
||||||
"mysql-server/root_password "
|
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||||
"password \" | "
|
"mysql-server/root_password "
|
||||||
"debconf-set-selections")
|
"password \" | "
|
||||||
try:
|
"debconf-set-selections")
|
||||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
try:
|
||||||
"mysql-server/root_password "
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||||
"password {chars}\" | "
|
"mysql-server/root_password "
|
||||||
"debconf-set-selections"
|
"password {chars}\" | "
|
||||||
.format(chars=chars),
|
"debconf-set-selections"
|
||||||
log=False)
|
.format(chars=chars),
|
||||||
except CommandExecutionError as e:
|
log=False)
|
||||||
Log.error("Failed to initialize MySQL package")
|
except CommandExecutionError as e:
|
||||||
|
Log.error("Failed to initialize MySQL package")
|
||||||
|
|
||||||
Log.debug(self, "echo \"mariadb-server-10.3 "
|
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password_again "
|
"mysql-server/root_password_again "
|
||||||
"password \" | "
|
"password \" | "
|
||||||
"debconf-set-selections")
|
"debconf-set-selections")
|
||||||
try:
|
try:
|
||||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||||
"mysql-server/root_password_again "
|
"mysql-server/root_password_again "
|
||||||
"password {chars}\" | "
|
"password {chars}\" | "
|
||||||
"debconf-set-selections"
|
"debconf-set-selections"
|
||||||
.format(chars=chars),
|
.format(chars=chars),
|
||||||
log=False)
|
log=False)
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
Log.error("Failed to initialize MySQL package")
|
Log.error("Failed to initialize MySQL package")
|
||||||
|
else:
|
||||||
|
Log.debug(self, "Pre-seeding MySQL")
|
||||||
|
Log.debug(self, "echo \"mariadb-server-10.1 "
|
||||||
|
"mysql-server/root_password "
|
||||||
|
"password \" | "
|
||||||
|
"debconf-set-selections")
|
||||||
|
try:
|
||||||
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.1 "
|
||||||
|
"mysql-server/root_password "
|
||||||
|
"password {chars}\" | "
|
||||||
|
"debconf-set-selections"
|
||||||
|
.format(chars=chars),
|
||||||
|
log=False)
|
||||||
|
except CommandExecutionError as e:
|
||||||
|
Log.error("Failed to initialize MySQL package")
|
||||||
|
|
||||||
|
Log.debug(self, "echo \"mariadb-server-10.1 "
|
||||||
|
"mysql-server/root_password_again "
|
||||||
|
"password \" | "
|
||||||
|
"debconf-set-selections")
|
||||||
|
try:
|
||||||
|
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.1 "
|
||||||
|
"mysql-server/root_password_again "
|
||||||
|
"password {chars}\" | "
|
||||||
|
"debconf-set-selections"
|
||||||
|
.format(chars=chars),
|
||||||
|
log=False)
|
||||||
|
except CommandExecutionError as e:
|
||||||
|
Log.error("Failed to initialize MySQL package")
|
||||||
# generate my.cnf root credentials
|
# generate my.cnf root credentials
|
||||||
mysql_config = """
|
mysql_config = """
|
||||||
[client]
|
[client]
|
||||||
|
|||||||
@@ -94,24 +94,35 @@ class WOVariables():
|
|||||||
|
|
||||||
# WordOps stack installation variables
|
# WordOps stack installation variables
|
||||||
# Nginx repo and packages
|
# Nginx repo and packages
|
||||||
if wo_platform_codename == 'trusty':
|
if wo_platform_distro == 'ubuntu':
|
||||||
|
if wo_platform_codename == 'trusty':
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/xUbuntu_14.04/ /")
|
||||||
|
elif wo_platform_codename == 'xenial':
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/xUbuntu_16.04/ /")
|
||||||
|
elif wo_platform_codename == 'bionic':
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/xUbuntu_18.04/ /")
|
||||||
|
else:
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/xUbuntu_19.04/ /")
|
||||||
|
elif wo_platform_distro == 'debian':
|
||||||
|
if wo_platform_codename == 'jessie':
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/Debian_8.0/ /")
|
||||||
|
elif wo_platform_codename == 'stretch':
|
||||||
|
wo_nginx_repo = ("deb http://download.opensuse.org"
|
||||||
|
"/repositories/home:"
|
||||||
|
"/virtubox:/WordOps/Debian_9.0/ /")
|
||||||
|
else:
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
||||||
"/virtubox:/WordOps/xUbuntu_14.04/ /")
|
"/virtubox:/WordOps/Raspbian_9.0/ /")
|
||||||
elif wo_platform_codename == 'xenial':
|
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
|
||||||
"/virtubox:/WordOps/xUbuntu_16.04/ /")
|
|
||||||
elif wo_platform_codename == 'bionic':
|
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
|
||||||
"/virtubox:/WordOps/xUbuntu_18.04/ /")
|
|
||||||
elif wo_platform_codename == 'disco':
|
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
|
||||||
"/virtubox:/WordOps/xUbuntu_19.04/ /")
|
|
||||||
elif wo_platform_codename == 'jessie':
|
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
|
||||||
"/virtubox:/WordOps/Debian_8.0/ /")
|
|
||||||
elif wo_platform_codename == 'stretch':
|
|
||||||
wo_nginx_repo = ("deb http://download.opensuse.org/repositories/home:"
|
|
||||||
"/virtubox:/WordOps/Debian_9.0/ /")
|
|
||||||
|
|
||||||
wo_nginx = ["nginx-custom", "nginx-wo"]
|
wo_nginx = ["nginx-custom", "nginx-wo"]
|
||||||
wo_nginx_key = '188C9FB063F0247A'
|
wo_nginx_key = '188C9FB063F0247A'
|
||||||
@@ -161,7 +172,6 @@ class WOVariables():
|
|||||||
"http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
"http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
||||||
"10.3/debian {codename} main"
|
"10.3/debian {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
|
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb"]
|
wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb"]
|
||||||
|
|
||||||
wo_fail2ban = "fail2ban"
|
wo_fail2ban = "fail2ban"
|
||||||
|
|||||||
Reference in New Issue
Block a user