ansible-collections / community.mysql

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

mysql_user: Allow to check for implicit_admin w/o any action #15

Open Andersson007 opened 4 years ago

Andersson007 commented 4 years ago

Copied from https://github.com/ansible-collections/community.general/issues/755 Initially reported by @Akasurde

From @MarcinOrlowski on May 04, 2017 15:06

ISSUE TYPE
COMPONENT NAME

mysql_user

ANSIBLE VERSION
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/usr/share/ansible']
  python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
OS / ENVIRONMENT

N/A

SUMMARY

Would be useful to use mysql_user with just check_implicit_admin (no name given) which combined with register would just check for implicit admin access allowing further steps in role to rely on the result (i.e. skip certain actions).

STEPS TO REPRODUCE

- mysql_user:
      check_implicit_admin: yes
  register: check_result

- debug:
      var: check_result
EXPECTED RESULTS
ok: [pl_neo_sql] => {
    "changed": false,
    "implicit_admin": true
}
ACTUAL RESULTS

It actually fails as name is required.

Copied from original issue: ansible/ansible#24298

Andersson007 commented 4 years ago

From @Andersson007 on Jun 09, 2020 09:33

can't we do it as it is now using

ingore_errors: yes
check_implicit_admin: yes

? needs_info