1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Update mysql/tasks/main.yml

This commit is contained in:
A Holt 2020-01-23 21:31:09 -05:00 committed by GitHub
parent 2e9db2c835
commit 920e09be2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,10 @@
# TO DO:
# - Validate input vars mysql_install & mysql_enabled
# - Put ~12 stanzas just below into install.yml
# - Triggered by... 'when: mysql_installed is undefined'
# - Eliminate stale Fedora/CentOS code & gratuitous when: is_debuntu clauses?
# - Consider putting ~8 stanzas below that into enable.yml or similar?
- name: 'Install MySQL packages: mariadb-server, mariadb-client, and 8 php packages (debuntu)'
package:
name:
@ -14,19 +21,19 @@
- php{{ php_version }}-xmlrpc
state: present
when: is_debuntu | bool
#tags: download
- name: Install php{{ php_version }}-xml (ubuntu or debian 9+)
- name: Install package 'php{{ php_version }}-xml' (debuntu) # WAS: (ubuntu or debian 9+)
package:
name: "php{{ php_version }}-xml"
state: present
when: is_ubuntu or (is_debian and not is_debian_8)
when: is_debuntu | bool
#when: is_ubuntu or (is_debian and not is_debian_8)
- name: Install php-xml-parser (debian-8)
package:
name: php-xml-parser
state: present
when: is_debian_8 | bool
#- name: Install php-xml-parser (debian-8)
# package:
# name: php-xml-parser
# state: present
# when: is_debian_8 | bool
- name: "Install packages: mysql, MySQL-python and 9 php packages (OS's other than debuntu)"
package:
@ -44,15 +51,12 @@
- php-xmlrpc
state: present
when: not is_debuntu
#tags: download
- include_tasks: centos.yml
when: ansible_distribution == "CentOS"
#tags: download
- include_tasks: fedora.yml
when: ansible_distribution == "Fedora"
#tags: download
# 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's
@ -110,6 +114,12 @@
# line: "TimeoutStartSec=180"
when: mariadb_unit_file.stat.exists
- name: "Add 'mysql_installed: True' to {{ iiab_state_file }}"
lineinfile:
dest: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^mysql_installed'
line: 'mysql_installed: True'
# Name of MySQL service varies by OS, so hardcoded in /opt/iiab/iiab/vars/<OS>.yml (formerly in roles/0-init/tasks/main.yml)
- name: Enable & Start MySQL systemd service ({{ mysql_service }}) if mysql_enabled
@ -178,6 +188,7 @@
state: stopped
when: not mysql_enabled
- name: Add 'mysql' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"