James Cassell
bc4ef99533
standardize TLS connection properties ( #54315 )
...
* openstack: standardize tls params
* tower: tower_verify_ssl->validate_certs
* docker: use standard tls config params
- cacert_path -> ca_cert
- cert_path -> client_cert
- key_path -> client_key
- tls_verify -> validate_certs
* k8s: standardize tls connection params
- verify_ssl -> validate_certs
- ssl_ca_cert -> ca_cert
- cert_file -> client_cert
- key_file -> client_key
* ingate: verify_ssl -> validate_certs
* manageiq: standardize tls params
- verify_ssl -> validate_certs
- ca_bundle_path -> ca_cert
* mysql: standardize tls params
- ssl_ca -> ca_cert
- ssl_cert -> client_cert
- ssl_key -> client_key
* nios: ssl_verify -> validate_certs
* postgresql: ssl_rootcert -> ca_cert
* rabbitmq: standardize tls params
- cacert -> ca_cert
- cert -> client_cert
- key -> client_key
* rackspace: verify_ssl -> validate_certs
* vca: verify_certs -> validate_certs
* kubevirt_cdi_upload: upload_host_verify_ssl -> upload_host_validate_certs
* lxd: standardize tls params
- key_file -> client_key
- cert_file -> client_cert
* get_certificate: ca_certs -> ca_cert
* get_certificate.py: clarify one or more certs in a file
Co-Authored-By: jamescassell <code@james.cassell.me>
* zabbix: tls_issuer -> ca_cert
* bigip_device_auth_ldap: standardize tls params
- ssl_check_peer -> validate_certs
- ssl_client_cert -> client_cert
- ssl_client_key -> client_key
- ssl_ca_cert -> ca_cert
* vdirect: vdirect_validate_certs -> validate_certs
* mqtt: standardize tls params
- ca_certs -> ca_cert
- certfile -> client_cert
- keyfile -> client_key
* pulp_repo: standardize tls params
remove `importer_ssl` prefix
* rhn_register: sslcacert -> ca_cert
* yum_repository: standardize tls params
The fix for yum_repository is not straightforward since this module is
only a thin wrapper for the underlying commands and config. In this
case, we add the new values as aliases, keeping the old as primary,
only due to the internal structure of the module.
Aliases added:
- sslcacert -> ca_cert
- sslclientcert -> client_cert
- sslclientkey -> client_key
- sslverify -> validate_certs
* gitlab_hook: enable_ssl_verification -> hook_validate_certs
* Adjust arguments for docker_swarm inventory plugin.
* foreman callback: standardize tls params
- ssl_cert -> client_cert
- ssl_key -> client_key
* grafana_annotations: validate_grafana_certs -> validate_certs
* nrdp callback: validate_nrdp_certs -> validate_certs
* kubectl connection: standardize tls params
- kubectl_cert_file -> client_cert
- kubectl_key_file -> client_key
- kubectl_ssl_ca_cert -> ca_cert
- kubectl_verify_ssl -> validate_certs
* oc connection: standardize tls params
- oc_cert_file -> client_cert
- oc_key_file -> client_key
- oc_ssl_ca_cert -> ca_cert
- oc_verify_ssl -> validate_certs
* psrp connection: cert_trust_path -> ca_cert
TODO: cert_validation -> validate_certs (multi-valued vs bool)
* k8s inventory: standardize tls params
- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs
* openshift inventory: standardize tls params
- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs
* tower inventory: verify_ssl -> validate_certs
* hashi_vault lookup: cacert -> ca_cert
* k8s lookup: standardize tls params
- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs
* laps_passord lookup: cacert_file -> ca_cert
* changelog for TLS parameter standardization
2019-03-28 00:19:28 -05:00
plumbeo
e73e9ecbc3
mysql_user: fix malformed regex used to check current privileges ( #52278 )
...
* mysql_user: fix malformed regex used to check current privileges
* Add changelog fragment for PR #52278
2019-02-21 16:39:51 -08:00
UncertaintyP
916bf5acc7
Plugin mysql_user: add MySQL v8 privileges to valid privs ( #51478 )
...
* Plugin mysql_user: add MySQL v8 privileges to valid privs
* Unintentional underscores removed
2019-02-19 14:26:58 +00:00
Dag Wieers
677c04c01d
Sanity fixes to parameter types ( #52325 )
2019-02-15 16:58:58 +01:00
plumbeo
4d93c440b9
mysql_user: Match both single quotes and backticks when checking curr… ( #40092 )
...
* mysql_user: Match quotes, double quotes and backticks when checking current privileges
* Add changelog fragment for PR #40092
2019-02-06 14:20:43 +00:00
Toshio Kuratomi
3fba006207
Update bare exceptions to specify Exception.
...
This will keep us from accidentally catching program-exiting exceptions
like KeyboardInterupt and SystemExit.
2018-12-16 15:03:19 -08:00
mklassen
2fce8010b4
Added support for FUNCTION and PROCEDURE privileges to mysql_user ( #23223 )
2018-11-08 21:56:30 -08:00
Daniel Speichert
d34cf93f1a
Migrate from MySQLdb to PyMySQL ( #40123 )
...
* Migrate from MySQLdb to PyMySQL
* Deduplicate driver loading and failure message
* Explain requirements
* Apply requirements docs change to proxysql too
* Add changelog
2018-09-19 08:44:05 -07:00
Dag Wieers
cdd21e2170
Clean up module documentation ( #36909 )
...
* Clean up module documentation
This PR includes:
- Removal of `default: None` (and variations)
- Removal of `required: false`
- Fixing booleans and `type: bool` where required
* Fix remaining (new) validation issues
2018-03-15 22:15:24 +01:00
dramaley
1fe608afbf
Fix for database names that contain colons
...
Bug fix: Permissions were not parsed correctly if the database name contains a colon (:) character. For example, a privilege string of "*.*:USAGE/`lnx-www-prod:wordpress`.*:ALL" would fail with "invalid privileges string: Invalid privileges specified: frozenset(['WORDPRESS`.*'])". This 1-line fix works around the problem.
2017-11-13 20:23:57 -05:00
alex lustenberg
ff4fa6ac29
fix for empty hostnames in mysql users ( #20523 )
2017-08-17 12:00:26 -04:00
Toshio Kuratomi
f203ca7907
Update metadata to 1.1
2017-08-15 23:12:08 -07:00
Will Thames
dbf9a65c05
Improve error messages when MySQLdb is not installed ( #27871 )
...
The python package is called MySQL-python in pypi, and
reporting this rather than mysqldb makes resolving the
problem far easier.
2017-08-08 12:59:51 -04:00
Toshio Kuratomi
0b9a78f0b3
Remove wildcard, add boilerplate and get rid of get_exception
...
* smaller collections of database modules
* Some of the smaller collections of network modules
2017-07-31 13:51:38 -07:00
Abhijeet Kasurde
9fbbb5e10f
Pep8 fixes for mysql module ( #23923 )
...
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-04-26 12:56:35 +01:00
Matt Martz
3164e8b561
E501 fixes ( #22879 )
2017-03-22 20:50:28 -05:00
Toshio Kuratomi
eb1214baad
New metadata 1.0 ( #22587 )
...
Changes to the metadata format were approved here:
https://github.com/ansible/proposals/issues/54
* Update documentation to the new metadata format
* Changes to metadata-tool to account for new metadata
* Add GPL license header
* Add upgrade subcommand to upgrade metadata version
* Change default metadata to the new format
* Fix exclusion of non-modules from the metadata report
* Fix ansible-doc for new module metadata
* Exclude metadata version from ansible-doc output
* Fix website docs generation for the new metadata
* Update metadata schema in valiate-modules test
* Update the metadata in all modules to the new version
2017-03-14 09:07:22 -07:00
Pierrick Caillon
a1b3664ec4
Fix: mysql_user - permission string with column privileges
...
MySQL returns privileges on columns as "PRIVILEGES (column)".
For permissions to be correctly matched, it must be specified exactly the
same in the module argument. A resulting string is like
"dbname.dbtable:PRIVILEGES (column)". Thus, the space before the opening
parenthesis must also be removed when creating the set of privileges for
validation.
2017-02-21 10:51:03 -08:00
Matt Martz
7c00346714
Validate EXAMPLES as YAML
2017-02-15 13:01:43 -08:00
Matt Clay
d0d1158c5e
PEP 8 cleanup. ( #20789 )
...
* PEP 8 E703 cleanup.
* PEP 8 E701 cleanup.
* PEP 8 E711 cleanup.
* PEP 8 W191 and E101 cleanup.
2017-01-28 00:12:11 -08:00
James Cammarata
8afa090417
Resolving differences in core modules post-merge
2016-12-08 11:25:36 -05:00
Toshio Kuratomi
7319104552
Refreshed metadata for core modules
2016-12-08 11:25:35 -05:00
Wouter Oosterveld
61060f4b5f
mysql_user: fix user_mod on MySQL(-like) 5.7+ ( Fixes #3003 ) ( #5388 )
2016-12-08 11:25:33 -05:00
Sam Doran
db723af8aa
Change examples syntax on mysql_user module
2016-12-08 11:25:28 -05:00
John R Barker
25b6492d37
Bulk spelling improvement to modules-core ( #5225 )
...
* Correct spelling mistakes
* Correct more spelling issues
* merge conflict
* Revert typo in parms
2016-12-08 11:25:20 -05:00
Tobias Wolf
cda78382b6
Fix database table quoting in privileges_unpack() ( #3858 )
...
In Ansible 2.x this module gives `changed = True` for all privileges
that are specified including a table with
priv: "database.table:GRANT"
Mysql returns escaped names in the format
`database`.`tables`:GRANT
However in PR #1358 , which was intended to support dotted database names
(a crazy idea to begin with), the quotes for the table name were left
out, leading to `curr_priv != new_priv`.
This means that the idempotency comparison between new_priv and
curr_priv is always 'changed'.
This PR re-introduces quoting to the table part of the priv.
2016-12-08 11:24:57 -05:00
Jean Prat
ed246a328f
if user is empty, it is not converted to tuple when using host_all ( #3038 )
2016-12-08 11:24:57 -05:00
Michael Scherer
839d5b6de4
Fix mysql_user for python3 ( #4576 )
...
dict no longer have a iteritems method, it was replaced
by items. So we need to use six.
Traceback (most recent call last):
File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 587, in <module>
main()
File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 571, in main
changed = user_add(cursor, user, host, host_all, password, encrypted, priv, module.check_mode)
File \"/tmp/ansible_hjd7d65c/ansible_module_mysql_user.py\", line 239, in user_add
for db_table, priv in new_priv.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
2016-12-08 11:24:56 -05:00
Michael Scherer
09066f1518
Convert all databases modules to python3 and 2.4 syntax ( #3688 )
2016-12-08 11:24:29 -05:00
Rene Moser
9f1cfe07bb
mysql_user: fix unresolved reference
...
L282, module is used but not passed into function. Replaced check_mode reference and used module instead since check_mode is also in module.
2016-12-08 11:24:26 -05:00
Jeroen Geusebroek
54e62c2022
Allow an empty password when adding a new MySQL user. ( #3445 )
2016-12-08 11:24:19 -05:00
Michael Scherer
8b125f8c2c
Mark path as type='path', do not leak login_password by error ( #3396 )
2016-12-08 11:24:16 -05:00
Matt Clay
b7a5e1e0c8
Add optional connect timeout to mysql* modules.
2016-12-08 11:24:12 -05:00
Kenny Gryp
69b07aaf9d
added sql_log_bin setting to disable binary logging as option
2016-12-08 11:24:11 -05:00
Toshio Kuratomi
50eda6c62e
password needs to be type str.
...
In 1.9 this was the default. In 2.0.0 and 2.0.1 this doesn't get set.
2.1.0 will fix the default but we should fix this now.
2016-12-08 11:24:05 -05:00
Lee H
8e84ba71ae
- fix check_mode test to avoid errors
...
- correct test mode check to ensure it returns and doesnt apply changes
(via jmainguy)
2016-12-08 11:24:00 -05:00
Mark van Driel
a24cdbe15e
Fixed "invalid privileges string: set expected at most 1 arguments, got 2"
2016-12-08 11:23:58 -05:00
Jonathan Mainguy
e9a752f769
add ansi support
2016-12-08 11:23:58 -05:00
Mark van Driel
d67f2eb104
Fixes require ssl in combination with other privileges
...
Fixes require ssl in combination with grant option
Refactoring: code cleanup to make it easier to understand
Code rewritten inspired by @willthames
Added WITH GRANT OPTION as exception; when only REQUIRESSL and/or GRANT are specified we have to add USAGE
2016-12-08 11:23:57 -05:00
KIKUCHI Koichiro
2974358b2b
Add check_mode support to mysql_user.
2016-12-08 11:23:56 -05:00
Jonathan Mainguy
47d0719cfe
Fix bad merge
2016-12-08 11:23:56 -05:00
Josh Rendek
bddcf737c9
Fix quote on grants of more than one word
...
Fixed a quote location on the grants composed of more than one word. Current docs will raise an error with a invalid privilege command.
2016-12-08 11:23:55 -05:00
Toshio Kuratomi
65b9243056
mariadb isn't always the last elemen of the version string
2016-12-08 11:23:53 -05:00
Toshio Kuratomi
dafb39da2e
Account for mariadb versioning
2016-12-08 11:23:53 -05:00
Jonathan Mainguy
0cdb2719e5
Unify all 3 mysql modules.
...
Use same connection method, use config_file, and add ssl support
2016-12-08 11:23:53 -05:00
Lee H
7feb64d31c
- add version_added as requested to host_all
2016-12-08 11:23:53 -05:00
Lee H
5606197c28
- remove user_anonymous as the same thing can be accomplished by user='', but leave in the examples for removing anonymous users
2016-12-08 11:23:53 -05:00
Lee H
95895177d0
- add example showing removal of anonymous user accounts
2016-12-08 11:23:52 -05:00
Jonathan Mainguy
b86224a7ec
Add Jmainguy as author, fix hash check
2016-12-08 11:23:52 -05:00
Lee Hardy
f2f0f83ee6
- fix user_exists statement with host_all to use only username parameter
2016-12-08 11:23:52 -05:00