vagrant and chef install everything
This commit is contained in:
1
ops/cookbooks/vendor/mysql/.foodcritic
vendored
Normal file
1
ops/cookbooks/vendor/mysql/.foodcritic
vendored
Normal file
@ -0,0 +1 @@
|
||||
~FC005
|
692
ops/cookbooks/vendor/mysql/CHANGELOG.md
vendored
Normal file
692
ops/cookbooks/vendor/mysql/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,692 @@
|
||||
# mysql Cookbook CHANGELOG
|
||||
|
||||
This file is used to list changes made in each version of the mysql cookbook.
|
||||
|
||||
## 8.5.1 (2017-08-23)
|
||||
|
||||
- Fix the remainder of the namespace collision deprecation warnings
|
||||
- Remove the class_eval in the action class as this causes issues with some releases of Chef 12
|
||||
|
||||
## 8.5.0 (2017-08-23)
|
||||
|
||||
- Require Chef 12.7+ since 12.5/12.6 has custom resource action_class issues
|
||||
- Resolve several Chef 14 deprecation warnings
|
||||
|
||||
## 8.4.0 (2017-05-30)
|
||||
|
||||
- Fix client/server install on Amazon Linux and add testing
|
||||
- Remove support for Ubuntu Precise since it's EOL
|
||||
- Add Amazon Linux testing
|
||||
|
||||
## 8.3.1 (2017-04-04)
|
||||
|
||||
- Fix an ignoring of 'cookbook' attribute by 'mysql_config' resource
|
||||
- Remove unused helper method
|
||||
- Call out the supported platform versions in the metadata
|
||||
- Switch to Delivery Local and rename the docked config
|
||||
- Remove mention of the EOL opensuse 13.x in the readme
|
||||
|
||||
## 8.3.0 (2017-03-20)
|
||||
- Refactor mysql_service_manager_upstart.rb to eliminate use of cloned resource
|
||||
|
||||
## 8.2.0 (2016-12-03)
|
||||
|
||||
- Include client development packages on RHEL/SUSE platforms
|
||||
|
||||
## 8.1.1 (2016-10-31)
|
||||
- Fixing CVE-2016-6662 - Reverting execure bit on mysql config
|
||||
|
||||
## 8.1.0 (2016-10-29)
|
||||
|
||||
- Drop hardcoded, specific package version logic that broke many users
|
||||
|
||||
## 8.0.4 (2016-09-26)
|
||||
- Bump debian version
|
||||
- Updated packages for 12.04 and 14.04 too
|
||||
- Add chef_version metadata
|
||||
- Update platforms in the kitchen file
|
||||
- Add selinux to the Berksfile for testing
|
||||
- Make sure yum repos are setup in local Test Kitchen
|
||||
|
||||
## 8.0.3 (2016-09-14)
|
||||
- [GH-390] Fix #390 incorrect escaping of initial_root_password
|
||||
- Updated package versions for Ubuntu 16.04
|
||||
- Testing updates
|
||||
|
||||
# v8.0.2 (2016-08-25)
|
||||
- Various bug fixed and updates to package version strings
|
||||
|
||||
# v8.0.1 (2016-07-20)
|
||||
- Fixed a regression in the mysql_client resource where the action was changed from create to install in the 8.0 release
|
||||
- Added oracle, opensuse, and opensuseleap as supported platforms in the metadata
|
||||
|
||||
# v8.0.0 (2016-07-11)
|
||||
|
||||
- Converting from LWRP to custom resources
|
||||
- Removing yum-mysql and other dependencies.
|
||||
- ^ BREAKING CHANGE: RHELish users are now responsible
|
||||
for including a recipe from the "yum-mysql" or equivalent
|
||||
cookbook before utilizing the mysql_* resources.
|
||||
- More thoughtful ChefSpec
|
||||
- Renaming "replication" test suite to "smoke"
|
||||
- Moving to Inspec
|
||||
|
||||
## v7.2.0 (2016-06-30)
|
||||
|
||||
- Support openeSUSE leap
|
||||
- Support Fedora 24
|
||||
|
||||
## v7.1.2 (2016-06-30)
|
||||
|
||||
- Avoid deprecation warnings on the upcoming Chef 12.12 release
|
||||
|
||||
## v7.1.1 (2016-06-03)
|
||||
|
||||
- Fix apparmor blocking writes to non-default tmp_dirs
|
||||
- Updated apparmor config to allow read & write to sock.lock file
|
||||
- Use cookstyle instead of Rubocop directly
|
||||
|
||||
## v7.1.0 (2016-05-11)
|
||||
|
||||
- Added support for Ubuntu 16.04
|
||||
|
||||
## v7.0.0 (2016-04-19)
|
||||
|
||||
- Removed support for legacy distros: Ubuntu 10.04/13.04/14.10/15.04, Fedora 20/21, OmniOS r151006, opensuse 11.3/12.0
|
||||
- Added support for Fedora 23, suse 13.X, and Ubuntu 16.04
|
||||
- Updated the systemd support to create unit files in /etc/systemd and not /usr/lib/systemd
|
||||
- Adding umask to bash resource that sets root password PR #386 @gziskind
|
||||
- Cleaned up the Test Kitchen config to test the right platform version + mysql pairings
|
||||
- Added Travis CI Test Kitchen testing on Fedora 22/23 and removed Fedora 21
|
||||
- Updated the platforms used in the specs
|
||||
|
||||
## v6.1.3 (2016-03-14)
|
||||
|
||||
- Added support for Ubuntu 15.10
|
||||
- Added support for Amazon Linux 2016-03
|
||||
- Updated Kitchen testing configs
|
||||
|
||||
## v6.1.2 (2015-10-05)
|
||||
|
||||
- Added support for Amazon Linux 2015.09
|
||||
|
||||
## v6.1.1 (2015-09-24)
|
||||
|
||||
- Completing ChefSpec matchers
|
||||
|
||||
## v6.1.0 (2015-07-17)
|
||||
|
||||
- Adding tunables for tmp_dir, error_log, and pid_file
|
||||
- Adding mysqld_options hash interface for main my.cnf template
|
||||
|
||||
## v6.0.31 (2015-07-13)
|
||||
|
||||
- Reverting create_stop_system_service checks
|
||||
|
||||
## v6.0.30 (2015-07-13)
|
||||
|
||||
- Ubuntu 15.04 support
|
||||
- Check for scripts and unit files during create_stop_system_service
|
||||
|
||||
## v6.0.29 (2015-07-12)
|
||||
|
||||
- Patch to allow blank root password
|
||||
- Adding package information for Suse 12.0
|
||||
|
||||
## v6.0.28 (2015-07-10)
|
||||
|
||||
- Fixes for 12.4.x
|
||||
|
||||
## v6.0.27 (2015-07-09)
|
||||
|
||||
- Allowing integer value for port number
|
||||
|
||||
## v6.0.26 (2015-07-07)
|
||||
|
||||
- Reverting breaking changes introduced in 6.0.25
|
||||
|
||||
## v6.0.25 (2015-07-06)
|
||||
|
||||
- Fixes for 12.4.1
|
||||
|
||||
## v6.0.24 (2015-06-27)
|
||||
|
||||
- 341 - Changing default GRANT for root from '%' to 'localhost' and '127.0.0.1'
|
||||
|
||||
## v6.0.23 (2015-06-21)
|
||||
|
||||
- 354 Better handling of long MySQL startup times
|
||||
|
||||
## v6.0.22 (2015-05-07)
|
||||
|
||||
- Debian 8 (Jessie) support
|
||||
|
||||
## v6.0.21 (2015-04-08)
|
||||
|
||||
- Fix to Upstart prestart script when using custom socket
|
||||
- Adding --explicit_defaults_for_timestamp mysql_install_db_cmd for
|
||||
- 5.6 and above
|
||||
|
||||
## v6.0.20 (2015-03-27)
|
||||
|
||||
- 318 - Fixing Upstart pre-start script to handle custom socket paths
|
||||
|
||||
## v6.0.19 (2015-03-25)
|
||||
|
||||
- Adding support for Amazon Linux 2015.03
|
||||
|
||||
## v6.0.18 (2015-03-24)
|
||||
|
||||
- Adding support for 5.6 and 5.7 packages from dotdeb repos on Debian 7
|
||||
|
||||
## v6.0.17 (2015-03-13)
|
||||
|
||||
- Updated for MySQL 5.7.6.
|
||||
- Handing removal of mysql_install_db and mysqld_safe
|
||||
|
||||
## v6.0.16 (2015-03-10)
|
||||
|
||||
- Moved --defaults-file as first option to mysql_install_db_script
|
||||
|
||||
## v6.0.15 (2015-02-26)
|
||||
|
||||
- Updating docker detection fix to pass specs
|
||||
|
||||
## v6.0.14 (2015-02-26)
|
||||
|
||||
- Fixed debian system service :disable action. Now survives reboot
|
||||
- Fixing centos-7 instance :enable action. Now survives
|
||||
- Not applying Apparmor policy if running in a Docker container
|
||||
|
||||
## v6.0.13 (2015-02-15)
|
||||
|
||||
- Adding support for special characters in initial_root_password
|
||||
- Fixing failure status bug in sysvinit script
|
||||
|
||||
## v6.0.12 (2015-02-30)
|
||||
|
||||
- No changes. Released a 6.0.11 that was identical to 6.0.10.
|
||||
- Git before coffee.
|
||||
|
||||
## v6.0.11 (2015-02-30)
|
||||
|
||||
- Adding support for configurable socket files
|
||||
|
||||
## v6.0.10 (2015-01-19)
|
||||
|
||||
- Fix #282 - Fixing up data_dir template variable
|
||||
|
||||
## v6.0.9 (2015-01-19)
|
||||
|
||||
- Fix #282 - undefined method `parsed_data_dir' bug
|
||||
|
||||
## v6.0.8 (2015-01-19)
|
||||
|
||||
- Refactoring helper methods out of resource classes
|
||||
|
||||
## v6.0.7 (2015-01-14)
|
||||
|
||||
- Fixing timing issue with Upstart provider :restart and :reload
|
||||
- actions where service returns before being available
|
||||
|
||||
## v6.0.6 (2014-12-26)
|
||||
|
||||
- Fixing subtle bug where MysqlCookbook::Helper methods were polluting Chef::Resource
|
||||
|
||||
## v6.0.5 (2014-12-25)
|
||||
|
||||
- Using 'include_recipe' instead of 'recipe_eval' in LWRP
|
||||
- Fixing type checking on package_name attribute in mysql_client resource.
|
||||
|
||||
## v6.0.4 (2014-12-21)
|
||||
|
||||
- Suggest available versions if current is not available for current platform.
|
||||
|
||||
## v6.0.3 (2014-12-17)
|
||||
|
||||
- Adding bind_address parameter to mysql_service resource
|
||||
|
||||
## v6.0.2 (2014-12-17)
|
||||
|
||||
- Fixing sysvinit provider to survive reboots
|
||||
|
||||
## v6.0.1 (2014-12-16)
|
||||
|
||||
- Fixing Upstart template to survive reboots
|
||||
|
||||
## v6.0.0 (2014-12-15)
|
||||
|
||||
- Major version update
|
||||
- Cookbook now provides LWRPs instead of recipes
|
||||
- Platform providers re-factored into init system providers
|
||||
- Separated :create and :start actions for use in recipes that build containers
|
||||
- mysql_service now supports multiple instances on the same machine
|
||||
- mysql_service no longer attempts to manage user records
|
||||
- Removal of debian-sys-maint
|
||||
- Unified Sysvinit script that works on all platforms
|
||||
- mysql_config resource introduced
|
||||
- mysql_client fixed up
|
||||
- Refactored acceptance tests
|
||||
- Temporarily dropped FreeBSD support
|
||||
|
||||
## v5.6.1 (2014-10-29)
|
||||
|
||||
- Use Gem::Version instead of Chef::Version
|
||||
|
||||
## v5.6.0 (2014-10-29)
|
||||
|
||||
- Changing default charset to utf8
|
||||
- Quoting passwords in debian.cnf.erb
|
||||
- Amazon 2014.09 support
|
||||
- Ubuntu 14.10 support
|
||||
- Only hide passwords from STDOUT via "sensitive true" in chef-client higher than 11.14
|
||||
- Updating test harness
|
||||
|
||||
## v5.5.4 (2014-10-07)
|
||||
|
||||
- Adding sensitive flag to execute resources to protect passwords from logs
|
||||
|
||||
## v5.5.3 (2014-09-24)
|
||||
|
||||
- Reverting back to Upstart on Ubuntu 14.04
|
||||
|
||||
## v5.5.2 (2014-09-8)
|
||||
|
||||
- Reverting commit that broke Debian pass_string
|
||||
|
||||
## v5.5.1 (2014-09-2)
|
||||
|
||||
- Switching Ubuntu service provider to use SysVinit instead of Upstart
|
||||
|
||||
## v5.5.0 (2014-08-27)
|
||||
|
||||
- Adding package version and action parameters to mysql_service resource
|
||||
- Fixing Debian pass_string
|
||||
|
||||
## v5.4.4 (2014-08-27)
|
||||
|
||||
- Changing module namespace to MysqlCookbook
|
||||
|
||||
## v5.4.3 (2014-08-25)
|
||||
|
||||
- More refactoring. Moving helper function bits into resource parsed_parameters
|
||||
|
||||
## v5.4.2 (2014-08-25)
|
||||
|
||||
- Moving provider local variables into definitions for RHEL provider
|
||||
|
||||
## v5.4.1 (2014-08-25)
|
||||
|
||||
- Refactoring resources into the LWRP style with parsed parameters
|
||||
- Moving provider local variables into definitions
|
||||
|
||||
## v5.4.0 (2014-08-25)
|
||||
|
||||
- 212 - support for centos-7 (mysql55 and mysql56)
|
||||
- Adding (untested) Debian-6 support
|
||||
- Adding Suse support to metadata.rb
|
||||
- Adding ability to change MySQL root password
|
||||
- Added libmysqlclient-devel package to SuSE client provider
|
||||
- Appeasing AppArmor
|
||||
- Reducing duplication in client provider
|
||||
|
||||
## v5.3.6 (2014-06-18)
|
||||
|
||||
- Fixing pid path location. Updating tests to include real RHEL
|
||||
|
||||
## v5.3.4 (2014-06-16)
|
||||
|
||||
- Fixing specs for Amazon Linux server package names
|
||||
|
||||
## v5.3.2 (2014-06-16)
|
||||
|
||||
- Fixing Amazon Linux support
|
||||
|
||||
## v5.3.0 (2014-06-11)
|
||||
|
||||
- 189 - Fix server_repl_password description
|
||||
- 191 - Adding support for server55 and server56 on el-6
|
||||
- 193 - Fix syntax in mysql_service example
|
||||
- 199 - Adding Suse support
|
||||
|
||||
## v5.2.12 (2014-05-19)
|
||||
|
||||
PR #192 - recipes/server.rb should honor parameter node['mysql']['version']
|
||||
|
||||
## v5.2.10 (2014-05-15)
|
||||
|
||||
- COOK-4394 - restore freebsd support
|
||||
|
||||
## v5.2.8 (2014-05-15)
|
||||
|
||||
- [COOK-4653] - Missing mySQL 5.6 support for Ubuntu 14.04
|
||||
|
||||
## v5.2.6 (2014-05-07)
|
||||
|
||||
- [COOK-4625] - Fix password resource parameter consumption on Debian and Ubuntu
|
||||
- Fix up typos and version numbers in PLATFORMS.md
|
||||
- Fix up specs from COOK-4613 changes
|
||||
|
||||
## v5.2.4 (2014-05-02)
|
||||
|
||||
- [COOK-4613] - Fix permissions on mysql data_dir to allow global access to mysql.sock
|
||||
|
||||
## v5.2.2 (2014-04-24)
|
||||
|
||||
- [COOK-4564] - Using positive tests for datadir move
|
||||
|
||||
## v5.2.0 (2014-04-22)
|
||||
|
||||
- [COOK-4551] - power grants.sql from resource parameters
|
||||
|
||||
## v5.1.12 (2014-04-21)
|
||||
|
||||
- [COOK-4554] - Support for Debian Sid
|
||||
|
||||
## v5.1.10 (2014-04-21)
|
||||
|
||||
- [COOK-4565] Support for Ubuntu 14.04
|
||||
- [COOK-4565] Adding Specs and TK platform
|
||||
- Removing non-LTS 13.10 specs and TK platform
|
||||
|
||||
## v5.1.8 (2014-04-12)
|
||||
|
||||
Adding Ubuntu 13.04 to Platforminfo
|
||||
|
||||
## v5.1.6 (2014-04-11)
|
||||
|
||||
- [COOK-4548] - Add template[/etc/mysql/debian.cnf] to Ubuntu provider
|
||||
|
||||
## v5.1.4 (2014-04-11)
|
||||
|
||||
- [COOK-4547] - Shellescape server_root_password
|
||||
|
||||
## v5.1.2 (2014-04-09)
|
||||
|
||||
- [COOK-4519] - Fix error in run_dir for Ubuntu
|
||||
- [COOK-4531] - Fix pid and run_dir for Debian
|
||||
|
||||
## v5.1.0 (2014-04-08)
|
||||
|
||||
[COOK-4523] - Allow for both :restart and :reload
|
||||
|
||||
## v5.0.6 (2014-04-07)
|
||||
|
||||
- [COOK-4519] - Updating specs to reflect pid file change on Ubuntu
|
||||
|
||||
## v5.0.4 (2014-04-07)
|
||||
|
||||
- [COOK-4519] - Fix path to pid file on Ubuntu
|
||||
|
||||
## v5.0.2 (2014-04-01)
|
||||
|
||||
- Moving server_deprecated into recipes directory
|
||||
|
||||
## v5.0.0 (2014-03-31)
|
||||
|
||||
- Rewriting as a library cookbook
|
||||
- Exposing mysql_service and mysql_client resources
|
||||
- User now needs to supply configuration
|
||||
- Moving attribute driven recipe to server-deprecated
|
||||
|
||||
## v4.1.2 (2014-02-28)
|
||||
|
||||
- [COOK-4349] - Fix invalid platform check
|
||||
- [COOK-4184] - Better handling of Ubuntu upstart service
|
||||
- [COOK-2100] - Changing innodb_log_file_size tunable results in inability to start MySQL
|
||||
|
||||
## v4.1.1 (2014-02-25)
|
||||
|
||||
- **[COOK-2966] - Address foodcritic failures'
|
||||
- **[COOK-4182] - Template parse failure in /etc/init/mysql.conf (data_dir)'
|
||||
- **[COOK-4198] - Added missing tunable'
|
||||
- **[COOK-4206] - create root@127.0.0.1, as well as root@localhost'
|
||||
|
||||
## v4.0.20 (2014-01-18)
|
||||
|
||||
- [COOK-3931] - MySQL Server Recipe Regression for Non-LTS Ubuntu Versions
|
||||
- [COOK-3945] - MySQL cookbook fails on Ubuntu 13.04/13.10
|
||||
- [COOK-3966] - mysql::server recipe can't find a template with debian 7.x
|
||||
- [COOK-3985] - Missing /etc/mysql/debian.cnf template on mysql::_server_debian.rb recipe (mysql 4.0.4)
|
||||
- [COOK-3974] - debian.cnf not updated
|
||||
- [COOK-4001] - Pull request: Fixes for broken mysql::server on Debian
|
||||
- [COOK-4071] - Mysql cookbook doesn't work on debian 7.2
|
||||
|
||||
## v4.0.14
|
||||
|
||||
Fixing style cops
|
||||
|
||||
## v4.0.12
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-4068](https://tickets.chef.io/browse/COOK-4068)** - rework MySQL Windows recipe
|
||||
|
||||
### Improvement
|
||||
|
||||
- **[COOK-3801](https://tickets.chef.io/browse/COOK-3801)** - Add innodb_adaptive_flushing_method and innodb_adaptive_checkpoint
|
||||
|
||||
## v4.0.10
|
||||
|
||||
fixing metadata version error. locking to 3.0
|
||||
|
||||
## v4.0.8
|
||||
|
||||
Locking yum dependency to '< 3'
|
||||
|
||||
## v4.0.6
|
||||
|
||||
# Bug
|
||||
|
||||
- [COOK-3943] Notifying service restart on grants update
|
||||
|
||||
## v4.0.4
|
||||
|
||||
[COOK-3952] - Adding 'recursive true' to directory resources
|
||||
|
||||
## v4.0.2
|
||||
|
||||
### BUGS
|
||||
|
||||
- Adding support for Amazon Linux in attributes/server_rhel.rb
|
||||
- Fixing bug where unprivileged users cannot connect over a local socket. Adding integration test.
|
||||
- Fixing bug in mysql_grants_cmd generation
|
||||
|
||||
## v4.0.0
|
||||
|
||||
- [COOK-3928] Heavily refactoring for readability. Moving platform implementation into separate recipes
|
||||
- Moving integration tests from minitest to serverspec, removing "improper" tests
|
||||
- Moving many attributes into the ['mysql']['server']['whatever'] namespace
|
||||
- [COOK-3481] - Merged Lucas Welsh's Windows bits and moved into own recipe
|
||||
- [COOK-3697] - Adding security hardening attributes
|
||||
- [COOK-3780] - Fixing data_dir on Debian and Ubuntu
|
||||
- [COOK-3807] - Don't use execute[assign-root-password] on Debian and Ubuntu
|
||||
- [COOK-3881] - Fixing /etc being owned by mysql user
|
||||
|
||||
## v3.0.12
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-3752](https://tickets.chef.io/browse/COOK-3752)** - mysql service fails to start in mysql::server recipe
|
||||
|
||||
## v3.0.10
|
||||
|
||||
- Fix a failed release attempt for v3.0.8
|
||||
|
||||
## v3.0.8
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-3749](https://tickets.chef.io/browse/COOK-3749)** - Fix a regression with Chef 11-specific features
|
||||
|
||||
## v3.0.6
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-3674](https://tickets.chef.io/browse/COOK-3674)** - Fix an issue where the MySQL server fails to set the root password correctly when `data_dir` is a non-default value
|
||||
- **[COOK-3647](https://tickets.chef.io/browse/COOK-3647)** - Fix README typo (databas => database)
|
||||
- **[COOK-3477](https://tickets.chef.io/browse/COOK-3477)** - Fix log-queries-not-using-indexes not working
|
||||
- **[COOK-3436](https://tickets.chef.io/browse/COOK-3436)** - Pull percona repo in compilation phase
|
||||
- **[COOK-3208](https://tickets.chef.io/browse/COOK-3208)** - Fix README typo (LitenPort => ListenPort)
|
||||
- **[COOK-3149](https://tickets.chef.io/browse/COOK-3149)** - Create my.cnf before installing
|
||||
- **[COOK-2681](https://tickets.chef.io/browse/COOK-2681)** - Fix log_slow_queries for 5.5+
|
||||
- **[COOK-2606](https://tickets.chef.io/browse/COOK-2606)** - Use proper bind address on cloud providers
|
||||
|
||||
### Improvement
|
||||
|
||||
- **[COOK-3498](https://tickets.chef.io/browse/COOK-3498)** - Add support for replicate_* variables in my.cnf
|
||||
|
||||
## v3.0.4
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-3310](https://tickets.chef.io/browse/COOK-3310)** - Fix missing `GRANT` option
|
||||
- **[COOK-3233](https://tickets.chef.io/browse/COOK-3233)** - Fix escaping special characters
|
||||
- **[COOK-3156](https://tickets.chef.io/browse/COOK-3156)** - Fix GRANTS file when `remote_root_acl` is specified
|
||||
- **[COOK-3134](https://tickets.chef.io/browse/COOK-3134)** - Fix Chef 11 support
|
||||
- **[COOK-2318](https://tickets.chef.io/browse/COOK-2318)** - Remove redundant `if` block around `node.mysql.tunable.log_bin`
|
||||
|
||||
## v3.0.2
|
||||
|
||||
### Bug
|
||||
|
||||
- [COOK-2158]: apt-get update is run twice at compile time
|
||||
- [COOK-2832]: mysql grants.sql file has errors depending on attrs
|
||||
- [COOK-2995]: server.rb is missing a platform_family comparison value
|
||||
|
||||
### Sub-task
|
||||
|
||||
- [COOK-2102]: `innodb_flush_log_at_trx_commit` value is incorrectly set based on CPU count
|
||||
|
||||
## v3.0.0
|
||||
|
||||
**Note** This is a backwards incompatible version with previous versions of the cookbook. Tickets that introduce incompatibility are COOK-2615 and COOK-2617.
|
||||
|
||||
- [COOK-2478] - Duplicate 'read_only' server attribute in base and tunable
|
||||
- [COOK-2471] - Add tunable to set slave_compressed_protocol for reduced network traffic
|
||||
- [COOK-1059] - Update attributes in mysql cookbook to support missing options for my.cnf usable by Percona
|
||||
- [COOK-2590] - Typo in server recipe to do with conf_dir and confd_dir
|
||||
- [COOK-2602] - Add `lower_case_table_names` tunable
|
||||
- [COOK-2430] - Add a tunable to create a network ACL when allowing `remote_root_access`
|
||||
- [COOK-2619] - mysql: isamchk deprecated
|
||||
- [COOK-2515] - Better support for SUSE distribution for mysql cookbook
|
||||
- [COOK-2557] - mysql::percona_repo attributes missing and key server typo
|
||||
- [COOK-2614] - Duplicate `innodb_file_per_table`
|
||||
- [COOK-2145] - MySQL cookbook should remove anonymous and password less accounts
|
||||
- [COOK-2553] - Enable include directory in my.cnf template for any platform
|
||||
- [COOK-2615] - Rename `key_buffer` to `key_buffer_size`
|
||||
- [COOK-2626] - Percona repo URL is being constructed incorrectly
|
||||
- [COOK-2616] - Unneeded attribute thread_cache
|
||||
- [COOK-2618] - myisam-recover not using attribute value
|
||||
- [COOK-2617] - open-files is a duplicate of open-files-limit
|
||||
|
||||
## v2.1.2
|
||||
|
||||
- [COOK-2172] - Mysql cookbook duplicates `binlog_format` configuration
|
||||
|
||||
## v2.1.0
|
||||
|
||||
- [COOK-1669] - Using platform("ubuntu") in default attributes always returns true
|
||||
- [COOK-1694] - Added additional my.cnf fields and reorganized cookbook to avoid race conditions with mysql startup and sql script execution
|
||||
- [COOK-1851] - Support server-id and binlog_format settings
|
||||
- [COOK-1929] - Update msyql server attributes file because setting attributes without specifying a precedence is deprecated
|
||||
- [COOK-1999] - Add read_only tunable useful for replication slave servers
|
||||
|
||||
## v2.0.2
|
||||
|
||||
- [COOK-1967] - mysql: trailing comma in server.rb platform family
|
||||
|
||||
## v2.0.0
|
||||
|
||||
**Important note for this release**
|
||||
|
||||
Under Chef Solo, you must set the node attributes for the root, debian and repl passwords or the run will completely fail. See COOK-1737 for background on this.
|
||||
|
||||
- [COOK-1390] - MySQL service cannot start after reboot
|
||||
- [COOK-1610] - Set root password outside preseed (blocker for drop-in mysql replacements)
|
||||
- [COOK-1624] - Mysql cookbook fails to even compile on windows
|
||||
- [COOK-1669] - Using platform("ubuntu") in default attributes always returns true
|
||||
- [COOK-1686] - Add mysql service start
|
||||
- [COOK-1687] - duplicate `innodb_buffer_pool_size` attribute
|
||||
- [COOK-1704] - mysql cookbook fails spec tests when minitest-handler cookbook enabled
|
||||
- [COOK-1737] - Fail a chef-solo run when `server_root_password`, `server_debian_password`, and/or `server_repl_password` is not set
|
||||
- [COOK-1769] - link to database recipe in mysql README goes to old chef/cookbooks repo instead of chef-cookbook organization
|
||||
- [COOK-1963] - use `platform_family`
|
||||
|
||||
## v1.3.0
|
||||
|
||||
**Important note for this release**
|
||||
|
||||
This version no longer installs Ruby bindings in the client recipe by default. Use the ruby recipe if you'd like the RubyGem. If you'd like packages from your distribution, use them in your application's specific cookbook/recipe, or modify the client packages attribute. This resolves the following tickets:
|
||||
|
||||
- COOK-932
|
||||
- COOK-1009
|
||||
- COOK-1384
|
||||
|
||||
Additionally, this cookbook now has tests (COOK-1439) for use under test-kitchen.
|
||||
|
||||
The following issues are also addressed in this release.
|
||||
|
||||
- [COOK-1443] - MySQL (>= 5.1.24) does not support `innodb_flush_method` = fdatasync
|
||||
- [COOK-1175] - Add Mac OS X support
|
||||
- [COOK-1289] - handle additional tunable attributes
|
||||
- [COOK-1305] - add auto-increment-increment and auto-increment-offset attributes
|
||||
- [COOK-1397] - make the port an attribute
|
||||
- [COOK-1439] - Add MySQL cookbook tests for test-kitchen support
|
||||
- [COOK-1236] - Move package names into attributes to allow percona to free-ride
|
||||
- [COOK-934] - remove deprecated mysql/libraries/database.rb, use the database cookbook instead.
|
||||
- [COOK-1475] - fix restart on config change
|
||||
|
||||
## v1.2.6
|
||||
|
||||
- [COOK-1113] - Use an attribute to determine if upstart is used
|
||||
- [COOK-1121] - Add support for Windows
|
||||
- [COOK-1140] - Fix conf.d on Debian
|
||||
- [COOK-1151] - Fix server_ec2 handling /var/lib/mysql bind mount
|
||||
- [COOK-1321] - Document setting password attributes for solo
|
||||
|
||||
## v1.2.4
|
||||
|
||||
- [COOK-992] - fix FATAL nameerror
|
||||
- [COOK-827] - `mysql:server_ec2` recipe can't mount `data_dir`
|
||||
- [COOK-945] - FreeBSD support
|
||||
|
||||
## v1.2.2
|
||||
|
||||
- [COOK-826] mysql::server recipe doesn't quote password string
|
||||
- [COOK-834] Add 'scientific' and 'amazon' platforms to mysql cookbook
|
||||
|
||||
## v1.2.1
|
||||
|
||||
- [COOK-644] Mysql client cookbook 'package missing' error message is confusing
|
||||
- [COOK-645] RHEL6/CentOS6 - mysql cookbook contains 'skip-federated' directive which is unsupported on MySQL 5.1
|
||||
|
||||
## v1.2.0
|
||||
|
||||
- [COOK-684] remove mysql_database LWRP
|
||||
|
||||
## v1.0.8
|
||||
|
||||
- [COOK-633] ensure "cloud" attribute is available
|
||||
|
||||
## v1.0.7
|
||||
|
||||
- [COOK-614] expose all mysql tunable settings in config
|
||||
- [COOK-617] bind to private IP if available
|
||||
|
||||
## v1.0.6
|
||||
|
||||
- [COOK-605] install mysql-client package on ubuntu/debian
|
||||
|
||||
## v1.0.5
|
||||
|
||||
- [COOK-465] allow optional remote root connections to mysql
|
||||
- [COOK-455] improve platform version handling
|
||||
- externalize conf_dir attribute for easier cross platform support
|
||||
- change datadir attribute to data_dir for consistency
|
||||
|
||||
## v1.0.4
|
||||
|
||||
- fix regressions on debian platform
|
||||
- [COOK-578] wrap root password in quotes
|
||||
- [COOK-562] expose all tunables in my.cnf
|
2
ops/cookbooks/vendor/mysql/CONTRIBUTING.md
vendored
Normal file
2
ops/cookbooks/vendor/mysql/CONTRIBUTING.md
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
Please refer to
|
||||
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD
|
424
ops/cookbooks/vendor/mysql/README.md
vendored
Normal file
424
ops/cookbooks/vendor/mysql/README.md
vendored
Normal file
@ -0,0 +1,424 @@
|
||||
# MySQL Cookbook
|
||||
|
||||
[](https://travis-ci.org/chef-cookbooks/mysql) [](https://supermarket.chef.io/cookbooks/mysql)
|
||||
|
||||
The MySQL Cookbook is a library cookbook that provides resource primitives (LWRPs) for use in recipes. It is designed to be a reference example for creating highly reusable cross-platform cookbooks.
|
||||
|
||||
## Scope
|
||||
|
||||
This cookbook is concerned with the "MySQL Community Server", particularly those shipped with F/OSS Unix and Linux distributions. It does not address forks or value-added repackaged MySQL distributions like MariaDB or Percona.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Chef 12.7 or higher
|
||||
- Network accessible package repositories
|
||||
- 'recipe[selinux::disabled]' on RHEL platforms
|
||||
|
||||
## Platform Support
|
||||
|
||||
The following platforms have been tested with Test Kitchen:
|
||||
|
||||
```
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| | 5.1 | 5.5 | 5.6 | 5.7 |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| debian-7 | | X | | |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| debian-8 | | X | | |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| ubuntu-14.04 | | X | X | |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| ubuntu-16.04 | | | | X |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| centos-6 | X | X | X | X |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| centos-7 | | X | X | X |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| fedora | | | X | X |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
| openSUSE Leap | | | X | |
|
||||
|----------------+-----+-----+-----+-----|
|
||||
```
|
||||
|
||||
## Cookbook Dependencies
|
||||
|
||||
There are no hard coupled dependencies. However, there is a loose dependency on `yum-mysql-community` for RHEL/CentOS platforms. As of the 8.0 version of this cookbook, configuration of the package repos is now the responsibility of the user.
|
||||
|
||||
## Usage
|
||||
|
||||
Place a dependency on the mysql cookbook in your cookbook's metadata.rb
|
||||
|
||||
```ruby
|
||||
depends 'mysql', '~> 8.0'
|
||||
```
|
||||
|
||||
Then, in a recipe:
|
||||
|
||||
```ruby
|
||||
mysql_service 'foo' do
|
||||
port '3306'
|
||||
version '5.5'
|
||||
initial_root_password 'change me'
|
||||
action [:create, :start]
|
||||
end
|
||||
```
|
||||
|
||||
The service name on the OS is `mysql-foo`. You can manually start and stop it with `service mysql-foo start` and `service mysql-foo stop`.
|
||||
|
||||
The configuration file is at `/etc/mysql-foo/my.cnf`. It contains the minimum options to get the service running. It looks like this.
|
||||
|
||||
```
|
||||
# Chef generated my.cnf for instance mysql-foo
|
||||
|
||||
[client]
|
||||
default-character-set = utf8
|
||||
port = 3306
|
||||
socket = /var/run/mysql-foo/mysqld.sock
|
||||
|
||||
[mysql]
|
||||
default-character-set = utf8
|
||||
|
||||
[mysqld]
|
||||
user = mysql
|
||||
pid-file = /var/run/mysql-foo/mysqld.pid
|
||||
socket = /var/run/mysql-foo/mysqld.sock
|
||||
port = 3306
|
||||
datadir = /var/lib/mysql-foo
|
||||
tmpdir = /tmp
|
||||
log-error = /var/log/mysql-foo/error.log
|
||||
!includedir /etc/mysql-foo/conf.d
|
||||
|
||||
[mysqld_safe]
|
||||
socket = /var/run/mysql-foo/mysqld.sock
|
||||
```
|
||||
|
||||
You can put extra configuration into the conf.d directory by using the `mysql_config` resource, like this:
|
||||
|
||||
```ruby
|
||||
mysql_service 'foo' do
|
||||
port '3306'
|
||||
version '5.5'
|
||||
initial_root_password 'change me'
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
mysql_config 'foo' do
|
||||
source 'my_extra_settings.erb'
|
||||
notifies :restart, 'mysql_service[foo]'
|
||||
action :create
|
||||
end
|
||||
```
|
||||
|
||||
You are responsible for providing `my_extra_settings.erb` in your own cookbook's templates folder.
|
||||
|
||||
## Connecting with the mysql CLI command
|
||||
|
||||
Logging into the machine and typing `mysql` with no extra arguments will fail. You need to explicitly connect over the socket with `mysql -S /var/run/mysql-foo/mysqld.sock`, or over the network with `mysql -h 127.0.0.1`
|
||||
|
||||
## Upgrading from older version of the mysql cookbook
|
||||
|
||||
- It is strongly recommended that you rebuild the machine from scratch. This is easy if you have your `data_dir` on a dedicated mount point. If you _must_ upgrade in-place, follow the instructions below.
|
||||
- The 6.x series supports multiple service instances on a single machine. It dynamically names the support directories and service names. `/etc/mysql becomes /etc/mysql-instance_name`. Other support directories in `/var` `/run` etc work the same way. Make sure to specify the `data_dir` property on the `mysql_service` resource to point to the old `/var/lib/mysql` directory.
|
||||
|
||||
## Resources Overview
|
||||
|
||||
### mysql_service
|
||||
|
||||
The `mysql_service` resource manages the basic plumbing needed to get a MySQL server instance running with minimal configuration.
|
||||
|
||||
The `:create` action handles package installation, support directories, socket files, and other operating system level concerns. The internal configuration file contains just enough to get the service up and running, then loads extra configuration from a conf.d directory. Further configurations are managed with the `mysql_config` resource.
|
||||
|
||||
- If the `data_dir` is empty, a database will be initialized, and a
|
||||
- root user will be set up with `initial_root_password`. If this
|
||||
- directory already contains database files, no action will be taken.
|
||||
|
||||
The `:start` action starts the service on the machine using the appropriate provider for the platform. The `:start` action should be omitted when used in recipes designed to build containers.
|
||||
|
||||
#### Example
|
||||
|
||||
```ruby
|
||||
mysql_service 'default' do
|
||||
version '5.7'
|
||||
bind_address '0.0.0.0'
|
||||
port '3306'
|
||||
data_dir '/data'
|
||||
initial_root_password 'Ch4ng3me'
|
||||
action [:create, :start]
|
||||
end
|
||||
```
|
||||
|
||||
Please note that when using `notifies` or `subscribes`, the resource to reference is `mysql_service[name]`, not `service[mysql]`.
|
||||
|
||||
#### Parameters
|
||||
|
||||
- `charset` - specifies the default character set. Defaults to `utf8`.
|
||||
- `data_dir` - determines where the actual data files are kept on the machine. This is useful when mounting external storage. When omitted, it will default to the platform's native location.
|
||||
- `error_log` - Tunable location of the error_log
|
||||
- `initial_root_password` - allows the user to specify the initial root password for mysql when initializing new databases. This can be set explicitly in a recipe, driven from a node attribute, or from data_bags. When omitted, it defaults to `ilikerandompasswords`. Please be sure to change it.
|
||||
- `instance` - A string to identify the MySQL service. By convention, to allow for multiple instances of the `mysql_service`, directories and files on disk are named `mysql-<instance_name>`. Defaults to the resource name.
|
||||
- `package_action` - Defaults to `:install`.
|
||||
- `package_name` - Defaults to a value looked up in an internal map.
|
||||
- `package_version` - Specific version of the package to install,passed onto the underlying package manager. Defaults to `nil`.
|
||||
- `bind_address` - determines the listen IP address for the mysqld service. When omitted, it will be determined by MySQL. If the address is "regular" IPv4/IPv6address (e.g 127.0.0.1 or ::1), the server accepts TCP/IP connections only for that particular address. If the address is "0.0.0.0" (IPv4) or "::" (IPv6), the server accepts TCP/IP connections on all IPv4 or IPv6 interfaces.
|
||||
- `mysqld_options` - A key value hash of options to be rendered into the main my.cnf. WARNING - It is highly recommended that you use the `mysql_config` resource instead of sending extra config into a `mysql_service` resource. This will allow you to set up notifications and subscriptions between the service and its configuration. That being said, this can be useful for adding extra options needed for database initialization at first run.
|
||||
- `port` - determines the listen port for the mysqld service. When omitted, it will default to '3306'.
|
||||
- `run_group` - The name of the system group the `mysql_service` should run as. Defaults to 'mysql'.
|
||||
- `run_user` - The name of the system user the `mysql_service` should run as. Defaults to 'mysql'.
|
||||
- `pid_file` - Tunable location of the pid file.
|
||||
- `socket` - determines where to write the socket file for the `mysql_service` instance. Useful when configuring clients on the same machine to talk over socket and skip the networking stack. Defaults to a calculated value based on platform and instance name.
|
||||
- `tmp_dir` - Tunable location of the tmp_dir
|
||||
- `version` - allows the user to select from the versions available for the platform, where applicable. When omitted, it will install the default MySQL version for the target platform. Available version numbers are `5.0`, `5.1`, `5.5`, `5.6`, and `5.7`, depending on platform.
|
||||
|
||||
#### Actions
|
||||
|
||||
- `:create` - Configures everything but the underlying operating system service.
|
||||
- `:delete` - Removes everything but the package and data_dir.
|
||||
- `:start` - Starts the underlying operating system service
|
||||
- `:stop`- Stops the underlying operating system service
|
||||
- `:restart` - Restarts the underlying operating system service
|
||||
- `:reload` - Reloads the underlying operating system service
|
||||
|
||||
#### Providers
|
||||
|
||||
Chef selects the appropriate provider based on platform and version, but you can specify one if your platform support it.
|
||||
|
||||
```ruby
|
||||
mysql_service[instance-1] do
|
||||
port '1234'
|
||||
data_dir '/mnt/lottadisk'
|
||||
provider Chef::Provider::MysqlServiceSysvinit
|
||||
action [:create, :start]
|
||||
end
|
||||
```
|
||||
|
||||
- `Chef::Provider::MysqlServiceBase` - Configures everything needed to run a MySQL service except the platform service facility. This provider should never be used directly. The `:start`, `:stop`, `:restart`, and `:reload` actions are stubs meant to be overridden by the providers below.
|
||||
- `Chef::Provider::MysqlServiceSmf` - Starts a `mysql_service` using the Service Management Facility, used by Solaris and Illumos. Manages the FMRI and method script.
|
||||
- `Chef::Provider::MysqlServiceSystemd` - Starts a `mysql_service` using SystemD. Manages the unit file and activation state
|
||||
- `Chef::Provider::MysqlServiceSysvinit` - Starts a `mysql_service` using SysVinit. Manages the init script and status.
|
||||
- `Chef::Provider::MysqlServiceUpstart` - Starts a `mysql_service` using Upstart. Manages job definitions and status.
|
||||
|
||||
### mysql_config
|
||||
|
||||
The `mysql_config` resource is a wrapper around the core Chef `template` resource. Instead of a `path` parameter, it uses the `instance` parameter to calculate the path on the filesystem where file is rendered.
|
||||
|
||||
#### Example
|
||||
|
||||
```ruby
|
||||
mysql_config[default] do
|
||||
source 'site.cnf.erb'
|
||||
action :create
|
||||
end
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- `config_name` - The base name of the configuration file to be rendered into the conf.d directory on disk. Defaults to the resource name.
|
||||
- `cookbook` - The name of the cookbook to look for the template source. Defaults to nil
|
||||
- `group` - System group for file ownership. Defaults to 'mysql'.
|
||||
- `instance` - Name of the `mysql_service` instance the config is meant for. Defaults to 'default'.
|
||||
- `owner` - System user for file ownership. Defaults to 'mysql'.
|
||||
- `source` - Template in cookbook to be rendered.
|
||||
- `variables` - Variables to be passed to the underlying `template` resource.
|
||||
- `version` - Version of the `mysql_service` instance the config is meant for. Used to calculate path. Only necessary when using packages with unique configuration paths, such as RHEL Software Collections or OmniOS. Defaults to 'nil'
|
||||
|
||||
#### Actions
|
||||
|
||||
- `:create` - Renders the template to disk at a path calculated using the instance parameter.
|
||||
- `:delete` - Deletes the file from the conf.d directory calculated using the instance parameter.
|
||||
|
||||
#### More Examples
|
||||
|
||||
```ruby
|
||||
mysql_service 'instance-1' do
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
mysql_service 'instance-2' do
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
mysql_config 'logging' do
|
||||
instance 'instance-1'
|
||||
source 'logging.cnf.erb'
|
||||
action :create
|
||||
notifies :restart, 'mysql_service[instance-1]'
|
||||
end
|
||||
|
||||
mysql_config 'security settings for instance-2' do
|
||||
config_name 'security'
|
||||
instance 'instance-2'
|
||||
source 'security_stuff.cnf.erb'
|
||||
variables(:foo => 'bar')
|
||||
action :create
|
||||
notifies :restart, 'mysql_service[instance-2]'
|
||||
end
|
||||
```
|
||||
|
||||
### mysql_client
|
||||
|
||||
The `mysql_client` resource manages the MySQL client binaries and development libraries.
|
||||
|
||||
It is an example of a "singleton" resource. Declaring two `mysql_client` resources on a machine usually won't yield two separate copies of the client binaries, except for platforms that support multiple versions (RHEL SCL, OmniOS).
|
||||
|
||||
#### Example
|
||||
|
||||
```ruby
|
||||
mysql_client 'default' do
|
||||
action :create
|
||||
end
|
||||
```
|
||||
|
||||
#### Properties
|
||||
|
||||
- `package_name` - An array of packages to be installed. Defaults to a value looked up in an internal map.
|
||||
- `package_version` - Specific versions of the package to install, passed onto the underlying package manager. Defaults to `nil`.
|
||||
- `version` - Major MySQL version number of client packages. Only valid on for platforms that support multiple versions, such as RHEL via Software Collections and OmniOS.
|
||||
|
||||
#### Actions
|
||||
|
||||
- `:create` - Installs the client software
|
||||
- `:delete` - Removes the client software
|
||||
|
||||
## Advanced Usage Examples
|
||||
|
||||
There are a number of configuration scenarios supported by the use of resource primitives in recipes. For example, you might want to run multiple MySQL services, as different users, and mount block devices that contain pre-existing databases.
|
||||
|
||||
### Multiple Instances as Different Users
|
||||
|
||||
```ruby
|
||||
# instance-1
|
||||
user 'alice' do
|
||||
action :create
|
||||
end
|
||||
|
||||
directory '/mnt/data/mysql/instance-1' do
|
||||
owner 'alice'
|
||||
action :create
|
||||
end
|
||||
|
||||
mount '/mnt/data/mysql/instance-1' do
|
||||
device '/dev/sdb1'
|
||||
fstype 'ext4'
|
||||
action [:mount, :enable]
|
||||
end
|
||||
|
||||
mysql_service 'instance-1' do
|
||||
port '3307'
|
||||
run_user 'alice'
|
||||
data_dir '/mnt/data/mysql/instance-1'
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
mysql_config 'site config for instance-1' do
|
||||
instance 'instance-1'
|
||||
source 'instance-1.cnf.erb'
|
||||
notifies :restart, 'mysql_service[instance-1]'
|
||||
end
|
||||
|
||||
# instance-2
|
||||
user 'bob' do
|
||||
action :create
|
||||
end
|
||||
|
||||
directory '/mnt/data/mysql/instance-2' do
|
||||
owner 'bob'
|
||||
action :create
|
||||
end
|
||||
|
||||
mount '/mnt/data/mysql/instance-2' do
|
||||
device '/dev/sdc1'
|
||||
fstype 'ext3'
|
||||
action [:mount, :enable]
|
||||
end
|
||||
|
||||
mysql_service 'instance-2' do
|
||||
port '3308'
|
||||
run_user 'bob'
|
||||
data_dir '/mnt/data/mysql/instance-2'
|
||||
action [:create, :start]
|
||||
end
|
||||
|
||||
mysql_config 'site config for instance-2' do
|
||||
instance 'instance-2'
|
||||
source 'instance-2.cnf.erb'
|
||||
notifies :restart, 'mysql_service[instance-2]'
|
||||
end
|
||||
```
|
||||
|
||||
### Replication Testing
|
||||
|
||||
Use multiple `mysql_service` instances to test a replication setup. This particular example serves as a smoke test in Test Kitchen because it exercises different resources and requires service restarts.
|
||||
|
||||
<https://github.com/chef-cookbooks/mysql/blob/master/test/fixtures/cookbooks/mysql_replication_test/recipes/default.rb>
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### How do I run this behind my firewall?
|
||||
|
||||
On Linux, the `mysql_service` resource uses the platform's underlying package manager to install software. For this to work behind firewalls, you'll need to either:
|
||||
|
||||
- Configure the system yum/apt utilities to use a proxy server that
|
||||
- can reach the Internet
|
||||
- Host a package repository on a network that the machine can talk to
|
||||
|
||||
On the RHEL platform_family, applying the `yum::default` recipe will allow you to drive the `yum_globalconfig` resource with attributes to change the global yum proxy settings.
|
||||
|
||||
If hosting repository mirrors, applying one of the following recipes and adjust the settings with node attributes.
|
||||
|
||||
- `recipe[yum-centos::default]` from the Supermarket
|
||||
|
||||
<https://supermarket.chef.io/cookbooks/yum-centos>
|
||||
|
||||
<https://github.com/chef-cookbooks/yum-centos>
|
||||
|
||||
- `recipe[yum-mysql-community::default]` from the Supermarket
|
||||
|
||||
<https://supermarket.chef.io/cookbooks/yum-mysql-community>
|
||||
|
||||
<https://github.com/chef-cookbooks/yum-mysql-community>
|
||||
|
||||
### The mysql command line doesn't work
|
||||
|
||||
If you log into the machine and type `mysql`, you may see an error like this one:
|
||||
|
||||
`Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'`
|
||||
|
||||
This is because MySQL is hardcoded to read the defined default my.cnf file, typically at /etc/my.cnf, and this LWRP deletes it to prevent overlap among multiple MySQL configurations.
|
||||
|
||||
To connect to the socket from the command line, check the socket in the relevant my.cnf file and use something like this:
|
||||
|
||||
`mysql -S /var/run/mysql-foo/mysqld.sock -Pwhatever`
|
||||
|
||||
Or to connect over the network, use something like this: connect over the network..
|
||||
|
||||
`mysql -h 127.0.0.1 -Pwhatever`
|
||||
|
||||
These network or socket ssettings can also be put in you $HOME/.my.cnf, if preferred.
|
||||
|
||||
### What about MariaDB, Percona, etc.
|
||||
|
||||
MySQL forks are purposefully out of scope for this cookbook. This is mostly to reduce the testing matrix to a manageable size. Cookbooks for these technologies can easily be created by copying and adapting this cookbook. However, there will be differences.
|
||||
|
||||
Package repository locations, package version names, software major version numbers, supported platform matrices, and the availability of software such as XtraDB and Galera are the main reasons that creating multiple cookbooks to make sense.
|
||||
|
||||
## Maintainers
|
||||
|
||||
This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our [team documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/COOKBOOK_TEAM.MD). To learn more about contributing to cookbooks like this see our [contributing documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD), or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the [Chef Community Slack](http://community-slack.chef.io/)
|
||||
|
||||
## License
|
||||
|
||||
```text
|
||||
Copyright:: 2009-2017 Chef Software, Inc
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
291
ops/cookbooks/vendor/mysql/libraries/helpers.rb
vendored
Normal file
291
ops/cookbooks/vendor/mysql/libraries/helpers.rb
vendored
Normal file
@ -0,0 +1,291 @@
|
||||
module MysqlCookbook
|
||||
module HelpersBase
|
||||
require 'shellwords'
|
||||
|
||||
def el6?
|
||||
return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 6
|
||||
false
|
||||
end
|
||||
|
||||
def el7?
|
||||
return true if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 7
|
||||
false
|
||||
end
|
||||
|
||||
def wheezy?
|
||||
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 7
|
||||
false
|
||||
end
|
||||
|
||||
def jessie?
|
||||
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 8
|
||||
false
|
||||
end
|
||||
|
||||
def stretch?
|
||||
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 9
|
||||
false
|
||||
end
|
||||
|
||||
def trusty?
|
||||
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
|
||||
return true if node['platform'] == 'linuxmint' && node['platform_version'] =~ /^17\.[0-9]$/
|
||||
false
|
||||
end
|
||||
|
||||
def xenial?
|
||||
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '16.04'
|
||||
false
|
||||
end
|
||||
|
||||
def defaults_file
|
||||
"#{etc_dir}/my.cnf"
|
||||
end
|
||||
|
||||
def default_data_dir
|
||||
return "/var/lib/#{mysql_name}" if node['os'] == 'linux'
|
||||
return "/opt/local/lib/#{mysql_name}" if node['os'] == 'solaris2'
|
||||
return "/var/db/#{mysql_name}" if node['os'] == 'freebsd'
|
||||
end
|
||||
|
||||
def default_error_log
|
||||
"#{log_dir}/error.log"
|
||||
end
|
||||
|
||||
def default_pid_file
|
||||
"#{run_dir}/mysqld.pid"
|
||||
end
|
||||
|
||||
def default_major_version
|
||||
# rhelish
|
||||
return '5.1' if el6?
|
||||
return '5.6' if el7?
|
||||
return '5.6' if node['platform'] == 'amazon'
|
||||
|
||||
# debian
|
||||
return '5.5' if wheezy?
|
||||
return '5.5' if jessie?
|
||||
|
||||
# ubuntu
|
||||
return '5.5' if trusty?
|
||||
return '5.7' if xenial?
|
||||
|
||||
# misc
|
||||
return '5.6' if node['platform'] == 'freebsd'
|
||||
return '5.6' if node['platform'] == 'fedora'
|
||||
return '5.6' if node['platform_family'] == 'suse'
|
||||
end
|
||||
|
||||
def major_from_full(v)
|
||||
v.split('.').shift(2).join('.')
|
||||
end
|
||||
|
||||
def mysql_name
|
||||
"mysql-#{instance}"
|
||||
end
|
||||
|
||||
def default_socket_file
|
||||
"#{run_dir}/mysqld.sock"
|
||||
end
|
||||
|
||||
def default_client_package_name
|
||||
return ['mysql', 'mysql-devel'] if major_version == '5.1' && el6?
|
||||
return ['mysql55', 'mysql55-devel.x86_64'] if major_version == '5.5' && node['platform'] == 'amazon'
|
||||
return ['mysql56', 'mysql56-devel.x86_64'] if major_version == '5.6' && node['platform'] == 'amazon'
|
||||
return ['mysql-client-5.5', 'libmysqlclient-dev'] if major_version == '5.5' && node['platform_family'] == 'debian'
|
||||
return ['mysql-client-5.6', 'libmysqlclient-dev'] if major_version == '5.6' && node['platform_family'] == 'debian'
|
||||
return ['mysql-client-5.7', 'libmysqlclient-dev'] if major_version == '5.7' && node['platform_family'] == 'debian'
|
||||
return 'mysql-community-server-client' if major_version == '5.6' && node['platform_family'] == 'suse'
|
||||
['mysql-community-client', 'mysql-community-devel']
|
||||
end
|
||||
|
||||
def default_server_package_name
|
||||
return 'mysql-server' if major_version == '5.1' && el6?
|
||||
return 'mysql55-server' if major_version == '5.5' && node['platform'] == 'amazon'
|
||||
return 'mysql56-server' if major_version == '5.6' && node['platform'] == 'amazon'
|
||||
return 'mysql-server-5.5' if major_version == '5.5' && node['platform_family'] == 'debian'
|
||||
return 'mysql-server-5.6' if major_version == '5.6' && node['platform_family'] == 'debian'
|
||||
return 'mysql-server-5.7' if major_version == '5.7' && node['platform_family'] == 'debian'
|
||||
return 'mysql-community-server' if major_version == '5.6' && node['platform_family'] == 'suse'
|
||||
'mysql-community-server'
|
||||
end
|
||||
|
||||
def socket_dir
|
||||
File.dirname(socket)
|
||||
end
|
||||
|
||||
def run_dir
|
||||
return "#{prefix_dir}/var/run/#{mysql_name}" if node['platform_family'] == 'rhel'
|
||||
return "/run/#{mysql_name}" if node['platform_family'] == 'debian'
|
||||
"/var/run/#{mysql_name}"
|
||||
end
|
||||
|
||||
def prefix_dir
|
||||
return "/opt/mysql#{pkg_ver_string}" if node['platform_family'] == 'omnios'
|
||||
return '/opt/local' if node['platform_family'] == 'smartos'
|
||||
return "/opt/rh/#{scl_name}/root" if scl_package?
|
||||
end
|
||||
|
||||
def scl_name
|
||||
return unless node['platform_family'] == 'rhel'
|
||||
return 'mysql51' if version == '5.1' && node['platform_version'].to_i == 5
|
||||
return 'mysql55' if version == '5.5' && node['platform_version'].to_i == 5
|
||||
end
|
||||
|
||||
def scl_package?
|
||||
return unless node['platform_family'] == 'rhel'
|
||||
return true if version == '5.1' && node['platform_version'].to_i == 5
|
||||
return true if version == '5.5' && node['platform_version'].to_i == 5
|
||||
false
|
||||
end
|
||||
|
||||
def etc_dir
|
||||
return "/opt/mysql#{pkg_ver_string}/etc/#{mysql_name}" if node['platform_family'] == 'omnios'
|
||||
return "#{prefix_dir}/etc/#{mysql_name}" if node['platform_family'] == 'smartos'
|
||||
"#{prefix_dir}/etc/#{mysql_name}"
|
||||
end
|
||||
|
||||
def base_dir
|
||||
prefix_dir || '/usr'
|
||||
end
|
||||
|
||||
def system_service_name
|
||||
return 'mysql51-mysqld' if node['platform_family'] == 'rhel' && scl_name == 'mysql51'
|
||||
return 'mysql55-mysqld' if node['platform_family'] == 'rhel' && scl_name == 'mysql55'
|
||||
return 'mysqld' if node['platform_family'] == 'rhel'
|
||||
return 'mysqld' if node['platform_family'] == 'fedora'
|
||||
'mysql' # not one of the above
|
||||
end
|
||||
|
||||
def v56plus
|
||||
return false if version.split('.')[0].to_i < 5
|
||||
return false if version.split('.')[1].to_i < 6
|
||||
true
|
||||
end
|
||||
|
||||
def v57plus
|
||||
return false if version.split('.')[0].to_i < 5
|
||||
return false if version.split('.')[1].to_i < 7
|
||||
true
|
||||
end
|
||||
|
||||
def default_include_dir
|
||||
"#{etc_dir}/conf.d"
|
||||
end
|
||||
|
||||
def log_dir
|
||||
return "/var/adm/log/#{mysql_name}" if node['platform_family'] == 'omnios'
|
||||
"#{prefix_dir}/var/log/#{mysql_name}"
|
||||
end
|
||||
|
||||
def lc_messages_dir; end
|
||||
|
||||
def init_records_script
|
||||
# Note: shell-escaping passwords in a SQL file may cause corruption - eg
|
||||
# mysql will read \& as &, but \% as \%. Just escape bare-minimum \ and '
|
||||
sql_escaped_password = root_password.gsub('\\') { '\\\\' }.gsub("'") { '\\\'' }
|
||||
|
||||
<<-EOS
|
||||
set -e
|
||||
rm -rf /tmp/#{mysql_name}
|
||||
mkdir /tmp/#{mysql_name}
|
||||
|
||||
cat > /tmp/#{mysql_name}/my.sql <<-'EOSQL'
|
||||
UPDATE mysql.user SET #{password_column_name}=PASSWORD('#{sql_escaped_password}')#{password_expired} WHERE user = 'root';
|
||||
DELETE FROM mysql.user WHERE USER LIKE '';
|
||||
DELETE FROM mysql.user WHERE user = 'root' and host NOT IN ('127.0.0.1', 'localhost');
|
||||
FLUSH PRIVILEGES;
|
||||
DELETE FROM mysql.db WHERE db LIKE 'test%';
|
||||
DROP DATABASE IF EXISTS test ;
|
||||
EOSQL
|
||||
|
||||
#{db_init}
|
||||
#{record_init}
|
||||
|
||||
while [ ! -f #{pid_file} ] ; do sleep 1 ; done
|
||||
kill `cat #{pid_file}`
|
||||
while [ -f #{pid_file} ] ; do sleep 1 ; done
|
||||
rm -rf /tmp/#{mysql_name}
|
||||
EOS
|
||||
end
|
||||
|
||||
def password_column_name
|
||||
return 'authentication_string' if v57plus
|
||||
'password'
|
||||
end
|
||||
|
||||
def root_password
|
||||
if initial_root_password == ''
|
||||
Chef::Log.info('Root password is empty')
|
||||
return ''
|
||||
end
|
||||
initial_root_password
|
||||
end
|
||||
|
||||
def password_expired
|
||||
return ", password_expired='N'" if v57plus
|
||||
''
|
||||
end
|
||||
|
||||
def db_init
|
||||
return mysqld_initialize_cmd if v57plus
|
||||
mysql_install_db_cmd
|
||||
end
|
||||
|
||||
def mysql_install_db_bin
|
||||
return "#{base_dir}/scripts/mysql_install_db" if node['platform_family'] == 'omnios'
|
||||
return "#{prefix_dir}/bin/mysql_install_db" if node['platform_family'] == 'smartos'
|
||||
'mysql_install_db'
|
||||
end
|
||||
|
||||
def mysql_install_db_cmd
|
||||
cmd = mysql_install_db_bin
|
||||
cmd << " --defaults-file=#{etc_dir}/my.cnf"
|
||||
cmd << " --datadir=#{data_dir}"
|
||||
cmd << ' --explicit_defaults_for_timestamp' if v56plus && !v57plus
|
||||
return "scl enable #{scl_name} \"#{cmd}\"" if scl_package?
|
||||
cmd
|
||||
end
|
||||
|
||||
def mysqladmin_bin
|
||||
return "#{prefix_dir}/bin/mysqladmin" if node['platform_family'] == 'smartos'
|
||||
return 'mysqladmin' if scl_package?
|
||||
"#{prefix_dir}/usr/bin/mysqladmin"
|
||||
end
|
||||
|
||||
def mysqld_bin
|
||||
return "#{prefix_dir}/libexec/mysqld" if node['platform_family'] == 'smartos'
|
||||
return "#{base_dir}/bin/mysqld" if node['platform_family'] == 'omnios'
|
||||
return '/usr/sbin/mysqld' if node['platform_family'] == 'fedora' && v56plus
|
||||
return '/usr/libexec/mysqld' if node['platform_family'] == 'fedora'
|
||||
return 'mysqld' if scl_package?
|
||||
"#{prefix_dir}/usr/sbin/mysqld"
|
||||
end
|
||||
|
||||
def mysqld_initialize_cmd
|
||||
cmd = mysqld_bin
|
||||
cmd << " --defaults-file=#{etc_dir}/my.cnf"
|
||||
cmd << ' --initialize'
|
||||
cmd << ' --explicit_defaults_for_timestamp' if v56plus
|
||||
return "scl enable #{scl_name} \"#{cmd}\"" if scl_package?
|
||||
cmd
|
||||
end
|
||||
|
||||
def mysqld_safe_bin
|
||||
return "#{prefix_dir}/bin/mysqld_safe" if node['platform_family'] == 'smartos'
|
||||
return "#{base_dir}/bin/mysqld_safe" if node['platform_family'] == 'omnios'
|
||||
return 'mysqld_safe' if scl_package?
|
||||
"#{prefix_dir}/usr/bin/mysqld_safe"
|
||||
end
|
||||
|
||||
def record_init
|
||||
cmd = v56plus ? mysqld_bin : mysqld_safe_bin
|
||||
cmd << " --defaults-file=#{etc_dir}/my.cnf"
|
||||
cmd << " --init-file=/tmp/#{mysql_name}/my.sql"
|
||||
cmd << ' --explicit_defaults_for_timestamp' if v56plus
|
||||
cmd << ' &'
|
||||
return "scl enable #{scl_name} \"#{cmd}\"" if scl_package?
|
||||
cmd
|
||||
end
|
||||
end
|
||||
end
|
71
ops/cookbooks/vendor/mysql/libraries/matchers.rb
vendored
Normal file
71
ops/cookbooks/vendor/mysql/libraries/matchers.rb
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
if defined?(ChefSpec)
|
||||
ChefSpec.define_matcher :mysql_config
|
||||
ChefSpec.define_matcher :mysql_service
|
||||
ChefSpec.define_matcher :mysql_client
|
||||
|
||||
# mysql_client_client_installation_package
|
||||
def install_mysql_client_installation_package(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_client_installation_package, :create, resource_name)
|
||||
end
|
||||
|
||||
def remove_mysql_client_installation_package(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_client_installation_package, :remove, resource_name)
|
||||
end
|
||||
|
||||
# mysql_server_server_installation_package
|
||||
def install_mysql_server_installation_package(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_server_installation_package, :install, resource_name)
|
||||
end
|
||||
|
||||
def remove_mysql_server_installation_package(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_server_installation_package, :remove, resource_name)
|
||||
end
|
||||
|
||||
#####
|
||||
# old
|
||||
#####
|
||||
|
||||
# client
|
||||
def create_mysql_client(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_client, :create, resource_name)
|
||||
end
|
||||
|
||||
def delete_mysql_client(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_client, :delete, resource_name)
|
||||
end
|
||||
|
||||
# mysql_config
|
||||
def create_mysql_config(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_config, :create, resource_name)
|
||||
end
|
||||
|
||||
def delete_mysql_config(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_config, :delete, resource_name)
|
||||
end
|
||||
|
||||
# service
|
||||
def create_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :create, resource_name)
|
||||
end
|
||||
|
||||
def delete_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :delete, resource_name)
|
||||
end
|
||||
|
||||
def start_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :start, resource_name)
|
||||
end
|
||||
|
||||
def stop_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :stop, resource_name)
|
||||
end
|
||||
|
||||
def restart_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :restart, resource_name)
|
||||
end
|
||||
|
||||
def reload_mysql_service(resource_name)
|
||||
ChefSpec::Matchers::ResourceMatcher.new(:mysql_service, :reload, resource_name)
|
||||
end
|
||||
|
||||
end
|
30
ops/cookbooks/vendor/mysql/libraries/mysql_base.rb
vendored
Normal file
30
ops/cookbooks/vendor/mysql/libraries/mysql_base.rb
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
module MysqlCookbook
|
||||
class MysqlBase < Chef::Resource
|
||||
require_relative 'helpers'
|
||||
|
||||
# All resources are composites
|
||||
def whyrun_supported?
|
||||
true
|
||||
end
|
||||
|
||||
################
|
||||
# Type Constants
|
||||
################
|
||||
|
||||
Boolean = property_type(
|
||||
is: [true, false],
|
||||
default: false
|
||||
) unless defined?(Boolean)
|
||||
|
||||
###################
|
||||
# Common Properties
|
||||
###################
|
||||
property :run_group, String, default: 'mysql', desired_state: false
|
||||
property :run_user, String, default: 'mysql', desired_state: false
|
||||
property :version, String, default: lazy { default_major_version }, desired_state: false
|
||||
property :include_dir, String, default: lazy { default_include_dir }, desired_state: false
|
||||
property :major_version, String, default: lazy { major_from_full(version) }, desired_state: false
|
||||
|
||||
action_class
|
||||
end
|
||||
end
|
31
ops/cookbooks/vendor/mysql/libraries/mysql_client_installation_package.rb
vendored
Normal file
31
ops/cookbooks/vendor/mysql/libraries/mysql_client_installation_package.rb
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
module MysqlCookbook
|
||||
class MysqlClientInstallationPackage < MysqlBase
|
||||
# helper methods
|
||||
require_relative 'helpers'
|
||||
include MysqlCookbook::HelpersBase
|
||||
|
||||
# Resource properties
|
||||
resource_name :mysql_client_installation_package
|
||||
provides :mysql_client_installation, os: 'linux'
|
||||
provides :mysql_client, os: 'linux'
|
||||
|
||||
property :package_name, [String, Array], default: lazy { default_client_package_name }, desired_state: false
|
||||
property :package_options, [String, nil], desired_state: false
|
||||
property :package_version, [String, nil], default: nil, desired_state: false
|
||||
|
||||
# Actions
|
||||
action :create do
|
||||
package new_resource.package_name do
|
||||
version new_resource.package_version if new_resource.package_version
|
||||
options new_resource.package_options if new_resource.package_options
|
||||
action :install
|
||||
end
|
||||
end
|
||||
|
||||
action :delete do
|
||||
package new_resource.package_name do
|
||||
action :remove
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
56
ops/cookbooks/vendor/mysql/libraries/mysql_config.rb
vendored
Normal file
56
ops/cookbooks/vendor/mysql/libraries/mysql_config.rb
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
module MysqlCookbook
|
||||
class MysqlConfig < MysqlBase
|
||||
resource_name :mysql_config
|
||||
|
||||
property :config_name, String, name_property: true, desired_state: false
|
||||
property :cookbook, String, desired_state: false
|
||||
property :group, String, default: 'mysql', desired_state: false
|
||||
property :instance, String, default: 'default', desired_state: false
|
||||
property :owner, String, default: 'mysql', desired_state: false
|
||||
property :source, String, desired_state: false
|
||||
property :variables, [Hash], desired_state: false
|
||||
property :version, String, default: lazy { default_major_version }, desired_state: false
|
||||
|
||||
require_relative 'helpers'
|
||||
include MysqlCookbook::HelpersBase
|
||||
|
||||
provides :mysql_config
|
||||
|
||||
action :create do
|
||||
# hax because group property
|
||||
g = Chef::Resource::Group.new(new_resource.group, run_context)
|
||||
g.system true if new_resource.name == 'mysql'
|
||||
resource_collection.insert g
|
||||
|
||||
user new_resource.owner do
|
||||
gid new_resource.owner
|
||||
system true if new_resource.name == 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
directory new_resource.include_dir do
|
||||
owner new_resource.owner
|
||||
group new_resource.group
|
||||
mode '0750'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
template "#{new_resource.include_dir}/#{new_resource.config_name}.cnf" do
|
||||
owner new_resource.owner
|
||||
group new_resource.group
|
||||
mode '0640'
|
||||
variables(new_resource.variables)
|
||||
source new_resource.source
|
||||
cookbook new_resource.cookbook
|
||||
action :create
|
||||
end
|
||||
end
|
||||
|
||||
action :delete do
|
||||
file "#{new_resource.include_dir}/#{new_resource.config_name}.cnf" do
|
||||
action :delete
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
42
ops/cookbooks/vendor/mysql/libraries/mysql_server_installation_package.rb
vendored
Normal file
42
ops/cookbooks/vendor/mysql/libraries/mysql_server_installation_package.rb
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
module MysqlCookbook
|
||||
class MysqlServerInstallationPackage < MysqlBase
|
||||
# Resource properties
|
||||
resource_name :mysql_server_installation_package
|
||||
provides :mysql_server_installation, os: 'linux'
|
||||
|
||||
property :package_name, String, default: lazy { default_server_package_name }, desired_state: false
|
||||
property :package_options, [String, nil], desired_state: false
|
||||
property :package_version, [String, nil], default: nil, desired_state: false
|
||||
|
||||
# helper methods
|
||||
require_relative 'helpers'
|
||||
include MysqlCookbook::HelpersBase
|
||||
|
||||
# Actions
|
||||
action :install do
|
||||
package new_resource.package_name do
|
||||
version new_resource.package_version if new_resource.package_version
|
||||
options new_resource.package_options if new_resource.package_options
|
||||
notifies :install, 'package[perl-Sys-Hostname-Long]', :immediately if platform_family?('suse')
|
||||
notifies :run, 'execute[Initial DB setup script]', :immediately if platform_family?('suse')
|
||||
action :install
|
||||
end
|
||||
|
||||
package 'perl-Sys-Hostname-Long' do
|
||||
action :nothing
|
||||
end
|
||||
|
||||
execute 'Initial DB setup script' do
|
||||
environment 'INSTANCE' => new_resource.name
|
||||
command '/usr/lib/mysql/mysql-systemd-helper install'
|
||||
action :nothing
|
||||
end
|
||||
end
|
||||
|
||||
action :delete do
|
||||
package new_resource.package_name do
|
||||
action :remove
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
105
ops/cookbooks/vendor/mysql/libraries/mysql_service.rb
vendored
Normal file
105
ops/cookbooks/vendor/mysql/libraries/mysql_service.rb
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
module MysqlCookbook
|
||||
require_relative 'mysql_service_base'
|
||||
class MysqlService < MysqlServiceBase
|
||||
resource_name :mysql_service
|
||||
|
||||
# installation type and service_manager
|
||||
property :install_method, %w(package auto), default: 'auto', desired_state: false
|
||||
property :service_manager, %w(sysvinit upstart systemd auto), default: 'auto', desired_state: false
|
||||
|
||||
# mysql_server_installation
|
||||
property :version, String, default: lazy { default_major_version }, desired_state: false
|
||||
property :major_version, String, default: lazy { major_from_full(version) }, desired_state: false
|
||||
property :package_name, String, default: lazy { default_package_name }, desired_state: false
|
||||
property :package_options, [String, nil], desired_state: false
|
||||
property :package_version, [String, nil], default: nil, desired_state: false
|
||||
|
||||
################
|
||||
# Helper Methods
|
||||
################
|
||||
|
||||
def copy_properties_to(to, *properties)
|
||||
properties = self.class.properties.keys if properties.empty?
|
||||
properties.each do |p|
|
||||
# If the property is set on from, and exists on to, set the
|
||||
# property on to
|
||||
if to.class.properties.include?(p) && property_is_set?(p)
|
||||
to.send(p, send(p))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
action_class do
|
||||
def installation(&block)
|
||||
case new_resource.install_method
|
||||
when 'auto'
|
||||
install = mysql_server_installation(new_resource.name, &block)
|
||||
when 'package'
|
||||
install = mysql_server_installation_package(new_resource.name, &block)
|
||||
when 'none'
|
||||
Chef::Log.info('Skipping MySQL installation. Assuming it was handled previously.')
|
||||
return
|
||||
end
|
||||
copy_properties_to(install)
|
||||
install
|
||||
end
|
||||
|
||||
def svc_manager(&block)
|
||||
case new_resource.service_manager
|
||||
when 'auto'
|
||||
svc = mysql_service_manager(new_resource.name, &block)
|
||||
when 'sysvinit'
|
||||
svc = mysql_service_manager_sysvinit(new_resource.name, &block)
|
||||
when 'upstart'
|
||||
svc = mysql_service_manager_upstart(new_resource.name, &block)
|
||||
when 'systemd'
|
||||
svc = mysql_service_manager_systemd(new_resource.name, &block)
|
||||
end
|
||||
copy_properties_to(svc)
|
||||
svc
|
||||
end
|
||||
end
|
||||
|
||||
#########
|
||||
# Actions
|
||||
#########
|
||||
|
||||
action :create do
|
||||
installation do
|
||||
action :install
|
||||
end
|
||||
|
||||
svc_manager do
|
||||
action :create
|
||||
end
|
||||
end
|
||||
|
||||
action :start do
|
||||
svc_manager do
|
||||
action :start
|
||||
end
|
||||
end
|
||||
|
||||
action :delete do
|
||||
svc_manager do
|
||||
action :delete
|
||||
end
|
||||
|
||||
installation do
|
||||
action :delete
|
||||
end
|
||||
end
|
||||
|
||||
action :restart do
|
||||
svc_manager do
|
||||
action :restart
|
||||
end
|
||||
end
|
||||
|
||||
action :stop do
|
||||
svc_manager do
|
||||
action :stop
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
203
ops/cookbooks/vendor/mysql/libraries/mysql_service_base.rb
vendored
Normal file
203
ops/cookbooks/vendor/mysql/libraries/mysql_service_base.rb
vendored
Normal file
@ -0,0 +1,203 @@
|
||||
module MysqlCookbook
|
||||
class MysqlServiceBase < MysqlBase
|
||||
property :bind_address, String, desired_state: false
|
||||
property :charset, String, default: 'utf8', desired_state: false
|
||||
property :data_dir, String, default: lazy { default_data_dir }, desired_state: false
|
||||
property :error_log, String, default: lazy { default_error_log }, desired_state: false
|
||||
property :initial_root_password, String, default: 'ilikerandompasswords', desired_state: false
|
||||
property :instance, String, name_property: true, desired_state: false
|
||||
property :mysqld_options, Hash, default: {}, desired_state: false
|
||||
property :pid_file, String, default: lazy { default_pid_file }, desired_state: false
|
||||
property :port, [String, Integer], default: '3306', desired_state: false
|
||||
property :socket, String, default: lazy { default_socket_file }, desired_state: false
|
||||
property :tmp_dir, String, desired_state: false
|
||||
|
||||
alias socket_file socket
|
||||
|
||||
require_relative 'helpers'
|
||||
include MysqlCookbook::HelpersBase
|
||||
|
||||
# action class methods are available within the actions and work as if the coded
|
||||
# was inline the action. No messing with classes or passing in the new_resource
|
||||
action_class do
|
||||
def create_system_user
|
||||
group 'mysql' do
|
||||
action :create
|
||||
end
|
||||
|
||||
user 'mysql' do
|
||||
gid 'mysql'
|
||||
action :create
|
||||
end
|
||||
end
|
||||
|
||||
def create_config
|
||||
# require 'pry' ; binding.pry
|
||||
|
||||
# Yak shaving secion. Account for random errata.
|
||||
#
|
||||
# Turns out that mysqld is hard coded to try and read
|
||||
# /etc/mysql/my.cnf, and its presence causes problems when
|
||||
# setting up multiple services.
|
||||
file "#{prefix_dir}/etc/mysql/my.cnf" do
|
||||
action :delete
|
||||
end
|
||||
|
||||
file "#{prefix_dir}/etc/my.cnf" do
|
||||
action :delete
|
||||
end
|
||||
|
||||
# mysql_install_db is broken on 5.6.13
|
||||
link "#{prefix_dir}/usr/share/my-default.cnf" do
|
||||
to "#{etc_dir}/my.cnf"
|
||||
not_if { ::File.exist? "#{prefix_dir}/usr/share/my-default.cnf" } # FIXME: Chef bug?
|
||||
action :create
|
||||
end
|
||||
|
||||
# Support directories
|
||||
directory etc_dir do
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0750'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
directory new_resource.include_dir do
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0750'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
directory run_dir do
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0755'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
directory log_dir do
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0750'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
directory new_resource.data_dir do
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0750'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
# Main configuration file
|
||||
template "#{etc_dir}/my.cnf" do
|
||||
source 'my.cnf.erb'
|
||||
cookbook 'mysql'
|
||||
owner new_resource.run_user
|
||||
group new_resource.run_group
|
||||
mode '0600'
|
||||
variables(config: new_resource)
|
||||
action :create
|
||||
end
|
||||
end
|
||||
|
||||
def initialize_database
|
||||
# initialize database and create initial records
|
||||
bash "#{new_resource.name} initial records" do
|
||||
code init_records_script
|
||||
umask '022'
|
||||
returns [0, 1, 2] # facepalm
|
||||
not_if "/usr/bin/test -f #{new_resource.data_dir}/mysql/user.frm"
|
||||
action :run
|
||||
end
|
||||
end
|
||||
|
||||
def delete_support_directories
|
||||
# Stop the service before removing support directories
|
||||
delete_stop_service
|
||||
|
||||
directory etc_dir do
|
||||
recursive true
|
||||
action :delete
|
||||
end
|
||||
|
||||
directory run_dir do
|
||||
recursive true
|
||||
action :delete
|
||||
end
|
||||
|
||||
directory log_dir do
|
||||
recursive true
|
||||
action :delete
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Platform specific bits
|
||||
#
|
||||
def configure_apparmor
|
||||
# Do not add these resource if inside a container
|
||||
# Only valid on Ubuntu
|
||||
return if ::File.exist?('/.dockerenv') || ::File.exist?('/.dockerinit') || node['platform'] != 'ubuntu'
|
||||
|
||||
# Apparmor
|
||||
package 'apparmor' do
|
||||
action :install
|
||||
end
|
||||
|
||||
directory '/etc/apparmor.d/local/mysql' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
recursive true
|
||||
action :create
|
||||
end
|
||||
|
||||
template '/etc/apparmor.d/local/usr.sbin.mysqld' do
|
||||
cookbook 'mysql'
|
||||
source 'apparmor/usr.sbin.mysqld-local.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
action :create
|
||||
notifies :restart, "service[#{new_resource.instance} apparmor]", :immediately
|
||||
end
|
||||
|
||||
template '/etc/apparmor.d/usr.sbin.mysqld' do
|
||||
cookbook 'mysql'
|
||||
source 'apparmor/usr.sbin.mysqld.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
action :create
|
||||
notifies :restart, "service[#{new_resource.instance} apparmor]", :immediately
|
||||
end
|
||||
|
||||
template "/etc/apparmor.d/local/mysql/#{new_resource.instance}" do
|
||||
cookbook 'mysql'
|
||||
source 'apparmor/usr.sbin.mysqld-instance.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
variables(
|
||||
config: new_resource,
|
||||
mysql_name: mysql_name
|
||||
)
|
||||
action :create
|
||||
notifies :restart, "service[#{new_resource.instance} apparmor]", :immediately
|
||||
end
|
||||
|
||||
service "#{new_resource.instance} apparmor" do
|
||||
service_name 'apparmor'
|
||||
action :nothing
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
142
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_systemd.rb
vendored
Normal file
142
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_systemd.rb
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
module MysqlCookbook
|
||||
class MysqlServiceManagerSystemd < MysqlServiceBase
|
||||
resource_name :mysql_service_manager_systemd
|
||||
|
||||
provides :mysql_service_manager, os: 'linux' do |_node|
|
||||
Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd)
|
||||
end
|
||||
|
||||
action :create do
|
||||
# from base
|
||||
create_system_user
|
||||
stop_system_service
|
||||
create_config
|
||||
configure_apparmor
|
||||
initialize_database
|
||||
end
|
||||
|
||||
action :start do
|
||||
# Needed for Debian / Ubuntu
|
||||
directory '/usr/libexec' do
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
action :create
|
||||
end
|
||||
|
||||
# this script is called by the main systemd unit file, and
|
||||
# spins around until the service is actually up and running.
|
||||
template "/usr/libexec/#{mysql_name}-wait-ready" do
|
||||
path "/usr/libexec/#{mysql_name}-wait-ready"
|
||||
source 'systemd/mysqld-wait-ready.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
variables(socket_file: socket_file)
|
||||
cookbook 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
# this is the main systemd unit file
|
||||
template "/etc/systemd/system/#{mysql_name}.service" do
|
||||
path "/etc/systemd/system/#{mysql_name}.service"
|
||||
source 'systemd/mysqld.service.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
variables(
|
||||
config: new_resource,
|
||||
etc_dir: etc_dir,
|
||||
base_dir: base_dir,
|
||||
mysqld_bin: mysqld_bin
|
||||
)
|
||||
cookbook 'mysql'
|
||||
notifies :run, "execute[#{new_resource.instance} systemctl daemon-reload]", :immediately
|
||||
action :create
|
||||
end
|
||||
|
||||
# avoid 'Unit file changed on disk' warning
|
||||
execute "#{new_resource.instance} systemctl daemon-reload" do
|
||||
command '/bin/systemctl daemon-reload'
|
||||
action :nothing
|
||||
end
|
||||
|
||||
# tmpfiles.d config so the service survives reboot
|
||||
template "/usr/lib/tmpfiles.d/#{mysql_name}.conf" do
|
||||
path "/usr/lib/tmpfiles.d/#{mysql_name}.conf"
|
||||
source 'tmpfiles.d.conf.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
variables(
|
||||
run_dir: run_dir,
|
||||
run_user: new_resource.run_user,
|
||||
run_group: new_resource.run_group
|
||||
)
|
||||
cookbook 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
# service management resource
|
||||
service mysql_name.to_s do
|
||||
service_name mysql_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
supports restart: true, status: true
|
||||
action [:enable, :start]
|
||||
end
|
||||
end
|
||||
|
||||
action :stop do
|
||||
# service management resource
|
||||
service mysql_name.to_s do
|
||||
service_name mysql_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
supports status: true
|
||||
action [:disable, :stop]
|
||||
only_if { ::File.exist?("/usr/lib/systemd/system/#{mysql_name}.service") }
|
||||
end
|
||||
end
|
||||
|
||||
action :restart do
|
||||
# service management resource
|
||||
service mysql_name.to_s do
|
||||
service_name mysql_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
supports restart: true
|
||||
action :restart
|
||||
end
|
||||
end
|
||||
|
||||
action :reload do
|
||||
# service management resource
|
||||
service mysql_name.to_s do
|
||||
service_name mysql_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
action :reload
|
||||
end
|
||||
end
|
||||
|
||||
action_class do
|
||||
def stop_system_service
|
||||
# service management resource
|
||||
service 'mysql' do
|
||||
service_name system_service_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
supports status: true
|
||||
action [:stop, :disable]
|
||||
end
|
||||
end
|
||||
|
||||
def delete_stop_service
|
||||
# service management resource
|
||||
service mysql_name.to_s do
|
||||
service_name mysql_name
|
||||
provider Chef::Provider::Service::Systemd
|
||||
supports status: true
|
||||
action [:disable, :stop]
|
||||
only_if { ::File.exist?("/usr/lib/systemd/system/#{mysql_name}.service") }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
79
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_sysvinit.rb
vendored
Normal file
79
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_sysvinit.rb
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
module MysqlCookbook
|
||||
class MysqlServiceManagerSysvinit < MysqlServiceBase
|
||||
resource_name :mysql_service_manager_sysvinit
|
||||
|
||||
provides :mysql_service_manager, os: 'linux'
|
||||
|
||||
action :create do
|
||||
# from base
|
||||
create_system_user
|
||||
stop_system_service
|
||||
create_config
|
||||
initialize_database
|
||||
configure_apparmor
|
||||
end
|
||||
|
||||
action :start do
|
||||
template "/etc/init.d/#{mysql_name}" do
|
||||
source 'sysvinit/mysqld.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
variables(
|
||||
config: new_resource,
|
||||
defaults_file: defaults_file,
|
||||
error_log: new_resource.error_log,
|
||||
mysql_name: mysql_name,
|
||||
mysqladmin_bin: mysqladmin_bin,
|
||||
mysqld_safe_bin: mysqld_safe_bin,
|
||||
pid_file: new_resource.pid_file,
|
||||
scl_name: scl_name
|
||||
)
|
||||
cookbook 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
service mysql_name do
|
||||
supports restart: true, status: true
|
||||
action [:enable, :start]
|
||||
end
|
||||
end
|
||||
|
||||
action :stop do
|
||||
service mysql_name do
|
||||
supports restart: true, status: true
|
||||
action [:stop]
|
||||
end
|
||||
end
|
||||
|
||||
action :restart do
|
||||
service mysql_name do
|
||||
supports restart: true
|
||||
action :restart
|
||||
end
|
||||
end
|
||||
|
||||
action :reload do
|
||||
service mysql_name do
|
||||
action :reload
|
||||
end
|
||||
end
|
||||
|
||||
action_class do
|
||||
def stop_system_service
|
||||
service system_service_name do
|
||||
supports status: true
|
||||
action [:stop, :disable]
|
||||
end
|
||||
end
|
||||
|
||||
def delete_stop_service
|
||||
service mysql_name do
|
||||
supports status: true
|
||||
action [:disable, :stop]
|
||||
only_if { ::File.exist?("#{etc_dir}/init.d/#{mysql_name}") }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
103
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_upstart.rb
vendored
Normal file
103
ops/cookbooks/vendor/mysql/libraries/mysql_service_manager_upstart.rb
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
module MysqlCookbook
|
||||
class MysqlServiceManagerUpstart < MysqlServiceBase
|
||||
resource_name :mysql_service_manager_upstart
|
||||
|
||||
provides :mysql_service_manager, platform_family: 'debian' do |_node|
|
||||
Chef::Platform::ServiceHelpers.service_resource_providers.include?(:upstart) &&
|
||||
!Chef::Platform::ServiceHelpers.service_resource_providers.include?(:systemd) &&
|
||||
!Chef::Platform::ServiceHelpers.service_resource_providers.include?(:redhat) &&
|
||||
::File.exist?('/sbin/status') # Fix for Docker, in 7 and 8 images /sbin/status doesn't exists and Upstart provider doesn't work
|
||||
end
|
||||
|
||||
action :create do
|
||||
# from base
|
||||
create_system_user
|
||||
stop_system_service
|
||||
create_config
|
||||
configure_apparmor
|
||||
initialize_database
|
||||
end
|
||||
|
||||
action :start do
|
||||
template "/usr/sbin/#{mysql_name}-wait-ready" do
|
||||
source 'upstart/mysqld-wait-ready.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0755'
|
||||
variables(socket_file: socket_file)
|
||||
cookbook 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
template "/etc/init/#{mysql_name}.conf" do
|
||||
source 'upstart/mysqld.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
mode '0644'
|
||||
variables(
|
||||
defaults_file: defaults_file,
|
||||
mysql_name: mysql_name,
|
||||
run_group: new_resource.run_group,
|
||||
run_user: new_resource.run_user,
|
||||
socket_dir: new_resource.socket_dir
|
||||
)
|
||||
cookbook 'mysql'
|
||||
action :create
|
||||
end
|
||||
|
||||
service mysql_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
supports status: true
|
||||
action [:start]
|
||||
end
|
||||
end
|
||||
|
||||
action :stop do
|
||||
service mysql_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
supports restart: true, status: true
|
||||
action [:stop]
|
||||
end
|
||||
end
|
||||
|
||||
action :restart do
|
||||
# With Upstart, restarting the service doesn't behave "as expected".
|
||||
# We want the post-start stanzas, which wait until the
|
||||
# service is available before returning
|
||||
#
|
||||
# http://upstart.ubuntu.com/cookbook/#restart
|
||||
service mysql_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action [:stop, :start]
|
||||
end
|
||||
end
|
||||
|
||||
action :reload do
|
||||
# With Upstart, reload just sends a HUP signal to the process.
|
||||
# As far as I can tell, this doesn't work the way it's
|
||||
# supposed to, so we need to actually restart the service.
|
||||
service mysql_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action [:stop, :start]
|
||||
end
|
||||
end
|
||||
|
||||
action_class do
|
||||
def stop_system_service
|
||||
service system_service_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
supports status: true
|
||||
action [:stop, :disable]
|
||||
end
|
||||
end
|
||||
|
||||
def delete_stop_service
|
||||
service mysql_name do
|
||||
provider Chef::Provider::Service::Upstart
|
||||
action [:disable, :stop]
|
||||
only_if { ::File.exist?("#{etc_dir}/init/#{mysql_name}") }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
1
ops/cookbooks/vendor/mysql/metadata.json
vendored
Normal file
1
ops/cookbooks/vendor/mysql/metadata.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"name":"mysql","version":"8.5.1","description":"Provides mysql_service, mysql_config, and mysql_client resources","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"redhat":">= 6.0","centos":">= 6.0","scientific":">= 6.0","oracle":">= 6.0","amazon":">= 0.0.0","fedora":">= 0.0.0","debian":">= 7.0","ubuntu":">= 12.04","opensuse":">= 13.0","opensuseleap":">= 0.0.0","suse":">= 12.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/mysql","issues_url":"https://github.com/chef-cookbooks/mysql/issues","chef_version":[[">= 12.7"]],"ohai_version":[]}
|
14
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld-instance.erb
vendored
Normal file
14
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld-instance.erb
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/etc/<%= @mysql_name %>/*.pem r,
|
||||
/etc/<%= @mysql_name %>/conf.d/ r,
|
||||
/etc/<%= @mysql_name %>/conf.d/* r,
|
||||
/etc/<%= @mysql_name %>/my.cnf r,
|
||||
<%= @config.log_dir %>/ r,
|
||||
<%= @config.log_dir %>/* rw,
|
||||
<%= @config.data_dir %>/ r,
|
||||
<%= @config.data_dir %>/** rwk,
|
||||
<%= @config.run_dir %>/** rw,
|
||||
<%= @config.pid_file %> rw,
|
||||
<%= @config.socket_file %> rw,
|
||||
/tmp/<%= @mysql_name %>/ r,
|
||||
/tmp/<%= @mysql_name %>/my.sql r,
|
||||
<%= @config.tmp_dir %>/* rw,
|
1
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld-local.erb
vendored
Normal file
1
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld-local.erb
vendored
Normal file
@ -0,0 +1 @@
|
||||
#include <local/mysql>
|
47
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld.erb
vendored
Normal file
47
ops/cookbooks/vendor/mysql/templates/default/apparmor/usr.sbin.mysqld.erb
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# vim:syntax=apparmor
|
||||
# Last Modified: Tue Jun 19 17:37:30 2007
|
||||
#include <tunables/global>
|
||||
|
||||
/usr/sbin/mysqld {
|
||||
#include <abstractions/base>
|
||||
#include <abstractions/nameservice>
|
||||
#include <abstractions/user-tmp>
|
||||
#include <abstractions/mysql>
|
||||
#include <abstractions/winbind>
|
||||
|
||||
capability dac_override,
|
||||
capability sys_resource,
|
||||
capability setgid,
|
||||
capability setuid,
|
||||
|
||||
network tcp,
|
||||
|
||||
/etc/hosts.allow r,
|
||||
/etc/hosts.deny r,
|
||||
|
||||
/etc/mysql/*.pem r,
|
||||
/etc/mysql/conf.d/ r,
|
||||
/etc/mysql/conf.d/* r,
|
||||
/etc/mysql/*.cnf r,
|
||||
/usr/lib/mysql/plugin/ r,
|
||||
/usr/lib/mysql/plugin/*.so* mr,
|
||||
/usr/sbin/mysqld mr,
|
||||
/usr/share/mysql/** r,
|
||||
/var/log/mysql.log rw,
|
||||
/var/log/mysql.err rw,
|
||||
/var/lib/mysql/ r,
|
||||
/var/lib/mysql/** rwk,
|
||||
/var/log/mysql/ r,
|
||||
/var/log/mysql/* rw,
|
||||
/var/run/mysqld/mysqld.pid rw,
|
||||
/var/run/mysqld/mysqld.sock w,
|
||||
/var/run/mysqld/mysqld.sock.lock rw,
|
||||
/run/mysqld/mysqld.pid rw,
|
||||
/run/mysqld/mysqld.sock w,
|
||||
/run/mysqld/mysqld.sock.lock rw,
|
||||
|
||||
/sys/devices/system/cpu/ r,
|
||||
|
||||
# Site-specific additions and overrides. See local/README for details.
|
||||
#include <local/usr.sbin.mysqld>
|
||||
}
|
57
ops/cookbooks/vendor/mysql/templates/default/my.cnf.erb
vendored
Normal file
57
ops/cookbooks/vendor/mysql/templates/default/my.cnf.erb
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
# Chef generated my.cnf for instance mysql-<%= @config.name %>
|
||||
|
||||
[client]
|
||||
<% if @config.charset %>
|
||||
default-character-set = <%= @config.charset %>
|
||||
<% end %>
|
||||
<% if @config.port %>
|
||||
port = <%= @config.port %>
|
||||
<% end %>
|
||||
<% if @config.socket_file %>
|
||||
socket = <%= @config.socket_file %>
|
||||
<% end %>
|
||||
|
||||
[mysql]
|
||||
<% if @config.charset %>
|
||||
default-character-set = <%= @config.charset %>
|
||||
<% end %>
|
||||
|
||||
[mysqld]
|
||||
<% if @config.run_user %>
|
||||
user = <%= @config.run_user %>
|
||||
<% end %>
|
||||
<% if @config.pid_file %>
|
||||
pid-file = <%= @config.pid_file %>
|
||||
<% end %>
|
||||
<% if @config.socket_file %>
|
||||
socket = <%= @config.socket_file %>
|
||||
<% end %>
|
||||
<% if @config.bind_address %>
|
||||
bind-address = <%= @config.bind_address %>
|
||||
<% end %>
|
||||
<% if @config.port %>
|
||||
port = <%= @config.port %>
|
||||
<% end %>
|
||||
<% if @config.data_dir %>
|
||||
datadir = <%= @config.data_dir %>
|
||||
<% end %>
|
||||
<% if @config.tmp_dir %>
|
||||
tmpdir = <%= @config.tmp_dir %>
|
||||
<% end %>
|
||||
<% @config.mysqld_options.each do |option,value| %>
|
||||
<%= option %> = <%= value %>
|
||||
<% end %>
|
||||
<% if @config.lc_messages_dir %>
|
||||
lc-messages-dir = <%= @config.lc_messages_dir %>
|
||||
<% end %>
|
||||
<% if @config.error_log %>
|
||||
log-error = <%= @config.error_log %>
|
||||
<% end %>
|
||||
<% if @config.include_dir %>
|
||||
!includedir <%= @config.include_dir %>
|
||||
<% end %>
|
||||
|
||||
[mysqld_safe]
|
||||
<% if @config.socket_file %>
|
||||
socket = <%= @config.socket_file %>
|
||||
<% end %>
|
28
ops/cookbooks/vendor/mysql/templates/default/smf/svc.method.mysqld.erb
vendored
Normal file
28
ops/cookbooks/vendor/mysql/templates/default/smf/svc.method.mysqld.erb
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#!/sbin/sh
|
||||
#
|
||||
# Generated by Chef
|
||||
#
|
||||
|
||||
. /lib/svc/share/smf_include.sh
|
||||
|
||||
ulimit -n 10240
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
<%= @mysqld_bin %> \
|
||||
--defaults-file=<%= @defaults_file %> \
|
||||
--basedir=<%= @base_dir %> \
|
||||
--datadir=<%= @data_dir %> \
|
||||
--pid-file=<%= @pid_file %> \
|
||||
--log-error=<%= @error_log %> &
|
||||
;;
|
||||
stop)
|
||||
[ -f <%= @pid_file %> ] && kill `/usr/bin/head -1 <%= @pid_file %>`
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $SMF_EXIT_OK
|
30
ops/cookbooks/vendor/mysql/templates/default/systemd/mysqld-wait-ready.erb
vendored
Normal file
30
ops/cookbooks/vendor/mysql/templates/default/systemd/mysqld-wait-ready.erb
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
daemon_pid="$1"
|
||||
|
||||
# Wait for the server to come up or for the mysqld process to disappear
|
||||
ret=0
|
||||
while /bin/true; do
|
||||
RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="<%= @socket_file %>" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
mret=$?
|
||||
if [ $mret -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||||
# anything else suggests a configuration error
|
||||
if [ $mret -ne 1 -a $mret -ne 11 ]; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
# "Access denied" also means the server is alive
|
||||
echo "$RESPONSE" | grep -q "Access denied for user" && break
|
||||
|
||||
# Check process still exists
|
||||
if ! /bin/kill -0 $daemon_pid 2>/dev/null; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit $ret
|
16
ops/cookbooks/vendor/mysql/templates/default/systemd/mysqld.service.erb
vendored
Normal file
16
ops/cookbooks/vendor/mysql/templates/default/systemd/mysqld.service.erb
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=mysql_service[mysql-<%= @config.instance %>]
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=<%= @config.run_user %>
|
||||
Group=<%= @config.run_group %>
|
||||
ExecStart=<%= @mysqld_bin %> --defaults-file=<%= @etc_dir %>/my.cnf --basedir=<%= @base_dir %>
|
||||
ExecStartPost=/usr/libexec/mysql-<%= @config.instance %>-wait-ready $MAINPID
|
||||
TimeoutSec=300
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
279
ops/cookbooks/vendor/mysql/templates/default/sysvinit/mysqld.erb
vendored
Normal file
279
ops/cookbooks/vendor/mysql/templates/default/sysvinit/mysqld.erb
vendored
Normal file
@ -0,0 +1,279 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: <%= @mysql_name %>
|
||||
# Required-Start: $remote_fs $syslog
|
||||
# Required-Stop: $remote_fs $syslog
|
||||
# Should-Start: $network $time
|
||||
# Should-Stop: $network $time
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Start and stop the mysql database server daemon
|
||||
# Description: Controls the main MySQL database server daemon "mysqld"
|
||||
# and its wrapper script "mysqld_safe".
|
||||
### END INIT INFO
|
||||
|
||||
# set -e
|
||||
# set -u
|
||||
|
||||
### Exit code reference
|
||||
# http://fedoraproject.org/wiki/Packaging:SysVInitScript
|
||||
# http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
|
||||
|
||||
# Source functions
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
# Source RHEL function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
<% end %>
|
||||
|
||||
####
|
||||
# Variables
|
||||
####
|
||||
|
||||
STARTTIMEOUT=900
|
||||
STOPTIMEOUT=900
|
||||
PID_DELAY=60
|
||||
|
||||
####
|
||||
# Helper functions
|
||||
###
|
||||
|
||||
# Boolean function to see if MYSQL_PID exists and is a number
|
||||
pid_exists() {
|
||||
PID_EXISTS=1
|
||||
if [ -f <%= @pid_file %> ]; then
|
||||
MYSQLD_PID=`cat <%= @pid_file %> 2>/dev/null`
|
||||
if [ -n "$MYSQLD_PID" ] && [ -d "/proc/$MYSQLD_PID" ] ; then
|
||||
PID_EXISTS=0
|
||||
fi
|
||||
fi
|
||||
return $PID_EXISTS
|
||||
}
|
||||
|
||||
# Use mysqladmin to ping the service as an invalid user over a socket
|
||||
running() {
|
||||
RUNNING=1
|
||||
RESPONSE=`<%= @mysqladmin_bin %> --defaults-file=<%= @defaults_file %> --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
local mret=$?
|
||||
if pid_exists \
|
||||
&& [ $mret -eq 0 ] \
|
||||
|| [ `echo $RESPONSE | grep -q "Access denied for user"` ]; then
|
||||
RUNNING=0
|
||||
fi
|
||||
return $RUNNING
|
||||
}
|
||||
|
||||
writable_error_log() {
|
||||
WRITABLE_ERROR_LOG=1
|
||||
touch "<%= @error_log %>" 2>/dev/null
|
||||
touchret=$?
|
||||
if [ $touchret -eq 0 ]; then
|
||||
chown <%= @config.run_user %>:<%= @config.run_group %> <%= @error_log %>
|
||||
return 0
|
||||
else
|
||||
return $WRITABLE_ERROR_LOG
|
||||
fi
|
||||
}
|
||||
|
||||
print_start_success() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Starting <%= @mysql_name %>: " /bin/true
|
||||
<% else %>
|
||||
echo "Staring MySQL instance <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_start_failure() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Starting <%= @mysql_name %>: " /bin/false
|
||||
<% else %>
|
||||
echo "Could not start MySQL instance <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_reload_success() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Reloading <%= @mysql_name %>" /bin/true
|
||||
<% else %>
|
||||
echo "Reload success for <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_reload_failure() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Reloading <%= @mysql_name %>" /bin/false
|
||||
<% else %>
|
||||
echo "Reload failed for <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_stop_success() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Stopping <%= @mysql_name %>: " /bin/true
|
||||
<% else %>
|
||||
echo "Stopping MySQL instance <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
print_stop_failure() {
|
||||
<% if node['platform_family'] == 'rhel' %>
|
||||
action $"Stopping <%= @mysql_name %>: " /bin/false
|
||||
<% else %>
|
||||
echo "Could not stop MySQL instance <%= @mysql_name %>"
|
||||
<% end %>
|
||||
return 0;
|
||||
}
|
||||
|
||||
start_command() {
|
||||
# Attempt to start <%= @mysql_name %>
|
||||
echo "Starting MySQL instance <%= @mysql_name %>"
|
||||
|
||||
local scl_name="<%= @scl_name %>"
|
||||
|
||||
if [ -z $scl_name ]; then
|
||||
<%= @mysqld_safe_bin %> \
|
||||
--defaults-file=<%= @defaults_file %> \
|
||||
>/dev/null 2>&1 &
|
||||
local pid=$!
|
||||
else
|
||||
scl enable $scl_name "<%= @mysqld_safe_bin %> \
|
||||
--defaults-file=<%= @defaults_file %> \
|
||||
>/dev/null 2>&1 &"
|
||||
local pid=$!
|
||||
fi
|
||||
|
||||
return $pid
|
||||
}
|
||||
|
||||
####
|
||||
# Init script actions
|
||||
###
|
||||
|
||||
# Start <%= @mysql_name %>
|
||||
start() {
|
||||
# exit 0 if already running.
|
||||
if running; then
|
||||
print_start_success
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# exit 4 if we can't write to error_log
|
||||
if ! writable_error_log; then
|
||||
print_start_failure
|
||||
return 4
|
||||
fi
|
||||
|
||||
# run program
|
||||
start_command;
|
||||
start_pid=$?
|
||||
|
||||
# Timeout loop
|
||||
local TIMEOUT=$STARTTIMEOUT
|
||||
while [ $TIMEOUT -gt 0 ]; do
|
||||
if running; then
|
||||
break
|
||||
fi
|
||||
|
||||
let CURRENT_DELAY=${STARTTIMEOUT}-${TIMEOUT}
|
||||
if [ $CURRENT_DELAY -gt $PID_DELAY ] \
|
||||
&& ! pid_exists; then
|
||||
break
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
let TIMEOUT=${TIMEOUT}-1
|
||||
done
|
||||
|
||||
if running; then
|
||||
# successbaby.gif
|
||||
print_start_success
|
||||
return 0
|
||||
elif ! pid_exists; then
|
||||
# Handle startup failure
|
||||
print_start_failure
|
||||
return 3
|
||||
elif [ $TIMEOUT -eq 0 ]; then
|
||||
# Handle timeout
|
||||
print_start_failure
|
||||
# clean up
|
||||
kill $start_pid 2>/dev/null
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Reload <%= @mysql_name %>
|
||||
reload() {
|
||||
<%= @mysqladmin_bin %> reload
|
||||
local ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
print_reload_success;
|
||||
else
|
||||
print_reload_failure;
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Status of <%= @mysql_name %>
|
||||
status() {
|
||||
if running; then
|
||||
echo "<%= @mysql_name %> is running"
|
||||
return 0
|
||||
else
|
||||
echo "<%= @mysql_name %> is not running"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop <%= @mysql_name %>
|
||||
stop() {
|
||||
if running; then
|
||||
echo "Stopping MySQL instance <%= @mysql_name %>"
|
||||
if [ -f <%= @pid_file %> ]; then
|
||||
/bin/kill `cat <%= @pid_file %> 2>/dev/null`
|
||||
kstat=$?
|
||||
fi
|
||||
|
||||
# Timeout loop
|
||||
local TIMEOUT=$STARTTIMEOUT
|
||||
while [ $TIMEOUT -gt 0 ]; do
|
||||
if [ -e <%= @pid_file %> ]; then
|
||||
sleep 1
|
||||
fi
|
||||
let TIMEOUT=${TIMEOUT}-1
|
||||
done
|
||||
|
||||
return $kstat
|
||||
else
|
||||
echo "MySQL instance <%= @mysql_name %> Stopped."
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# main()
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
restart)
|
||||
stop ; start
|
||||
;;
|
||||
reload)
|
||||
reload
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|reload}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
1
ops/cookbooks/vendor/mysql/templates/default/tmpfiles.d.conf.erb
vendored
Normal file
1
ops/cookbooks/vendor/mysql/templates/default/tmpfiles.d.conf.erb
vendored
Normal file
@ -0,0 +1 @@
|
||||
d <%= @run_dir %> 0755 <%= @run_user %> <%= @run_group %> -
|
22
ops/cookbooks/vendor/mysql/templates/default/upstart/mysqld-wait-ready.erb
vendored
Normal file
22
ops/cookbooks/vendor/mysql/templates/default/upstart/mysqld-wait-ready.erb
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Wait for the server to come up
|
||||
ret=0
|
||||
while /bin/true; do
|
||||
RESPONSE=`/usr/bin/mysqladmin --no-defaults --socket="<%= @socket_file %>" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
mret=$?
|
||||
if [ $mret -eq 0 ]; then
|
||||
break
|
||||
fi
|
||||
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||||
# anything else suggests a configuration error
|
||||
if [ $mret -ne 1 -a $mret -ne 11 ]; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
# "Access denied" also means the server is alive
|
||||
echo "$RESPONSE" | grep -q "Access denied for user" && break
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit $ret
|
26
ops/cookbooks/vendor/mysql/templates/default/upstart/mysqld.erb
vendored
Normal file
26
ops/cookbooks/vendor/mysql/templates/default/upstart/mysqld.erb
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
# <%= @mysql_name %> Service
|
||||
|
||||
description "MySQL service <%= @mysql_name %>"
|
||||
author "chef-client"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on starting rc RUNLEVEL=[016]
|
||||
|
||||
respawn
|
||||
respawn limit 2 5
|
||||
|
||||
env HOME=/etc/<%= @mysql_name %>
|
||||
umask 007
|
||||
|
||||
kill timeout 300
|
||||
|
||||
pre-start script
|
||||
[ -d /run/<%= @mysql_name %> ] || install -m 755 -o <%= @run_user %> -g <%= @run_group %> -d /run/<%= @mysql_name %>
|
||||
[ -d <%= @socket_dir %> ] || install -m 755 -o <%= @run_user %> -g <%= @run_group %> -d <%= @socket_dir %>
|
||||
end script
|
||||
|
||||
exec /usr/sbin/mysqld --defaults-file=<%= @defaults_file %>
|
||||
|
||||
post-start script
|
||||
/usr/sbin/<%= @mysql_name %>-wait-ready
|
||||
end script
|
Reference in New Issue
Block a user