Skip to content

mysql_query: To include the extra-vars #188

@tarunm97

Description

@tarunm97
SUMMARY

Hi Team, can we add the extra-vars field in the mysql_query ansible module, just like we have in the mysql_db module for dump state(dump_extra_args)

- name: Dump databases without including triggers
  community.mysql.mysql_db:
    state: dump
    name: foo
    target: /tmp/dump.sql
    dump_extra_args: --skip-triggers
ISSUE TYPE
  • Feature Idea
COMPONENT NAME

mysql_query

ADDITIONAL INFORMATION

will be good if we add this feature for example i got stucked while automating this mysql query

mysql  -uroot -p'' --skip-column-names -A -e"SELECT CONCAT('truncate table ',table_schema,'.',table_name,';') FROM information_schema.tables  WHERE table_schema='plparchivetest'"

I tried to automate the query, everything is fine apart from the "-skip-column-names -A", how to pass this.

- name: truncate the tables
  community.mysql.mysql_query:
       login_user: root
       login_password: "{{ mysql_password }}"
       login_unix_socket: /var/run/mysqld/mysqld.sock
       query: "SELECT CONCAT('truncate table ',table_schema,'.',table_name,';') FROM information_schema.tables  WHERE table_schema='plparchivetest'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions