From f124c395469f184e94572256a4507b9fd13a9a1b Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Mon, 6 Sep 2021 18:11:19 +0530 Subject: [PATCH] Add security_reset.expect.10.5 from kolla for mariadb>10.5 https://review.opendev.org/c/openstack/tripleo-common/+/800580 adds the support of building containers on CentOS Stream 9. mariadb>10.5 does not works with /usr/share/openstack-tripleo-common-containers/container-images/kolla/mariadb/security_reset.expect file. It needs https://opendev.org/openstack/kolla/src/branch/master/docker/mariadb/mariadb-server/security_reset.expect.debian to be placed with in kolla/mariadb directly so that it will work with mariadb>10.5. The file is renamed to security_reset.expect.10.5 to avoid debian in the end. Since above filepath is hardcoded in the mariadb container so putting it in c9 container build patch is not working. So we are moving it to a seperate patch. Signed-off-by: Chandan Kumar (raukadah) Change-Id: I6609345d0e60af62ca75e4bd9b3ed63167a3bc70 (cherry picked from commit e08affe816a700c996975181b84594cf02431b63) --- .../kolla/mariadb/security_reset.expect.10.5 | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 container-images/kolla/mariadb/security_reset.expect.10.5 diff --git a/container-images/kolla/mariadb/security_reset.expect.10.5 b/container-images/kolla/mariadb/security_reset.expect.10.5 new file mode 100644 index 000000000..ec40eaf90 --- /dev/null +++ b/container-images/kolla/mariadb/security_reset.expect.10.5 @@ -0,0 +1,67 @@ +#!/usr/bin/expect -f + +if [catch {set timeout $env(DB_MAX_TIMEOUT)}] {set timeout 10} +spawn mysql_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' 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?' 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