generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#120 (#130) * Skip checking flagIN value before inserting rules (#108) * Skip checking flagIN value before inserting rules * Add changelogs fragments * Update changelogs/fragments/107-update_destination_hostgroup.yml * include integration test * fix typo * more debug outputs * more checks * fix query_data order * append changelog Co-authored-by: Markus Bergholz <[email protected]> * too many blank lines (#120) Co-authored-by: Squirrel <[email protected]>
- Loading branch information
1 parent
68286cb
commit a781c12
Showing
4 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bugfixes: | ||
- proxysql_query_rules_fast_routing - remove unnecessary ``flagIN`` check, that makes it impossible to update the ``destination_hostgroup`` parameter (https://github.com/ansible-collections/community.proxysql/pull/108). | ||
- proxysql_query_rules_fast_routing - fix query parameter order, that prevents updating ``destination_hostgroup`` parameter (https://github.com/ansible-collections/community.proxysql/pull/108). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...targets/test_proxysql_query_rules_fast_routing/tasks/107-update_destination_hostgroup.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
- name: Create fast routing rules | ||
community.proxysql.proxysql_query_rules_fast_routing: | ||
# rule args | ||
username: user | ||
schemaname: test_database | ||
destination_hostgroup: 1 | ||
# auth args | ||
login_user: admin | ||
login_password: admin | ||
state: present | ||
register: out | ||
|
||
- debug: | ||
var: out | ||
|
||
- name: verify create | ||
assert: | ||
that: | ||
- out is changed | ||
- out.rules[0].destination_hostgroup == "1" | ||
|
||
- name: Update destination hostgroup of previous fast routing rule | ||
community.proxysql.proxysql_query_rules_fast_routing: | ||
# rule args | ||
username: user | ||
schemaname: test_database | ||
destination_hostgroup: 2 | ||
# auth args | ||
login_user: admin | ||
login_password: admin | ||
state: present | ||
register: out | ||
|
||
- debug: | ||
var: out | ||
|
||
- name: verify change | ||
assert: | ||
that: | ||
- out is changed | ||
- out.rules[0].destination_hostgroup == "2" | ||
|
||
- name: Update destination hostgroup of previous fast routing rule (idempotent) | ||
community.proxysql.proxysql_query_rules_fast_routing: | ||
# rule args | ||
username: user | ||
schemaname: test_database | ||
destination_hostgroup: 2 | ||
# auth args | ||
login_user: admin | ||
login_password: admin | ||
state: present | ||
register: out | ||
|
||
- debug: | ||
var: out | ||
|
||
- name: verify no change | ||
assert: | ||
that: | ||
- out is not changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters