Puppet Forge

PuppetForge 0.4.0

Module puppetlabs/mysql

Module description

This module provides the capability to manage your mysql installation, users, permissions and databases.

This module has evolved and is originally based on work by David Schmitt. If anyone else was involved in the development of this module and wants credit, let Puppetlabs know.

The mysql module is composed of the following

Classes

mysql

Installs the mysql-client package

class { 'mysql': }

mysql::python

Installs mysql bindings for python:

class { 'mysql::python': }

mysql::ruby

Installs mysql bindings for ruby:

class { 'mysql::ruby': }

mysql::server

Installs mysql-server, starts service, sets root_pw, and sets root login information in /etc/.my.cnf and /root/.my.cnf.

class { 'mysql::server': 
  config_hash => { 'root_password' => 'foo' }
}

mysql::db

Creates a database with a user and assign some privileges:

mysql::db { 'mydb':
  user     => 'myuser',
  password => 'mypass',
  host     => 'localhost',
  grant    => ['all'],
}

Providers for database types

database { 'mydb':
  charset => 'latin1',
}

database_user { 'bob@localhost':
  password_hash => mysql_password('foo')
}

database_grant { 'user@localhost/database':
  privileges => ['all'] ,
}

Bugs

Bugs can be reported in the Puppetlabs Redmine project:

http://projects.puppetlabs.com/projects/modules/

Just ensure you raise the bug with the category mysql.

Release notes for version 0.3.0

  • 14218 Query the database for available privileges

  • Add mysql::java class for java connector installation
  • Use correct error log location on different distros
  • Fix set_mysql_rootpw to properly depend on my.cnf

Types

database

Description

Manage databases.

Parameters
name

The name of the database.

Properties
ensure

The basic property that the resource should be in. Valid values are present, absent.

charset

The characterset to use for a database Values can match /^\S+$/.

Providers
default

This is a default provider that does nothing. This allows us to install mysql on the same puppet run where we want to use it.

mysql

Manages MySQL database.

Required binaries: mysql, mysqladmin. Default for kernel == Linux.

database_grant

Description

Manage a database user's rights.

Parameters
name

The primary key: either user@host for global privilges or user@host/database for database specific privileges

Properties
privileges

The privileges the user should have. The possible values are implementation dependent.

Providers
default

Uses mysql as database.

mysql

Uses mysql as database.

Required binaries: mysql, mysqladmin. Default for kernel == Linux.

database_user

Description

Manage a database user. This includes management of users password as well as priveleges

Parameters
name

The name of the user. This uses the ‘username@hostname’ or username@hostname.

Properties
ensure

The basic property that the resource should be in. Valid values are present, absent.

password_hash

The password hash of the user. Use mysql_password() for creating such a hash. Values can match /\w+/.

Providers
default

manage users for a mysql database.

mysql

manage users for a mysql database.

Required binaries: mysql, mysqladmin. Default for kernel == Linux.

Module's releases

Popular Tags

a2dismod a2enmod accelerator access acl activemq agent agnostic alerts aliases amanda amavis amazon amqp analysis and android antivirus apache apache2 apple application applications apt apticron archive asadmin Atlassian augeas auth authconfig authentication authoritative automation availability aws backup backuppc bacula balance bash basic benchmark bigtable bind blog boundary boxcar bprobe bugzilla build bzr c++ ca caching Cacti campfire capistrano cassandra ccollect CentOS cern certificate certificate_authority certificates certs cfn check chrislea ci cirrus clamav cleanup cli client cloud cloud-provisioner cloudformation cloudkick cloudwatch cluster cobbler collectd common compile compiler composite_namevars concat concatenate console control controltier create_resouces cron curl CVS cyber dashboard data database datadog db debian defaults denyhosts deployment desktop developer development device dhcp digest directory distributed dms dns dnsmasq dovecot dpkg dpm duo dynamic dynect ec2 editor elasticsearch email ENC enterprise environment ESN example42 exim experimental ext f5 face facter factor facts fail fail2ban farm fcgi fcron fedora FHS file files fileserver filesystem find firehol firewall flowdock FMRI foo foreman fpm freebsd fsck ftp func function ganglia gcc gconf gearman gearman-job-server gearmand gem generation generic Gentoo gfx git gitolite glassfish Glider gLite glusterfs gnome2 graphics greylisting grid Group groups growl ha hadoop haproxy hardware hbase hdd hdfs headless heartbeat hg hids high-availability hipchat homebew host host-keys hosts HP htdigest htpasswd HTTP httpd https icinga ignore imagemagick imap info information infrastructure initr interface inventory ip6tables iphone iproute ipset iptables ipvs irc irqbalance iscsi jabber java jdk jenkins jenkins-ci Jira joyent jre jsp keepalived kerberos kickstart krb5 kvm kwalify LANANA languages lcg lcgutil ldap library libvirt libzypp limits limits-conf linux lmsensors load load-balancing loadbalancer locale locales lock logging logical_volume logrotate logs logwatch LSB lucid LVM mac mail mailalias maintenance make manager manages_members mariadb master-election mcollective mediawiki memcached message message_bus messaging meta metche metrics mfa middleware mirror mnx mobileconfig module modules mon mongodb monit monitor monitoring Monitoring and Trending mosh motd mount mountpoint mounttab mrepo mta multi multipath multiple sites mumble munin mysql mysql-proxy mysql_proxy mysqlproxy naginator nagios namenode nameserver netinstall network network_config network_interface networking NFS nginx nmap noah node nodejs nosql notification nova nrpe nscd ntp ntpd nullmailer OEL openfire opennebula openssh openssl openstack OpenSUSE openvpn openvz operating operating system operating systems operatingsystem operatingsystems operations opsview orchestration os ossec osx ovh pacemaker package package management packages packaging pagerduty PAM pam_access passenger password pe pear percona performance perl permissions pflogsumm php phpqa phpqatools phpsysinfo phptools physical_volume pick pkgin planet platform pop posix postfix postgres postgresql postmark ppa probe proc processor production-ready profile_d proftpd Programming Languages Proliant prosvc provider provisioner provisioning proxy psumac psumac2012 puppet puppetlabs puppetmaster puppi pure-ftpd pureftpd pushover pwgen PXE python qa queue rabbitmq rack raid rails rbenv redhat redis registry relay replication repo report reporting repositories repository request resolv resolv_conf resolvconf resolver resources rest restart rhel rhel5 rhel6 riemann role route53 RPM rpmbuild RRD rsnapshot RSpec rsync rsyslog rt ruby rubygems rundeck runtime samba satellite scm screen scribe scrumworks search SecretServer security sendmail server service services servlet settings sharding shell shortcut sieve sip sipfoundry sipx sipxecs SMF smokeping smtp snmp snmpd solaris solr sonar spam spamassassin sphinx sphinxsearch splunk sql sqlgrey sqlite ssh sshd ssl stages standard standards statistics stdlib stomp storage storeconfigs subversion subversion-client sudo SuSE SVC svn svnrepo symfony synchronisation sysctl syslog syslog-ng system systems tar tcp test Testing tftp thin thrift thycotic ticketing tidy time timezone tls tmpfs tmpwatch tomcat tomcat6 tool tools tracker" traut Trending tuning tunnel twilio twitter two type ubuntu udp unbound unconfigured untar user users utilities utils validation vcs version vhost vim virtual virtual-environment virtualhost virtualization vm vmtools vmware vmware-tools vmware_tools vnc VOIP volume volume_group voms vpn wars web web servers webapp webapp-config webserver webservers wget wiki win32 windows wordpress x x11 xen xinetd xmpp yast yum zendesk zeromq zones zookeeper zypp zypper