mirror of https://github.com/jumpserver/jumpserver
parent
3cc22f8524
commit
5f2f38d815
|
@ -2,6 +2,7 @@
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: /usr/local/bin/python
|
ansible_python_interpreter: /usr/local/bin/python
|
||||||
|
db_name: "{{ jms_asset.spec_info.db_name }}"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Test MySQL connection
|
- name: Test MySQL connection
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
name: "{{ account.username }}"
|
name: "{{ account.username }}"
|
||||||
password: "{{ account.secret }}"
|
password: "{{ account.secret }}"
|
||||||
host: "%"
|
host: "%"
|
||||||
|
priv: "{{ account.username + '.*:USAGE' if db_name == '' else db_name + '.*:ALL' }}"
|
||||||
when: db_info is succeeded
|
when: db_info is succeeded
|
||||||
register: change_info
|
register: change_info
|
||||||
|
|
||||||
|
@ -37,5 +39,5 @@
|
||||||
login_port: "{{ jms_asset.port }}"
|
login_port: "{{ jms_asset.port }}"
|
||||||
filter: version
|
filter: version
|
||||||
when:
|
when:
|
||||||
- db_info is succeeded
|
- db_info is succeeded
|
||||||
- change_info is succeeded
|
- change_info is succeeded
|
|
@ -28,6 +28,7 @@
|
||||||
db: "{{ jms_asset.spec_info.db_name }}"
|
db: "{{ jms_asset.spec_info.db_name }}"
|
||||||
name: "{{ account.username }}"
|
name: "{{ account.username }}"
|
||||||
password: "{{ account.secret }}"
|
password: "{{ account.secret }}"
|
||||||
|
role_attr_flags: LOGIN
|
||||||
when: result is succeeded
|
when: result is succeeded
|
||||||
register: change_info
|
register: change_info
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class PushAccountManager(ChangeSecretManager, AccountBasePlaybookManager):
|
||||||
account_info = self.name_recorder_mapper.get(host)
|
account_info = self.name_recorder_mapper.get(host)
|
||||||
if not account_info:
|
if not account_info:
|
||||||
return
|
return
|
||||||
print('account_info', account_info)
|
|
||||||
account = account_info['account']
|
account = account_info['account']
|
||||||
new_secret = account_info['new_secret']
|
new_secret = account_info['new_secret']
|
||||||
if not account:
|
if not account:
|
||||||
|
|
Loading…
Reference in New Issue