A Chef cookbook for the popular MySQL management application PHPMyAdmin
You can clone it and import it to Chef as
cd cookbooks
git clone git://github.com/priestjim/chef-phpmyadmin.git phpmyadmin
knife cookbook upload phpmyadmin
You can also install the latest version of the cookbook using Berkshelf. Add the following to your Berksfile:
cookbook "phpmyadmin", github: "priestjim/chef-phpmyadmin"
The latest and greatest revision of this cookbook will always be available at https://github.com/priestjim/chef-phpmyadmin
This cookbook requires the following cookbooks to be present and installed:
It also suggests the following:
- nginx
- apache2
- percona
This cookbook supports the following Linux distributions:
- Ubuntu
- Debian
- Fedora
- CentOS
- RedHat
It also supports Chef 10.14 and higher
This cookbook supports the following attributes:
version
: The desired PMA versionchecksum
: The sha256 checksum of the PMA desired versionmirror
: The desired PMA download mirrorfpm
: Enables the PMA FPM instance for serving via NGINXhome
: The desired PMA installation homeuser
: The user PMA runs asgroup
: The group PMA runs assocket
: The socket that FPM will be exposing for PMAupload_dir
: The directory PMA will be using for uploadssave_dir
: The directory PMA will be using for file savesmaxrows
: The maximum rows PMA shall display in a table viewprotect_binary
: Define the binary field protection PMA will be usingdefault_lang
: The default language PMA will be usingdefault_display
: The default display of rows inside PMAquery_history
: Enable or disable the Javascript query historyquery_history_size
: Set the maximum size of the Javascript query historycheck_config_permissions
: Enable or disable invalid PMA directory permission warnings for developmentforce_ssl
: Enable or disable SSL force
This cookbook defines a phpmyadmin_db LWRP for dynamic DB definitions. This LWRP allows the following methods:
name
: This is the description of the defined database. It also gets converted to lowercase and spaces substituted to underscores for the database filename. This is the name attributehost
: The database host. It can be either a hostname or an IP.port
: The database port.username
: The database username.password
: The database passwordhide_dbs
: An array of databases we do not want to be shown. This will be concatenated in a form of '^db1|db2$' etc.pma_database
: If you have configured your database server for PMA, you can define here the PMA database namepma_username
: If you have configured your database server for PMA, you can define here the PMA usernamepma_password
: If you have configured your database server for PMA, you can define here the PMA password
This cookbook defines a phpmyadmin_pmadb LWRP for dynamically defining the control databases of PHPMyAdmin for earch server. This LWRP allows the following methods:
name
: The block name. Define it for uniqueness. This is the name attributehost
: The database host. It can be either a hostname or an IP.port
: The database port.root_username
: The root username (root or admin usually) in order to create the database and needed privileges.root_password
: The root passwordpma_database
: This is the name of the PMA control database.pma_username
: The PMA control database usernamepma_password
: The PMA control database passwordauth_type
: The authentication method PMA will use
The cookbook installs the selected PMA version to /opt/phpmyadmin (or anywhere else you may have defined in the 'home' attribute) and optionally defines an FPM pool for NGINX or Apache2/mod_fcgid
To define a database config you can use the phpmyadmin_db LWRP such as:
phpmyadmin_db 'Test DB' do
host '127.0.0.1'
port 3306
username 'root'
password 'password'
hide_dbs %w{ information_schema mysql phpmyadmin performance_schema }
end
This will create a file in /opt/phpmyadmin/conf.d/test_db.inc.php and will be automatically included when you display the PMA page.
Copyright 2012 Panagiotis Papadomitsos.
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.