Commit c0e348b3 authored by JooHan Hong's avatar JooHan Hong

mariadb, modify

parent f1a27ae3
Pipeline #5137 passed with stages
in 2 seconds
......@@ -7,8 +7,8 @@
## 주요 기능
- templates/resolv.conf.j2 파일을 이용해 변수에 맞게 DNS Resolver 설정을 수행할 수 있다.
- DNS Resolver는 설정즉시 반영되기 때문에 설정 후 dig 명령을 통해 제대로 Resolving 되는 지 확인한다.
- templates/my.cnf.j2 Jinja2 템플릿을 사용하여, server_id,innodb_buffer_pool_size를 조정한다.
- OS 별 MariaDB 패키지를 취사선택(Facts 변수)하여 설치한다.
## Inventory 설정
......@@ -50,25 +50,44 @@ ansible_python_interpreter: python2.7
buffer_pool_size: "65535MB"
mysql_conf_src: "/etc/mysql_src"
tasks:
- name: Basic apt sources.list file Backup
command: cp -rf /etc/apt/sources.list /etc/apt/sources.list_src
when: sources_list_src is not exists
- name: APT sources.list file copy
copy:
src: "{{ item }}"
dest: /etc/apt/sources.list.d
owner: 'root'
group: 'root'
mode: 0644
#attr: i
with_items:
['MariaDB']
when: ansible_os_family == "Debian"
- name: APT source sources.list file copy
- name: YUM repo file copy
copy:
src: "{{ item }}"
dest: /etc/apt/sources.list
dest: /etc/yum.repos.d
owner: 'root'
group: 'root'
mode: 0644
#attr: i
with_items:
['sources.list']
['MariaDB.repo']
when: ansible_os_family == "CentOS"
- name: MariaDB 10.3 Installing
- name: MariaDB 10.3 Installing (APT)
apt:
pkg:
- mariadb-server=10.3
when: ansible_os_family == "Debian"
- name: MariaDB 10.3 Installing (YUM)
yum:
name: {{ item }}
with_items:
- MariaDB
- MariaDB-server
- MariaDB-client
when: ansible_os_family == "CentOS"
- name: MariaDB Basic Setting
command: cp -rfp /etc/mysql /etc/mysql_src
......@@ -86,6 +105,7 @@ ansible_python_interpreter: python2.7
- { src: mysql_config/mariadb.cnf, dest: /etc/mysql/conf.d/mariadb.cnf }
- { src: mysql_config/mysqld_safe_syslog.cnf, dest: /etc/mysql/conf.d/mysqld_safe_syslog.cnf }
- { src: mysql_config/tokudb.cnf, dest: /etc/mysql/conf.d/tokudb.cnf }
when: ansible_os_family == "Debian"
- name: mysql config files permission set
file:
......@@ -97,9 +117,15 @@ ansible_python_interpreter: python2.7
- { path: /etc/mysql/conf.d/mariadb.cnf, mode: 644 }
- { path: /etc/mysql/conf.d/mysqld_safe_syslog.cnf, mode: 644 }
- { path: /etc/mysql/conf.d/tokudb.cnf, mode: 644 }
when: ansible_os_family == "Debian"
- name: ntp.conf configuration
- name: my.cnf configuration
template: src=templates/my.cnf.j2 dest=/etc/mysql/my.cnf mode=0644
when: ansible_os_family == "Debian"
- name: my.cnf configuration
template: src=templates/my.cnf.j2 dest=/etc/my.cnf mode=0644
when: ansible_os_family == "CentOS"
- name: mysqld Daemon Restart
systemd:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment