From 5606197c287f3fba18e0e6e12de7c8c8045ccdbe Mon Sep 17 00:00:00 2001 From: Lee H Date: Wed, 16 Dec 2015 02:03:30 -0500 Subject: [PATCH] - remove user_anonymous as the same thing can be accomplished by user='', but leave in the examples for removing anonymous users --- .../modules/database/mysql/mysql_user.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/lib/ansible/modules/database/mysql/mysql_user.py b/lib/ansible/modules/database/mysql/mysql_user.py index 9fb18caaf79..301e2dd0be6 100644 --- a/lib/ansible/modules/database/mysql/mysql_user.py +++ b/lib/ansible/modules/database/mysql/mysql_user.py @@ -30,14 +30,6 @@ options: description: - name of the user (role) to add or remove required: true - default: null - user_anonymous: - description: - - username is to be ignored and anonymous users with no username - handled - required: false - choices: [ "yes", "no" ] - default: no password: description: - set the user's password. (Required when adding a user) @@ -148,11 +140,11 @@ author: "Jonathan Mainguy (@Jmainguy)" ''' EXAMPLES = """ -# Removes anonymous user account for localhost (the name parameter is required, but ignored) -- mysql_user: name=anonymous user_anonymous=yes host=localhost state=absent +# Removes anonymous user account for localhost +- mysql_user: name='' host=localhost state=absent # Removes all anonymous user accounts -- mysql_user: name=anonymous user_anonymous=yes host_all=yes state=absent +- mysql_user: name='' host_all=yes state=absent # Create database user with name 'bob' and password '12345' with all database privileges - mysql_user: name=bob password=12345 priv=*.*:ALL state=present @@ -477,7 +469,6 @@ def main(): login_port=dict(default=3306, type='int'), login_unix_socket=dict(default=None), user=dict(required=True, aliases=['name']), - user_anonymous=dict(type="bool", default="no"), password=dict(default=None, no_log=True), encrypted=dict(default=False, type='bool'), host=dict(default="localhost"), @@ -493,7 +484,6 @@ def main(): login_user = module.params["login_user"] login_password = module.params["login_password"] user = module.params["user"] - user_anonymous = module.params["user_anonymous"] password = module.params["password"] encrypted = module.boolean(module.params["encrypted"]) host = module.params["host"].lower() @@ -505,9 +495,6 @@ def main(): append_privs = module.boolean(module.params["append_privs"]) update_password = module.params['update_password'] - if user_anonymous: - user = '' - config_file = os.path.expanduser(os.path.expandvars(config_file)) if not mysqldb_found: module.fail_json(msg="the python mysqldb module is required")