Skip to content

Commit

Permalink
Refactor mariadb password setting script
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 11, 2024
1 parent 0d37c29 commit 8b55528
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imageroot/actions/clone-module/21set_mariadb_passwords
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ AMPDBPASS = agent.read_envfile("passwords.env")['AMPDBPASS']

# Set new mariadb root password
SQL_QUERY = f"""
ALTER USER 'root'@'localhost' IDENTIFIED BY '{os.environ['MARIADB_ROOT_PASSWORD']}';
ALTER USER 'root'@'%' IDENTIFIED BY '{os.environ['MARIADB_ROOT_PASSWORD']}';
ALTER USER 'root'@'localhost' IDENTIFIED BY '{MARIADB_ROOT_PASSWORD}';
ALTER USER 'root'@'%' IDENTIFIED BY '{MARIADB_ROOT_PASSWORD}';
FlUSH PRIVILEGES;
"""
agent.run_helper(*f'podman exec mariadb mysql -u root -p{MARIADB_ROOT_PASSWORD} -e'.split(), SQL_QUERY).check_returncode()
Expand Down

0 comments on commit 8b55528

Please sign in to comment.