From 6a1f97ad4231a96238255cf904a1f68e2da2ace8 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 10 Mar 2016 13:09:44 -0800 Subject: [PATCH 1/2] Add docs for mysql* modules connect_timeout. --- lib/ansible/utils/module_docs_fragments/mysql.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/utils/module_docs_fragments/mysql.py b/lib/ansible/utils/module_docs_fragments/mysql.py index 5dd1e04f93..e57acab9b4 100644 --- a/lib/ansible/utils/module_docs_fragments/mysql.py +++ b/lib/ansible/utils/module_docs_fragments/mysql.py @@ -47,6 +47,12 @@ options: - The path to a Unix domain socket for local connections required: false default: null + connect_timeout: + description: + - The connection timeout when connecting to the MySQL server. + required: false + default: 30 + version_added: "2.1" config_file: description: - Specify a config file from which user and password are to be read From 9a922fcf0d371953314db5e0c7d170767c8a6043 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 10 Mar 2016 13:33:08 -0800 Subject: [PATCH 2/2] Update test to use mysql connect_timeout option. --- test/integration/roles/test_mysql_variables/tasks/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/integration/roles/test_mysql_variables/tasks/main.yml b/test/integration/roles/test_mysql_variables/tasks/main.yml index 192472bf46..26fc03c867 100644 --- a/test/integration/roles/test_mysql_variables/tasks/main.yml +++ b/test/integration/roles/test_mysql_variables/tasks/main.yml @@ -194,11 +194,8 @@ #============================================================ # Verify mysql_variable fails with an incorrect login_host parameter # -- name: lower mysql connect timeout - ini_file: dest="{{ansible_env.HOME}}/.my.cnf" section=client option=connect_timeout value=5 - - name: query mysql_variable using incorrect login_host - mysql_variables: variable=wait_timeout login_host=12.0.0.9 + mysql_variables: variable=wait_timeout login_host=12.0.0.9 connect_timeout=5 register: result ignore_errors: true