Mysql: cron frequency can be changed
This commit is contained in:
parent
116f82d580
commit
f45d7ded46
|
@ -16,5 +16,6 @@ mysql_thread_cache_size: '{{ ansible_processor_cores }}'
|
||||||
mysql_innodb_buffer_pool_size: '{{ (ansible_memtotal_mb * 0.3) | int }}M'
|
mysql_innodb_buffer_pool_size: '{{ (ansible_memtotal_mb * 0.3) | int }}M'
|
||||||
|
|
||||||
mysql_cron_optimize: True
|
mysql_cron_optimize: True
|
||||||
|
mysql_cron_optimize_frequency: weekly
|
||||||
|
|
||||||
mysql_force_new_nrpe_password: False
|
mysql_force_new_nrpe_password: False
|
||||||
|
|
|
@ -55,16 +55,24 @@
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
||||||
- name: Enable Weekly cron to optimize MySQL
|
- name: "Cron dir is present"
|
||||||
|
file:
|
||||||
|
path: "/etc/cron.{{ mysql_cron_optimize_frequency | mandatory }}"
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: "Enable cron to optimize MySQL"
|
||||||
file:
|
file:
|
||||||
src: "{{ mysql_scripts_dir or general_scripts_dir | mandatory }}/mysql-optimize.sh"
|
src: "{{ mysql_scripts_dir or general_scripts_dir | mandatory }}/mysql-optimize.sh"
|
||||||
dest: /etc/cron.weekly/mysql-optimize.sh
|
dest: /etc/cron.{{ mysql_cron_optimize_frequency | mandatory }}/mysql-optimize.sh
|
||||||
state: link
|
state: link
|
||||||
when: mysql_cron_optimize
|
when: mysql_cron_optimize
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
||||||
- name: Disable Weekly cron to optimize MySQL
|
- name: "Disable cron to optimize MySQL"
|
||||||
file:
|
file:
|
||||||
dest: /etc/cron.weekly/mysql-optimize.sh
|
dest: /etc/cron.weekly/mysql-optimize.sh
|
||||||
state: absent
|
state: absent
|
||||||
|
|
Loading…
Reference in a new issue