ansible-collections / community.mysql

MySQL Ansible Collection
https://galaxy.ansible.com/ui/repo/published/community/mysql/
Other
99 stars 86 forks source link

Add support for auth_socket identification to the mysql_user module #82

Open Akasurde opened 3 years ago

Akasurde commented 3 years ago

From @Andersson007 on Jun 05, 2020 08:13

Copied from https://github.com/ansible/ansible/issues/40988 Initially reported by @organman91

SUMMARY

When using the mysql_user module, users must be identified by a password, a hash password, or not at all. Add support for creating a user identified by auth_socket.

ISSUE TYPE
COMPONENT NAME

mysql_user

ANSIBLE VERSION
ansible 2.4.3.0
  config file = /Users/zach/prometheus/props.platform/ansible.cfg
  configured module search path = ['/Users/zach/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.5 (default, Mar 30 2018, 06:41:53) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
CONFIGURATION
ANSIBLE_PIPELINING(/Users/zach/prometheus/props.platform/ansible.cfg) = True
ANSIBLE_SSH_ARGS(/Users/zach/prometheus/props.platform/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=5m
DEFAULT_FORKS(/Users/zach/prometheus/props.platform/ansible.cfg) = 8
DEFAULT_HOST_LIST(/Users/zach/prometheus/props.platform/ansible.cfg) = ['/Users/zach/prometheus/props.platform/inventory']
DEFAULT_REMOTE_USER(/Users/zach/prometheus/props.platform/ansible.cfg) = root
DEFAULT_STDOUT_CALLBACK(/Users/zach/prometheus/props.platform/ansible.cfg) = debug
DISPLAY_SKIPPED_HOSTS(/Users/zach/prometheus/props.platform/ansible.cfg) = False
RETRY_FILES_ENABLED(/Users/zach/prometheus/props.platform/ansible.cfg) = False
OS / ENVIRONMENT

N/A

STEPS TO REPRODUCE

When creating mysql users, rather than specifying a password (CREATE USER 'foo'@'localhost' IDENTIFIED BY 'supersecretpassword';), specify that auth_socket will be used for authentication instead: (CREATE USER 'foo'@'localhost' IDENTIFIED WITH auth_socket;).

- name: create mysql user with auth_socket authentication
  mysql_user:
    name: foo
    host: localhost
    auth_socket: true # this parameter (open to a better name) would be new
    state: present
    priv: 'bar.*:ALL'
EXPECTED RESULTS

MySQL user is created with auth_socket authentication

ACTUAL RESULTS

MySQL user is created with no authentication

Copied from original issue: ansible/ansible#465

Akasurde commented 3 years ago

From @ansibullbot on Jun 05, 2020 08:17

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

Akasurde commented 3 years ago

From @ansibullbot on Jun 05, 2020 08:17

cc @Alexander198961 @Jmainguy @Xyon @bmalynovytch @bmildren @kurtdavis @michaelcoburn @oneiroi @tolland click here for bot help