Fix: test_mysql_db : assert that databases does not exist

"assertion": "database1 not in mysql_result.stdout"
This commit is contained in:
R. Sicart 2021-11-22 18:19:38 +01:00
commit f22bc3fea4

View file

@ -14,6 +14,18 @@
# #
# ========================================================================== # ==========================================================================
# Initial check - To confirm that database does not exist before executing check mode tasks # 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 - name: run command to list databases like specified database name
command: "{{ mysql_command }} \"-e show databases like 'database%'\"" command: "{{ mysql_command }} \"-e show databases like 'database%'\""
register: mysql_result register: mysql_result