mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-09 04:00:32 -07:00
lint to prevent warning about jinja templating in when clause
This commit is contained in:
parent
fa3c7b0c05
commit
c7218c71aa
1 changed files with 12 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: Utils | Assert user password | Apply update_password to {{ username }}
|
||||
mysql_user:
|
||||
community.mysql.mysql_user:
|
||||
login_user: '{{ mysql_parameters.login_user }}'
|
||||
login_password: '{{ mysql_parameters.login_password }}'
|
||||
login_host: '{{ mysql_parameters.login_host }}'
|
||||
|
@ -13,16 +13,17 @@
|
|||
register: result
|
||||
|
||||
- name: Utils | Assert user password | Assert a change occurred
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "result.changed | bool == {{ expect_change }} | bool"
|
||||
- "result.password_changed == {{ expect_password_change }}"
|
||||
- result.changed | bool == expect_change | bool
|
||||
- result.password_changed == expect_password_change
|
||||
|
||||
- name: Utils | Assert user password | Query user {{ username }}
|
||||
command: "{{ mysql_command }} -BNe \"SELECT plugin, authentication_string FROM mysql.user where user='{{ username }}' and host='{{ host }}'\""
|
||||
- name: Utils | Assert user password | Assert expect_hash is in user stdout for {{ username }}
|
||||
ansible.builtin.command: >-
|
||||
{{ mysql_command }} -BNe "SELECT plugin, authentication_string
|
||||
FROM mysql.user where user='{{ username }}' and host='{{ host }}'"
|
||||
register: existing_user
|
||||
|
||||
- name: Utils | Assert user password | Assert expect_hash is in user stdout
|
||||
assert:
|
||||
that:
|
||||
- "'mysql_native_password\t{{ expect_password_hash }}' in existing_user.stdout_lines"
|
||||
changed_when: false
|
||||
failed_when: pattern not in existing_user.stdout_lines
|
||||
vars:
|
||||
pattern: "mysql_native_password\t{{ expect_password_hash }}"
|
||||
|
|
Loading…
Add table
Reference in a new issue