Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for FUNCTION and PROCEDURE privileges to mysql_user #23223

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

mklassen
Copy link
Contributor

@mklassen mklassen commented Apr 3, 2017

SUMMARY

Added support for FUNCTION and PROCEDURE in parsing the priv parameter of mysql_user

- mysql_user:
    user: db_user
    priv: FUNCTION dbname.function:EXECUTE/dbname.*:SELECT/PROCEDURE otherdb.procedure:EXECUTE

A privilege in priv can be prepended by FUNCTION or PROCEDURE. It should be separated from the db.table portion of the privilege by a space. This was chosen as it matches the format of the privilege as extracted in privileges_get function.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

mysql_user

ANSIBLE VERSION
ansible 2.2.2.0
ADDITIONAL INFORMATION

Currently only TABLE privileges can be manipulated with mysql_user

Granting execute privileges on a mysql FUNCTION requires an SQL statement of the form

GRANT EXECUTE ON FUNCTION dbname.function_name TO 'user';

Unfortunately if the FUNCTION keyword is included in mysql_user modules's priv parameter it is not recognized as a valid privilege level.

Object types of FUNCTION and PROCEDURE are supported by mysql (http://dev.mysql.com/doc/refman/5.7/en/grant.html) and it would be nice if the priv parameter supported specifying 'object_type', so that task like the following could be executed

- mysql_user:
    user: db_user
    priv: FUNCTION dbname.function_name:EXECUTE
    state: present

@ansibot
Copy link
Contributor

ansibot commented Apr 3, 2017

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 community_review In order to be merged, this PR must follow the community review workflow. feature_pull_request module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Apr 3, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 3, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 11, 2017
@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@Jmainguy
Copy link
Contributor

Jmainguy commented Aug 3, 2017

@mklassen code looks good, seems like a good feature to add.

Can you or anyone else reading this test this against default mysql (or mariadb) installs on centos6, centos7, and w/e latest LTS ubuntu is and ensure it works / doesnt break anything existing? And then post results of test here. (Sorry for being a terrible maintainer and not reviewing this 5 months ago, or running these tests myself, honestly if anybody is itching to be the Mysql maintainer for Ansible just let me know.)

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 3, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Aug 16, 2017
@ansibot ansibot added the new_contributor This PR is the first contribution by a new community member. label Oct 18, 2017
@ansibot ansibot removed the new_contributor This PR is the first contribution by a new community member. label Nov 3, 2017
@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2017

@mklassen This PR contains @ mentions in at least one commit message. Those mentions can cause cascading notifications through GitHub and need to be removed. Please squash or amend your commits to remove the mentions.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2017

cc @Constantin007 @Constantin07 @DJMuggs @GGabriele @MarkusTeufelberger @NickatEpic @Qalthos @Spredzy @ThePixelDeveloper @ThomasSteinbach @abirami-n @adq @aimonb @Akasurde @alikins @amuraleedhar @bennojoy @berenddeschouwer @brandond @brian-brazil @broncofan @caphrim007 @chouseknecht @clc-runner @cloudnull @cove @dagnello @dagwieers @dav1x @defionscode @devigned @dgarros @Dhivyap @dkasberg @dkhenry @dstoflet @dusdanig @emonty @erydo @ganeshrn @garethr @goozbach @gouthampacha @groks @gundalow @gunzy83 @hacosta @haroldwongms @helldorado @hulquest @ignatenkobrain @ivanbojer @j2sol @jarv @jcpowermac @jctanner @jedelman8 @jeremyschulman @jmcgill298 @joelthompson @joshuaconner @jsdalton @jsmartin @jtschichold @juliakreger @julienstroheker @jwhitbeck @kedarX @kevensen @lmazuel @lmprice @loia @lujeni @lwade @machacekondra @matburt @mattupstate @maxamillion @mcltn @mcv21 @mgruener @mgwilliams @mikewiebe @mjschultz @mkrizek @mwperina @nand0p @nerzhul @nitzmahone @obsoleted @ogenstad @ozboms @pdellaert @privateip @Qalthos @rahushen @rcarrillocruz @rickmendes @rnh556 @robinro @ryansb @s-hertel @saito-hideki @samdoran @schunduri @scicoin-project @seiffert @sgargan @shepdelacreme @shrews @skg-net @smbambling @softzilla @tedder @tgerla @thingee @tintoy @trishnaguha @tstringer @verm666 @willthames @wilvk @wimnat @xscript @yaegashi @yuwzho @zfil @zikalino
click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2017

@mklassen this PR contains more than one new module.

Please submit only one new module per pullrequest. For further explanation, please read grouped module documentation

click here for bot help

@ansibot ansibot added aci Cisco ACI community aws azure c:inventory/contrib_script cloud deprecated This issue/PR relates to a deprecated module. docker docs_pull_request f5 inventory Inventory category and removed community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Nov 30, 2017
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 21, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 15, 2018
@mklassen
Copy link
Contributor Author

Addresses issue #29511

@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Sep 28, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. and removed core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 6, 2018
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. community_review In order to be merged, this PR must follow the community review workflow. labels Oct 29, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 6, 2018
@caphrim007
Copy link
Contributor

lgtm. tested on mariadb 10.3

@caphrim007 caphrim007 merged commit 2fce801 into ansible:devel Nov 9, 2018
@mklassen mklassen deleted the mysql branch November 9, 2018 13:40
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. mysql needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) new_contributor This PR is the first contribution by a new community member. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants