From 70831f9f787ae2b00e8b239a72eaa828e157eb87 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 09:56:20 -0400 Subject: [PATCH 01/16] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index d92a4896b..eced43414 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -218,7 +218,7 @@ apache_allow_sudo: True apache_high_php_limits: False # SEE ALSO VARIABLES NEAR TOP OF THIS FILE: default_language, language_priority -# MySQL MANDATORY - THESE SETTINGS HAVE NO EFFECT - SEE roles/1-prep/tasks/computed_vars.yml, roles/mysql/tasks/main.yml +# MySQL MANDATORY - VARIABLE 'mysql_install' HAS NO EFFECT - SEE roles/mysql/tasks/main.yml mysql_install: True mysql_enabled: True # mysql_root_password: $6$iiab51$3ICIW0CLWxxMW2a3yrHZ38ukZItD5tcadL4rWcE9D.qIGStxhh8rRsaSxoj3b.MYxI/VRDNjpzSYK/V6zkWFI0 From a6236061f07f028ba408b920cfe557b784581568 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 09:57:57 -0400 Subject: [PATCH 02/16] Update main.yml --- roles/mysql/defaults/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/roles/mysql/defaults/main.yml b/roles/mysql/defaults/main.yml index 982f2a583..cfab10d2c 100644 --- a/roles/mysql/defaults/main.yml +++ b/roles/mysql/defaults/main.yml @@ -1,2 +1,9 @@ -mysql_install: True -mysql_enabled: False +# MySQL MANDATORY - VARIABLE 'mysql_install' HAS NO EFFECT - SEE roles/mysql/tasks/main.yml +# mysql_install: True +# mysql_enabled: True + +## mysql_root_password: $6$iiab51$3ICIW0CLWxxMW2a3yrHZ38ukZItD5tcadL4rWcE9D.qIGStxhh8rRsaSxoj3b.MYxI/VRDNjpzSYK/V6zkWFI0 +# mysql_root_password: fixmysql + +# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml +# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! From f9c64e6cd4fbbd42a43ebe0c37b417f1e1f34dec Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 10:08:19 -0400 Subject: [PATCH 03/16] Clean/Prep mysql/tasks/main.yml --- roles/mysql/tasks/main.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 51a76533c..2152f55b7 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -18,11 +18,11 @@ tags: - download -- name: Install php{{ php_version }}-xml (ubuntu or debian-9) +- name: Install php{{ php_version }}-xml (ubuntu or debian 9+) package: name: "php{{ php_version }}-xml" state: present - when: is_ubuntu or is_debian_9 + when: is_ubuntu or (is_debian and not is_debian_8) - name: Install php-xml-parser (debian-8) package: @@ -59,16 +59,13 @@ tags: - download +### lineinfile to add 'TimeoutStartSec=180' to /lib/systemd/system/mariadb.service here? + # Name of MySQL service varies by OS so softcoded in 1-prep -- name: 'Start MySQL systemd service: {{ mysql_service }}' +- name: Enable & Start MySQL systemd service ({{ mysql_service }}) if mysql_enabled systemd: name: "{{ mysql_service }}" state: started - when: mysql_enabled | bool - -- name: Enable MySQL systemd service (upon subsequent boots) if mysql_enabled - systemd: - name: "{{ mysql_service }}" enabled: yes when: mysql_enabled | bool From e8b18c5ea045cb9622f98209c0306f05c601d8c6 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 10:25:19 -0400 Subject: [PATCH 04/16] Further clean/prep of mysql/tasks/main.yml --- roles/mysql/tasks/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 2152f55b7..d09ea26d1 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -59,12 +59,16 @@ tags: - download -### lineinfile to add 'TimeoutStartSec=180' to /lib/systemd/system/mariadb.service here? +### lineinfile to add 'TimeoutStartSec=180' to /lib/systemd/system/mariadb.service here +# - if file exists! +# - avoid adding it repeatedly! +# - daemon_reload below... -# Name of MySQL service varies by OS so softcoded in 1-prep +# Name of MySQL service varies by OS, so hardcoded in /opt/iiab/iiab/vars/.yml (formerly in roles/0-init/tasks/main.yml) - name: Enable & Start MySQL systemd service ({{ mysql_service }}) if mysql_enabled systemd: name: "{{ mysql_service }}" + daemon_reload: yes state: started enabled: yes when: mysql_enabled | bool From 629b675d9364847c9cbe61393d70a1228e227389 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 10:27:07 -0400 Subject: [PATCH 05/16] Update main.yml --- roles/mysql/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysql/defaults/main.yml b/roles/mysql/defaults/main.yml index cfab10d2c..593d62931 100644 --- a/roles/mysql/defaults/main.yml +++ b/roles/mysql/defaults/main.yml @@ -1,4 +1,4 @@ -# MySQL MANDATORY - VARIABLE 'mysql_install' HAS NO EFFECT - SEE roles/mysql/tasks/main.yml +# MySQL MANDATORY - THESE 2 VARS HAVE NO EFFECT - SEE roles/0-init/tasks/main.yml & roles/mysql/tasks/main.yml # mysql_install: True # mysql_enabled: True From b2fc20f89b7fd0a8b236d5b05357b2996b71694f Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 10:28:06 -0400 Subject: [PATCH 06/16] Update default_vars.yml --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index eced43414..d6b8095ec 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -218,7 +218,7 @@ apache_allow_sudo: True apache_high_php_limits: False # SEE ALSO VARIABLES NEAR TOP OF THIS FILE: default_language, language_priority -# MySQL MANDATORY - VARIABLE 'mysql_install' HAS NO EFFECT - SEE roles/mysql/tasks/main.yml +# MySQL MANDATORY - THESE 2 VARS HAVE NO EFFECT - SEE roles/0-init/tasks/main.yml & roles/mysql/tasks/main.yml mysql_install: True mysql_enabled: True # mysql_root_password: $6$iiab51$3ICIW0CLWxxMW2a3yrHZ38ukZItD5tcadL4rWcE9D.qIGStxhh8rRsaSxoj3b.MYxI/VRDNjpzSYK/V6zkWFI0 From f480a0a4c78698f86a79050caa578a4aa8910445 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 10:45:11 -0400 Subject: [PATCH 07/16] lineinfile v0.1: TimeoutStartSec=180 for mariadb.service --- roles/mysql/tasks/main.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index d09ea26d1..bc8a4c4a0 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -59,10 +59,18 @@ tags: - download -### lineinfile to add 'TimeoutStartSec=180' to /lib/systemd/system/mariadb.service here -# - if file exists! -# - avoid adding it repeatedly! -# - daemon_reload below... +- name: Check if /lib/systemd/system/mariadb.service exists + stat: + path: /lib/systemd/system/mariadb.service + register: mariadb_unit_file + +- name: Set systemd boot timeout to 180 seconds for slow machines, if TimeoutStartSec not already set in /lib/systemd/system/mariadb.service + lineinfile: + path: /lib/systemd/system/mariadb.service + insertafter: '[Service]' + regexp: TimeoutStartSec + line: '\n# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180' + when: mariadb_unit_file.stat.exists # Name of MySQL service varies by OS, so hardcoded in /opt/iiab/iiab/vars/.yml (formerly in roles/0-init/tasks/main.yml) - name: Enable & Start MySQL systemd service ({{ mysql_service }}) if mysql_enabled From aa086daa32b97346ea8e92e826035e5eb52071fb Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 11:48:54 -0400 Subject: [PATCH 08/16] Force TimeoutStartSec=180 in /lib/systemd/system/mariadb.service --- roles/mysql/tasks/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index bc8a4c4a0..43c568cf6 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -64,12 +64,21 @@ path: /lib/systemd/system/mariadb.service register: mariadb_unit_file -- name: Set systemd boot timeout to 180 seconds for slow machines, if TimeoutStartSec not already set in /lib/systemd/system/mariadb.service +# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s +# for slow machines like this Ubuntu 18.04.2 VM: +# https://github.com/iiab/iiab/issues/1802 +# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd + +- name: Set systemd boot timeout to 180 seconds for slow machines, in /lib/systemd/system/mariadb.service lineinfile: path: /lib/systemd/system/mariadb.service - insertafter: '[Service]' - regexp: TimeoutStartSec - line: '\n# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180' + insertafter: '^\[Service\]$' + regexp: '^TimeoutStartSec=' + line: "TimeoutStartSec=180" + # LINE BELOW WOULD BE NICE...BUT ANSIBLE POLLUTES EACH TIME :( + # Hence Ansible's 'blockinfile', but this pollutes config files in its own + # way. Still, it might be nec in future, so config files are *READABLE* ! + #line: "\n# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180" when: mariadb_unit_file.stat.exists # Name of MySQL service varies by OS, so hardcoded in /opt/iiab/iiab/vars/.yml (formerly in roles/0-init/tasks/main.yml) From 89d091cbbb74064ff83e41db9f0950a3949046ef Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 12:07:37 -0400 Subject: [PATCH 09/16] MySQL / MariaDB state: started -> state: restarted --- roles/mysql/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 43c568cf6..9145853df 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -86,7 +86,7 @@ systemd: name: "{{ mysql_service }}" daemon_reload: yes - state: started + state: restarted enabled: yes when: mysql_enabled | bool From a5eba7eb8d48f29b3e517398d1b1b665b7287ddd Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 12:57:05 -0400 Subject: [PATCH 10/16] Copy /lib/systemd/system/mariadb.service to /etc/systemd/system/ then customize; revise 2 symlinks --- roles/mysql/tasks/main.yml | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 9145853df..5b9e9760c 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -59,19 +59,42 @@ tags: - download -- name: Check if /lib/systemd/system/mariadb.service exists - stat: - path: /lib/systemd/system/mariadb.service - register: mariadb_unit_file - # 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s # for slow machines like this Ubuntu 18.04.2 VM: # https://github.com/iiab/iiab/issues/1802 # https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd -- name: Set systemd boot timeout to 180 seconds for slow machines, in /lib/systemd/system/mariadb.service - lineinfile: +- name: Check if /lib/systemd/system/mariadb.service exists + stat: path: /lib/systemd/system/mariadb.service + register: mariadb_unit_file + +- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized + copy: + force: yes + src: /lib/systemd/system/mariadb.service + dest: /etc/systemd/system/ + when: mariadb_unit_file.stat.exists + +- name: Symlink /etc/systemd/system/mysql.service -> /etc/systemd/system/mariadb.service + file: + state: link + force: yes + src: /etc/systemd/system/mariadb.service + path: /etc/systemd/system/mysql.service + when: mariadb_unit_file.stat.exists + +- name: Symlink /etc/systemd/system/mysqld.service -> /etc/systemd/system/mariadb.service + file: + state: link + force: yes + src: /etc/systemd/system/mariadb.service + path: /etc/systemd/system/mysqld.service + when: mariadb_unit_file.stat.exists + +- name: Set systemd boot timeout to 180 seconds for slow machines, in /etc/systemd/system/mariadb.service + lineinfile: + path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' regexp: '^TimeoutStartSec=' line: "TimeoutStartSec=180" From 51ace42a1cc93cc62096b8ef95154f5f70b96bf7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 13:15:13 -0400 Subject: [PATCH 11/16] 'backup: yes' for old/custom copies of /etc/systemd/system/mariadb.service --- roles/mysql/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 5b9e9760c..541d690cc 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -94,6 +94,7 @@ - name: Set systemd boot timeout to 180 seconds for slow machines, in /etc/systemd/system/mariadb.service lineinfile: + backup: yes path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' regexp: '^TimeoutStartSec=' From 32beda22d22aaa2da4031443d6f553b0e82f86b8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 13:18:03 -0400 Subject: [PATCH 12/16] 'backup: yes' prior to copying mariadb.service from /lib/systemd/system/ to /etc/systemd/system/ --- roles/mysql/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 541d690cc..bacad5b05 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -72,6 +72,7 @@ - name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized copy: force: yes + backup: yes src: /lib/systemd/system/mariadb.service dest: /etc/systemd/system/ when: mariadb_unit_file.stat.exists @@ -94,7 +95,6 @@ - name: Set systemd boot timeout to 180 seconds for slow machines, in /etc/systemd/system/mariadb.service lineinfile: - backup: yes path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' regexp: '^TimeoutStartSec=' From e7c5e69c8dc034671ad2254cd42af7f1730f2a0a Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 13:22:49 -0400 Subject: [PATCH 13/16] Update main.yml --- roles/mysql/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index bacad5b05..71575295f 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -69,7 +69,7 @@ path: /lib/systemd/system/mariadb.service register: mariadb_unit_file -- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized +- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized (CREATES TIMETAMPED BACKUP OF /etc/systemd/system/mariadb.service e.g. IF OPERATOR CUSTOMIZED IT) copy: force: yes backup: yes From fe629f7b4b71a9d51de01b5bb46e5057543c28da Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 14:06:57 -0400 Subject: [PATCH 14/16] Document mysql/tasks/main.yml & WARN re: mod'ing /etc/systemd/system/mariadb.service --- roles/mysql/tasks/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 71575295f..7f117b6be 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -59,8 +59,9 @@ tags: - download -# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s -# for slow machines like this Ubuntu 18.04.2 VM: + +# 2019-07-03 @jvonau @holta: the next 50 lines (6 stanzas) double MariaDB's +# default boot timeout (90s to 180s) for slow CPUs like this Ubuntu 18.04.2 VM: # https://github.com/iiab/iiab/issues/1802 # https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd @@ -69,7 +70,7 @@ path: /lib/systemd/system/mariadb.service register: mariadb_unit_file -- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized (CREATES TIMETAMPED BACKUP OF /etc/systemd/system/mariadb.service e.g. IF OPERATOR CUSTOMIZED IT) +- name: Copy pkg's /lib/systemd/system/mariadb.service to /etc/systemd/system/ to be customized (CREATES TIMETAMPED BACKUPS OF /etc/systemd/system/mariadb.service e.g. IF OPERATOR CUSTOMIZED IT, EVEN DESPITE WARNING BELOW!) copy: force: yes backup: yes @@ -93,11 +94,18 @@ path: /etc/systemd/system/mysqld.service when: mariadb_unit_file.stat.exists +- name: "WARN OPERATOR: Changes made to /etc/systemd/system/mariadb.service WILL BE LOST whenever 'mysql' playbook is run" + lineinfile: + path: /etc/systemd/system/mariadb.service + insertbefore: BOF # Beginning of file + line: "# WARNING: CHANGES TO THIS FILE WILL BE REGULARLY *OVERWRITTEN* BY:\n# /opt/iiab/iiab/roles/mysql/tasks/main.yml\n" + when: mariadb_unit_file.stat.exists + - name: Set systemd boot timeout to 180 seconds for slow machines, in /etc/systemd/system/mariadb.service lineinfile: path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' - regexp: '^TimeoutStartSec=' + regexp: "^TimeoutStartSec=" line: "TimeoutStartSec=180" # LINE BELOW WOULD BE NICE...BUT ANSIBLE POLLUTES EACH TIME :( # Hence Ansible's 'blockinfile', but this pollutes config files in its own @@ -105,6 +113,7 @@ #line: "\n# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180" when: mariadb_unit_file.stat.exists + # Name of MySQL service varies by OS, so hardcoded in /opt/iiab/iiab/vars/.yml (formerly in roles/0-init/tasks/main.yml) - name: Enable & Start MySQL systemd service ({{ mysql_service }}) if mysql_enabled systemd: From ef4622bf8c8678268da916dcf14e91448159c190 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 14:36:42 -0400 Subject: [PATCH 15/16] Longer explanation restored, injected by lineinfile into mariadb.service each time, re: MariaDB's 180s timeout for slow boots --- roles/mysql/tasks/main.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 7f117b6be..85518e106 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -106,11 +106,13 @@ path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' regexp: "^TimeoutStartSec=" - line: "TimeoutStartSec=180" - # LINE BELOW WOULD BE NICE...BUT ANSIBLE POLLUTES EACH TIME :( - # Hence Ansible's 'blockinfile', but this pollutes config files in its own - # way. Still, it might be nec in future, so config files are *READABLE* ! - #line: "\n# 2019-07-03: @jvonau @holta doubled the default boot timeout from 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180" + line: "\n# 2019-07-03: @jvonau @holta doubled MariaDB's default boot timeout 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180\n" + # If the line above were to be run repeatedly (never happens here!) Ansible + # would pollute MariaDB's systemd unit file. As multi-line regexp's are + # not allowed (both regexp's should match, for idempotency). If nec, use + # the 1-liner below, or Ansible's 'blockinfile' which pollutes config files + # in its own way...surrounding blocks with marker lines. + # line: "TimeoutStartSec=180" when: mariadb_unit_file.stat.exists From 73c71f73316a0489d91ec9177d2d1a76eb6072d7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 3 Jul 2019 14:44:11 -0400 Subject: [PATCH 16/16] Cleaner comment in mariadb.service --- roles/mysql/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 85518e106..a4f6af054 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -106,7 +106,7 @@ path: /etc/systemd/system/mariadb.service insertafter: '^\[Service\]$' regexp: "^TimeoutStartSec=" - line: "\n# 2019-07-03: @jvonau @holta doubled MariaDB's default boot timeout 90s to 180s\n# for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180\n" + line: "\n# 2019-07-03: @jvonau @holta doubled MariaDB's default boot timeout, from\n# 90 seconds to 180 seconds, for slow machines like this Ubuntu 18.04.2 VM:\n# https://github.com/iiab/iiab/issues/1802\n# https://mariadb.com/kb/en/library/what-to-do-if-mariadb-doesnt-start/#systemd\nTimeoutStartSec=180\n" # If the line above were to be run repeatedly (never happens here!) Ansible # would pollute MariaDB's systemd unit file. As multi-line regexp's are # not allowed (both regexp's should match, for idempotency). If nec, use