aboutsummaryrefslogtreecommitdiff
path: root/docker/mariadb-server/security_reset.expect
diff options
context:
space:
mode:
authorSeunghun Lee <seunghun@stackhpc.com>2025-10-13 15:17:27 +0100
committerSeunghun Lee <seunghun@stackhpc.com>2025-10-14 10:06:30 +0100
commitcd75df6ce06b12c01af0eeb9578d2ca80af4f0cf (patch)
tree3433bd0239f87ee038c4c397d34753d7d03689d3 /docker/mariadb-server/security_reset.expect
parent79726bd9d5e3d23558b4495a84be9e12b0714b3f (diff)
downloadkolla-cd75df6ce06b12c01af0eeb9578d2ca80af4f0cf.tar.gz
kolla-cd75df6ce06b12c01af0eeb9578d2ca80af4f0cf.zip
Drop support for building MariaDB clustercheck
MariaDB clustercheck script has not been maintained and it will not work with MariaDB 11.4 (the next LTS version). This is because clustercheck.sh uses ``mysql*`` commands but from MariaDB 11.4, those commands are not supported. The health check of MariaDB server containers will be done by new script which comes with change [1]. Without MariaDB clustercheck, MariaDB server becomes only container image in the family, so mariadb-base and mariadb-server dockerfiles are merged. To avoid breaking changes, the name 'mariadb-server' is retained. Follow-up to rename references in Kolla and K-A from 'mariadb-server' to 'mariadb' would be nice. [1] https://review.opendev.org/c/openstack/kolla/+/962657 Change-Id: I01278f76ee82b018a854b5862f3caaa8c78a9a30 Signed-off-by: Seunghun Lee <seunghun@stackhpc.com>
Diffstat (limited to 'docker/mariadb-server/security_reset.expect')
-rw-r--r--docker/mariadb-server/security_reset.expect67
1 files changed, 67 insertions, 0 deletions
diff --git a/docker/mariadb-server/security_reset.expect b/docker/mariadb-server/security_reset.expect
new file mode 100644
index 000000000..06f1d5c8e
--- /dev/null
+++ b/docker/mariadb-server/security_reset.expect
@@ -0,0 +1,67 @@
+#!/usr/bin/expect -f
+
+if [catch {set timeout $env(DB_MAX_TIMEOUT)}] {set timeout 10}
+spawn mariadb-secure-installation
+expect {
+ timeout { send_user "\nFailed to get 'Enter current password for root (enter for none):' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Enter current password for root (enter for none):' prompt\n"; exit 1 }
+ "Enter current password for root (enter for none):"
+}
+send "\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Switch to unix_socket authentication [Y/n] ' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Switch to unix_socket authentication [Y/n]' prompt\n"; exit 1 }
+ "Switch to unix_socket authentication \\\[Y/n\\\] "
+}
+send "n\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Change the root password? [Y/n]' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Change the root password? [Y/n]' prompt\n"; exit 1 }
+ "Change the root password? \\\[Y/n\\\] "
+}
+send "y\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'New password:' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'New password:' prompt\n"; exit 1 }
+ "New password:"
+}
+send "$env(DB_ROOT_PASSWORD)\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Re-enter new password:' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Re-enter new password:' prompt\n"; exit 1 }
+ "Re-enter new password:"
+}
+send "$env(DB_ROOT_PASSWORD)\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Remove anonymous users?' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Remove anonymous users?' prompt\n"; exit 1 }
+ "Remove anonymous users?"
+}
+send "y\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Disallow root login remotely?' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Disallow root login remotely?' prompt\n"; exit 1 }
+ "Disallow root login remotely?"
+}
+send "n\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Remove test database and access to it?' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Remove test database and access to it?' prompt\n"; exit 1 }
+ "Remove test database and access to it?"
+}
+send "y\r"
+
+expect {
+ timeout { send_user "\nFailed to get 'Reload privilege tables now?' prompt\n"; exit 1 }
+ eof { send_user "\nFailed to get 'Reload privilege tables now?' prompt\n"; exit 1 }
+ "Reload privilege tables now?"
+}
+send "y\r"
+expect eof