Fixes in mariadb task
This commit is contained in:
parent
eb7e913469
commit
1700734c2a
1 changed files with 15 additions and 5 deletions
|
|
@ -93,20 +93,30 @@ elif linux_distro=='rocky' or linux_distro=='alma' or linux_distro=='fedora':
|
|||
|
||||
print('Error, cannot set the password')
|
||||
sys.exit(1)
|
||||
else:
|
||||
print('Mariadb installed successfully')
|
||||
sys.exit(0)
|
||||
|
||||
if args.ip:
|
||||
|
||||
if subprocess.call("sudo sed -i 's/pid-file=\/run\/mariadb\/mariadb.pid/pid-file=\/run\/mariadb\/mariadb.pid\nbind-address = {}/g' /etc/my.cnf.d/mariadb-server.cnf".format(args.ip), shell=True) > 0:
|
||||
print('Changing IP to listen...')
|
||||
if subprocess.call("sudo sed -i 's/pid-file=\/run\/mariadb\/mariadb\.pid/pid-file=\/run\/mariadb\/mariadb.pid\\nbind-address = {}/g' /etc/my.cnf.d/mariadb-server.cnf".format(args.ip), shell=True) > 0:
|
||||
print('Error, cannot install MariaDB...')
|
||||
sys.exit(1)
|
||||
|
||||
#Open firewall
|
||||
#firewall-cmd --add-service=mysql && firewall-cmd --add-service=mysql --permanent
|
||||
|
||||
if subprocess.call("sudo firewall-cmd --add-service=mysql && sudo firewall-cmd --add-service=mysql --permanent", shell=True) > 0:
|
||||
print('Error, cannot open mariadb port in firewalld...')
|
||||
sys.exit(1)
|
||||
|
||||
else:
|
||||
print('Listen localhost by default...')
|
||||
|
||||
if subprocess.call("sudo systemctl enable mariadb", shell=True) > 0:
|
||||
print('Error, cannot enable mariadb')
|
||||
sys.exit(1)
|
||||
|
||||
print('Mariadb installed successfully')
|
||||
sys.exit(0)
|
||||
|
||||
if subprocess.call("sudo systemctl restart mariadb", shell=True) > 0:
|
||||
print('Error, cannot restart mariadb')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue