Skip to content
Snippets Groups Projects
Commit e6f098aa authored by Temur Maisuradze's avatar Temur Maisuradze
Browse files

stop, restart and update-config scripts for mysql

parent 17e9571d
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ FROM {{repo}}/centos:{{version}}{{suffix}} ...@@ -2,7 +2,7 @@ FROM {{repo}}/centos:{{version}}{{suffix}}
USER root USER root
RUN yum -y update && yum install -y epel-release centos-release-scl scl-utils && \ RUN yum -y update && yum install -y epel-release centos-release-scl scl-utils && \
yum install -y rh-mariadb103 python36-PyMySQL MySQL-python supervisor && \ yum install -y rh-mariadb103 python36-PyMySQL MySQL-python supervisor rsync && \
/usr/bin/scl enable rh-mariadb103 -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-prepare-db-dir /var/opt/rh/rh-mariadb103/lib/mysql /usr/bin/scl enable rh-mariadb103 -- /opt/rh/rh-mariadb103/root/usr/libexec/mysql-prepare-db-dir /var/opt/rh/rh-mariadb103/lib/mysql
RUN yum clean all RUN yum clean all
......
--- ---
- include: secure.yml - include: secure.yml
tags:
- start
- include: misp.yml - include: misp.yml
tags:
- start
- include: stop.yml
tags:
- stop
- stop-mysql
- include: update-config.yml
tags:
- update-config
- update-mysql-config
- include: restart.yml
tags:
- restart
- restart-mysql
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
mysql_db: mysql_db:
name: "{{misp_dbname}}" name: "{{misp_dbname}}"
state: present state: present
tags:
- start
- name: Create misp user - name: Create misp user
mysql_user: mysql_user:
...@@ -15,13 +13,12 @@ ...@@ -15,13 +13,12 @@
password: "{{lookup('password', '{{playbook_dir}}/secrets/passwords/mysql_misp')}}" password: "{{lookup('password', '{{playbook_dir}}/secrets/passwords/mysql_misp')}}"
priv: "{{misp_dbname}}.*:ALL" priv: "{{misp_dbname}}.*:ALL"
with_items: "{{groups['mispcontainers']}}" with_items: "{{groups['mispcontainers']}}"
tags:
- start
- name: Set Autostart for supervisord's services - name: Set Autostart for supervisord's services
shell: "sed -i 's/autostart=false/autostart=true/g' /etc/supervisord.conf" replace:
tags: path: /etc/supervisord.conf
- start regexp: '^autostart=false$'
replace: 'autostart=true'
# CREATE DATABASE IF NOT EXISTS {{misp_dbname}}; # CREATE DATABASE IF NOT EXISTS {{misp_dbname}};
......
---
- name: Restart MySQL
shell: "supervisorctl restart mysql"
---
- name: Stop MySQL
shell: "supervisorctl stop mysql"
---
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment