mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-05-24 09:59:09 -07:00
cut jinja templates from conditionals
This commit is contained in:
parent
0c5e870d75
commit
e912d7e28a
10 changed files with 159 additions and 104 deletions
|
@ -23,7 +23,7 @@
|
|||
- name: Assert output message changed value
|
||||
assert:
|
||||
that:
|
||||
- "output.changed | bool == changed | bool"
|
||||
- output.changed | bool == changed | bool
|
||||
|
||||
- name: Run mysql command to show variable
|
||||
command: "{{ mysql_command }} \"-e show variables like '{{ var_name }}'\""
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
- name: assert output message changed value
|
||||
assert:
|
||||
that:
|
||||
- "output.changed | bool == changed | bool"
|
||||
- output.changed | bool == changed | bool
|
||||
|
||||
- set_fact:
|
||||
key_name: "{{ var_name }}"
|
||||
|
@ -36,5 +36,5 @@
|
|||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- "key_name in result.stdout"
|
||||
- "key_value in result.stdout"
|
||||
- key_name in result.stdout
|
||||
- key_value in result.stdout
|
||||
|
|
|
@ -92,7 +92,9 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.queries == ["SET GLOBAL `{{ set_name }}` = {{ set_value }}"]
|
||||
- result.queries == expected_queries
|
||||
vars:
|
||||
expected_queries: ["SET GLOBAL `{{ set_name }}` = {{ set_value }}"]
|
||||
|
||||
- include_tasks: assert_var.yml
|
||||
vars:
|
||||
|
@ -316,7 +318,9 @@
|
|||
assert:
|
||||
that:
|
||||
- result is changed or result.msg == "Variable is already set to requested value."
|
||||
- result.msg == "Variable is already set to requested value." or result.queries == ["SET GLOBAL `{{ log_slow_statements }}` = ON"]
|
||||
- result.msg == "Variable is already set to requested value." or result.queries == expected_queries
|
||||
vars:
|
||||
expected_queries: ["SET GLOBAL `{{ log_slow_statements }}` = ON"]
|
||||
|
||||
- name: Set a boolean value again using ON
|
||||
mysql_variables:
|
||||
|
@ -378,7 +382,9 @@
|
|||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result.queries == ["SET GLOBAL `{{ log_slow_statements }}` = ON"]
|
||||
- result.queries == expected_queries
|
||||
vars:
|
||||
expected_queries: ["SET GLOBAL `{{ log_slow_statements }}` = ON"]
|
||||
|
||||
#============================================================
|
||||
# Verify mysql_variable fails with an incorrect login_password parameter
|
||||
|
@ -452,7 +458,9 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.queries == ["SET PERSIST `{{ set_name }}` = {{ set_value }}"]
|
||||
- result.queries == expected_queries
|
||||
vars:
|
||||
expected_queries: ["SET PERSIST `{{ set_name }}` = {{ set_value }}"]
|
||||
|
||||
- include_tasks: assert_var.yml
|
||||
vars:
|
||||
|
@ -494,7 +502,9 @@
|
|||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
- result.queries == ["SET PERSIST_ONLY `{{ set_name }}` = {{ set_value }}"]
|
||||
- result.queries == expected_queries
|
||||
vars:
|
||||
expected_queries: ["SET PERSIST_ONLY `{{ set_name }}` = {{ set_value }}"]
|
||||
|
||||
- name: try to update mysql variable value (expect changed=false) in persist_only mode again
|
||||
mysql_variables:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue