mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-20 09:21:25 -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 }}
|
- name: Utils | Assert user password | Apply update_password to {{ username }}
|
||||||
mysql_user:
|
community.mysql.mysql_user:
|
||||||
login_user: '{{ mysql_parameters.login_user }}'
|
login_user: '{{ mysql_parameters.login_user }}'
|
||||||
login_password: '{{ mysql_parameters.login_password }}'
|
login_password: '{{ mysql_parameters.login_password }}'
|
||||||
login_host: '{{ mysql_parameters.login_host }}'
|
login_host: '{{ mysql_parameters.login_host }}'
|
||||||
|
@ -13,16 +13,17 @@
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Utils | Assert user password | Assert a change occurred
|
- name: Utils | Assert user password | Assert a change occurred
|
||||||
assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- "result.changed | bool == {{ expect_change }} | bool"
|
- result.changed | bool == expect_change | bool
|
||||||
- "result.password_changed == {{ expect_password_change }}"
|
- result.password_changed == expect_password_change
|
||||||
|
|
||||||
- name: Utils | Assert user password | Query user {{ username }}
|
- name: Utils | Assert user password | Assert expect_hash is in user stdout for {{ username }}
|
||||||
command: "{{ mysql_command }} -BNe \"SELECT plugin, authentication_string FROM mysql.user where user='{{ username }}' and host='{{ host }}'\""
|
ansible.builtin.command: >-
|
||||||
|
{{ mysql_command }} -BNe "SELECT plugin, authentication_string
|
||||||
|
FROM mysql.user where user='{{ username }}' and host='{{ host }}'"
|
||||||
register: existing_user
|
register: existing_user
|
||||||
|
changed_when: false
|
||||||
- name: Utils | Assert user password | Assert expect_hash is in user stdout
|
failed_when: pattern not in existing_user.stdout_lines
|
||||||
assert:
|
vars:
|
||||||
that:
|
pattern: "mysql_native_password\t{{ expect_password_hash }}"
|
||||||
- "'mysql_native_password\t{{ expect_password_hash }}' in existing_user.stdout_lines"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue