perf: mysql psql database (#9609)

Co-authored-by: feng <1304903146@qq.com>
pull/9614/head
fit2bot 2023-02-17 19:00:44 +08:00 committed by GitHub
parent 3cc22f8524
commit 5f2f38d815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -2,6 +2,7 @@
gather_facts: no
vars:
ansible_python_interpreter: /usr/local/bin/python
db_name: "{{ jms_asset.spec_info.db_name }}"
tasks:
- name: Test MySQL connection
@ -26,6 +27,7 @@
name: "{{ account.username }}"
password: "{{ account.secret }}"
host: "%"
priv: "{{ account.username + '.*:USAGE' if db_name == '' else db_name + '.*:ALL' }}"
when: db_info is succeeded
register: change_info
@ -37,5 +39,5 @@
login_port: "{{ jms_asset.port }}"
filter: version
when:
- db_info is succeeded
- change_info is succeeded
- db_info is succeeded
- change_info is succeeded

View File

@ -28,6 +28,7 @@
db: "{{ jms_asset.spec_info.db_name }}"
name: "{{ account.username }}"
password: "{{ account.secret }}"
role_attr_flags: LOGIN
when: result is succeeded
register: change_info

View File

@ -92,7 +92,7 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
account_info = self.name_recorder_mapper.get(host)
if not account_info:
return
print('account_info', account_info)
account = account_info['account']
new_secret = account_info['new_secret']
if not account: