O'Reilly logo

Puppet 3 Cookbook by John Arundel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing MySQL

MySQL is a very widely used database server, and it's fairly certain you'll need to install and configure a MySQL server at some point. This recipe will show you how to do that, as well as how to automatically create databases and users for apps.

How to do it…

Follow these steps to create the example:

  1. Run the following commands:
    ubuntu@cookbook:~/puppet$ mkdir -p modules/mysql/manifests
    ubuntu@cookbook:~/puppet$ mkdir -p modules/mysql/files
    
  2. Create the file modules/mysql/manifests/server.pp with the following contents:
    # Manage MySQL server class mysql::server { $password = 'sekrit' $version = 'mysql-server' package { $version: ensure => installed } service { 'mysql': ensure => running, enable => true, require => Package[$version], } ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required