Issues with mysql_db module

52 views
Skip to first unread message

lift...@gmail.com

unread,
May 16, 2023, 2:20:56 PM5/16/23
to Ansible Project
Something changed with the mysql_db module recently and it has broken all of our MySQL backup playbooks.  We get the following error now:

unable to find '/home/user/.my.cnf' . Exception message: 'password' is an invalid keyword argument for this function

According to the documentation, the default for config_file is "~/.my.cnf" for the user and password.  But if we make that an empty string, it should be ignored.  However, when I try that, I get the same error message, only without the path to the .my.cnf file:

unable to find . Exception message: 'password' is an invalid keyword argument for this function

We are specifying our username and password via Ansible Vault:

  - name: Backup MySQL databases
    community.mysql.mysql_db:
      state: dump
      name: "redmine"
      target: "/tmp/backup_{{ inventory_hostname }}.{{ ansible_date_time.month }}{{ ansible_date_time.day }}{{ ansible_date_time.year }}.sql"
      config_file: ''
      login_user: root
      login_password: "{{ mysql_password }}"

How can I determine why I'm getting the "password is an invalid keyword argument for this function", and how can I fix it?

Thanks,
Harry
Reply all
Reply to author
Forward
0 new messages