0

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?

2
  • 1
    IMHO best way to automate this is to implement mysql_secure_installation using standard Ansible modules. Check this answer by Michael Hampton for a reference implementation. Oct 13, 2021 at 10:16
  • 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.
    – Synchro
    Oct 13, 2021 at 19:55

0

You must log in to answer this question.

Browse other questions tagged .