Score:0

Automate Percona Server installation

in flag

I'm installing Percona Server 8.0 on Ubuntu using ansible, so it's non-interactive. I'm trying to run the post-install mysql_secure_installation program, but that's not much good without interaction. Is there some way I can set its properties such as the default root password through an env var (which I've seen that percona server supports when running in docker) instead of interaction? Something along the lines of:

ansible.builtin.command: "MYSQL_ROOT_PASSWORD={{ mysql_rootpw | quote }} mysql_secure_installation"

However, this program is a binary not a script, so I can't see what it's looking for, and there are no docs on it, other than "run this".

I've also been looking in ansible galaxy for packages to do this, but it's all such a mess, and the best one I found doesn't support 8.0.

How can I best automate this installation?

Henrik Pingel avatar
in flag
IMHO best way to automate this is to implement `mysql_secure_installation` using standard Ansible modules. Check [this answer by Michael Hampton](https://serverfault.com/questions/1026554/how-to-do-mysql-secure-installation-via-ansible-playbook) for a reference implementation.
in flag
Thanks. I was trying to avoid rolling my own, but all too often I find that galaxy roles are unusable - the most popular percona one doesn't support 8.0! – so I have ended up writing it myself, and that question was helpful.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.