Browse Source

mysql: add a variable to prevent mysql from restarting

projet6062
Jérémy Lecour 3 years ago
committed by Jérémy Lecour
parent
commit
b2596aad2a
  1. 1
      CHANGELOG.md
  2. 1
      mysql-oracle/README.md
  3. 2
      mysql-oracle/defaults/main.yml
  4. 5
      mysql-oracle/handlers/main.yml
  5. 3
      mysql-oracle/tasks/main.yml
  6. 2
      mysql-oracle/tasks/tmpdir.yml
  7. 2
      mysql/defaults/main.yml
  8. 5
      mysql/handlers/main.yml
  9. 3
      mysql/tasks/main.yml
  10. 2
      mysql/tasks/tmpdir.yml

1
CHANGELOG.md

@ -14,6 +14,7 @@ The **patch** part changes incrementally at each release.
* etc-git: manage a cron job to monitor uncommited changes in /etc/.git (default: `True`)
* evolinux-base: better shell history
* evolinux-users: add user to /etc/aliases
* mysql: add a variable to prevent mysql from restarting
* webapps/evoadmin-web: add users to /etc/aliases
### Changed

1
mysql-oracle/README.md

@ -28,6 +28,7 @@ Tasks are extracted in several files, included in `tasks/main.yml` :
* `general_scripts_dir`: general directory for scripts installation (default: `/usr/local/bin`).
* `mysql_scripts_dir`: email address to send Log2mail messages to (default: `general_scripts_dir`).
* `mysql_force_new_nrpe_password` : change the password for NRPE even if it exists already (default: `False`).
* `mysql_restart_if_needed` : should the restart handler be executed (default: `True`)
NB : changing the _datadir_ location can be done multiple times, as long as it is not restored to the default initial location, (because a symlink is created and can't be switched back, yet).

2
mysql-oracle/defaults/main.yml

@ -22,3 +22,5 @@ mysql_cron_mysqltuner: True
mysql_cron_mysqltuner_frequency: monthly
mysql_force_new_nrpe_password: False
mysql_restart_if_needed: True

5
mysql-oracle/handlers/main.yml

@ -14,6 +14,11 @@
name: mysql
state: restarted
- name: restart mysql (noop)
meta: noop
failed_when: False
changed_when: False
- name: reload systemd
systemd:
name: mysql

3
mysql-oracle/tasks/main.yml

@ -1,5 +1,8 @@
---
- set_fact:
mysql_restart_handler_name: "{{ mysql_restart_if_needed | bool | ternary('restart mysql', 'restart mysql (noop)') }}"
- include: packages.yml
- include: users.yml

2
mysql-oracle/tasks/tmpdir.yml

@ -17,7 +17,7 @@
section: mysqld
option: tmpdir
value: "{{ mysql_custom_tmpdir }}"
notify: restart mysql
notify: "{{ mysql_restart_handler_name }}"
tags:
- mysql
when: mysql_custom_tmpdir != ''

2
mysql/defaults/main.yml

@ -40,3 +40,5 @@ mysql_force_new_nrpe_password: False
mysql_evolinux_defaults_file: z-evolinux-defaults.cnf
mysql_evolinux_custom_file: zzz-evolinux-custom.cnf
mysql_restart_if_needed: True

5
mysql/handlers/main.yml

@ -14,6 +14,11 @@
name: mysql
state: restarted
- name: restart mysql (noop)
meta: noop
failed_when: False
changed_when: False
- name: reload systemd
systemd:
name: mysql

3
mysql/tasks/main.yml

@ -1,5 +1,8 @@
---
- set_fact:
mysql_restart_handler_name: "{{ mysql_restart_if_needed | bool | ternary('restart mysql', 'restart mysql (noop)') }}"
- include: packages_stretch.yml
when: ansible_distribution_major_version | version_compare('9', '>=')

2
mysql/tasks/tmpdir.yml

@ -17,7 +17,7 @@
section: mysqld
option: tmpdir
value: "{{ mysql_custom_tmpdir }}"
notify: restart mysql
notify: "{{ mysql_restart_handler_name }}"
tags:
- mysql
when: mysql_custom_tmpdir != ''

Loading…
Cancel
Save