Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robolovo committed Apr 14, 2023
1 parent d8e1bb0 commit f126e48
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[defaults]
inventory = /etc/ansible/hosts
remote_user = root
remote_user = ec2-user
ask_pass = False
2 changes: 1 addition & 1 deletion group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mha_base_path: /mnt/mha
mha_conf_path: /mnt/mha/mha.cnf
mha_ssh_user: root

proxysql_base_dir: /proxysql
proxysql_base_dir: /mnt/proxysql
proxysql_rest_api_enabled: true
proxysql_rest_api_port: 10080
proxysql_admin_username: "admin"
Expand Down
6 changes: 4 additions & 2 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
- server-id

- hosts: mha_nodes
remote_user: root
become: yes
remote_user: ec2-user
roles:
- ssh
- mysql
- mha-node
- xtrabackup

- hosts: mha_manager
remote_user: root
become: yes
remote_user: ec2-user
roles:
- ssh
- mysql
Expand Down
2 changes: 1 addition & 1 deletion roles/mysql/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

- name: Extract mysql temporary password
ansible.builtin.shell: |
echo $(grep 'temporary password' /mysql/log/mysqld.log | awk '{print $13}')
echo $(grep 'temporary password' {{ mysql_base_dir }}/log/mysqld.log | awk '{print $13}')
register: mysql_temp_password
check_mode: no

Expand Down
13 changes: 9 additions & 4 deletions roles/mysql/tasks/setup-RedHat-x86-64.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
- name: Install wget
ansible.builtin.yum:
name: wget
state: present

- name: Download mysql 8.0.31 rpm bundle
ansible.builtin.shell: |
if test -f "/home/mysql-8.0.31.tar"; then
echo "mysql-8.0.31.tar already exists"
else
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.31-1.el9.x86_64.rpm-bundle.tar -O /home/mysql-8.0.31.tar
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.31-1.el7.x86_64.rpm-bundle.tar -O /home/mysql-8.0.31.tar
fi
- name: Unarchive mysql.tar
Expand All @@ -16,12 +21,12 @@
- name: Install mysql rpms
ansible.builtin.shell: |
if ! (yum list installed | grep "mysql-community-server"); then
yum install -y mysql-community-*.rpm
yum install -y /home/mysql-community-*.rpm
else
exit 0
fi
- name: Install mysql rpms
ansible.builtin.yum:
name: "MySQL-python"
state: present
name: MySQL-python
state: present

0 comments on commit f126e48

Please sign in to comment.