mysql modules: fix failing when \!include_dir is in .my.cnf

This commit is contained in:
Andrew Klychkov 2020-10-13 09:27:21 +03:00
parent 8c79011dbd
commit 4855ac4d24
2 changed files with 29 additions and 9 deletions

View file

@ -3,6 +3,7 @@
config_file: "/root/.my1.cnf"
fake_port: 9999
fake_host: "blahblah.local"
include_dir: "/root/.my.cnf.d"
- name: Create custom config file
shell: 'echo "[client]" > {{ config_file }}'
@ -10,6 +11,15 @@
- name: Add fake port to config file
shell: 'echo "port = {{ fake_port }}" >> {{ config_file }}'
- name: Create include_dir
file:
path: '{{ include_dir }}'
state: directory
mode: '0777'
- name: Add include_dir
shell: 'echo "!include_dir {{ include_dir }}" >> {{ config_file }}'
- name: Create database using fake port to connect to, must fail
mysql_db:
login_user: '{{ mysql_user }}'