mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-04 13:14:26 -07:00
Fix: test_mysql_db : assert that databases does not exist
"assertion": "database1 not in mysql_result.stdout"
This commit is contained in:
parent
67a18e56e5
commit
f22bc3fea4
1 changed files with 12 additions and 0 deletions
|
@ -14,6 +14,18 @@
|
|||
#
|
||||
# ==========================================================================
|
||||
# Initial check - To confirm that database does not exist before executing check mode tasks
|
||||
- name: Drop databases before test
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
login_password: '{{ mysql_password }}'
|
||||
login_host: 127.0.0.1
|
||||
login_port: '{{ mysql_primary_port }}'
|
||||
name:
|
||||
- '{{ db1_name }}'
|
||||
- '{{ db2_name }}'
|
||||
- '{{ db3_name }}'
|
||||
state: absent
|
||||
|
||||
- name: run command to list databases like specified database name
|
||||
command: "{{ mysql_command }} \"-e show databases like 'database%'\""
|
||||
register: mysql_result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue