From 842ba4d592007e1af5c903beca07bde6b1252255 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 11 Apr 2020 11:55:23 -0500 Subject: [PATCH] Write out db config for root user We use this in some utlity scripts, but we currently don't write it out anywhere. It was an old puppet artifact. Change-Id: Ib6fdfc4f4a9c5d1befdb6d256989450996dd2a3d --- playbooks/roles/gerrit/tasks/main.yaml | 7 +++++++ playbooks/roles/gerrit/templates/root.my.cnf.j2 | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 playbooks/roles/gerrit/templates/root.my.cnf.j2 diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 1959975554..ac5352e9b1 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -290,6 +290,13 @@ - name: Start gerrit include_tasks: start.yaml +- name: Set up root mysql conf file + when: gerrit_database_type == 'MYSQL' + template: + src: root.my.cnf.j2 + dest: /root/.gerrit_db.cnf + mode: 0400 + - name: Set up cron job to optmize git repos cron: name: optmize-git-repos diff --git a/playbooks/roles/gerrit/templates/root.my.cnf.j2 b/playbooks/roles/gerrit/templates/root.my.cnf.j2 new file mode 100644 index 0000000000..379921f764 --- /dev/null +++ b/playbooks/roles/gerrit/templates/root.my.cnf.j2 @@ -0,0 +1,5 @@ +[client] +host={{ gerrit_mysql_host }} +user=gerrit2 +password={{ gerrit_mysql_password }} +ssl=false