annotate modules/mysql/README.md @ 454:d0e7979c7e8c

Update PHP configs for Ubuntu Mostly fixing some INI naming so that it is consistent between packages and what we write (so we don't end up with mixed/duplicate content)
author IBBoard <dev@ibboard.co.uk>
date Sun, 13 Aug 2023 15:26:37 +0100
parents c6c9a2cfcfbd
children adf6fe9bbc17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
1 # mysql
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
3 #### Table of Contents
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
5 1. [Module Description - What the module does and why it is useful](#module-description)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
6 2. [Setup - The basics of getting started with mysql](#setup)
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 * [Beginning with mysql](#beginning-with-mysql)
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
8 3. [Usage - Configuration options and additional functionality](#usage)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
9 * [Customize server options](#customize-server-options)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
10 * [Create a database](#create-a-database)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
11 * [Customize configuration](#customize-configuration)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
12 * [Work with an existing server](#work-with-an-existing-server)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
13 * [Specify passwords](#specify-passwords)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
14 * [Install Percona server on CentOS](#install-percona-server-on-centos)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
15 * [Install MariaDB on Ubuntu](#install-mariadb-on-ubuntu)
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
16 * [Install Plugins](#install-plugins)
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
17 * [Use Percona XtraBackup](#use-percona-xtrabackup)
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
18 4. [Reference - An under-the-hood peek at what the module is doing and how](REFERENCE.md)
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 5. [Limitations - OS compatibility, etc.](#limitations)
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 6. [Development - Guide for contributing to the module](#development)
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
22 ## Module Description
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 The mysql module installs, configures, and manages the MySQL service.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
26 This module manages both the installation and configuration of MySQL, as well as extending Puppet to allow management of MySQL resources, such as databases, users, and grants.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
28 ## Setup
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
30 ### Beginning with mysql
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
32 To install a server with the default options:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
34 `include mysql::server`.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
36 To customize options, such as the root password or `/etc/my.cnf` settings, you must also pass in an override hash:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
38 ```puppet
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
39 class { 'mysql::server':
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
40 root_password => 'strongpassword',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
41 remove_default_accounts => true,
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
42 restart => true,
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
43 override_options => $override_options,
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
45 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
46
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
47 Nota bene: Configuration changes will only be applied to the running
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
48 MySQL server if you pass true as restart to mysql::server.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
50 See [**Customize Server Options**](#customize-server-options) below for examples of the hash structure for $override_options.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
51
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
52 ## Usage
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
54 All interaction for the server is done via `mysql::server`. To install the client, use `mysql::client`. To install bindings, use `mysql::bindings`.
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
55
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
56 ### Customize server options
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
58 To define server options, structure a hash structure of overrides in `mysql::server`. This hash resembles a hash in the my.cnf file:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
60 ```puppet
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 $override_options = {
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 'section' => {
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
63 'item' => 'thing',
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
64 },
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
66 ```
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
68 For options that you would traditionally represent in this format:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
70 ```ini
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 [section]
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 thing = X
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
73 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
74
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
75 Entries can be created as `thing => true`, `thing => value`, or `thing => ""` in the hash. Alternatively, you can pass an array as `thing => ['value', 'value2']` or list each `thing => value` separately on individual lines.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
77 You can pass a variable in the hash without setting a value for it; the variable would then use MySQL's default settings. To exclude an option from the `my.cnf` file --- for example, when using `override_options` to revert to a default value --- pass `thing => undef`.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
79 If an option needs multiple instances, pass an array. For example,
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
80
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
81 ```puppet
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 $override_options = {
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 'mysqld' => {
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 'replicate-do-db' => ['base1', 'base2'],
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
85 },
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
87 ```
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
89 produces
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
91 ```ini
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
92 [mysqld]
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 replicate-do-db = base1
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 replicate-do-db = base2
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
95 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
96
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
97 To implement version specific parameters, specify the version, such as [mysqld-5.5]. This allows one config for different versions of MySQL.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
98
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
99 If you don’t want to use the default configuration, you can also supply your options to the `$options` parameter instead of `$override_options`.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
100 Please note that `$options` and `$override_options` are mutually exclusive, you can only use one of them.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
101
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
102 ### Create a database
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
103
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
104 To create a database with a user and some assigned privileges:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
105
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
106 ```puppet
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
107 mysql::db { 'mydb':
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
108 user => 'myuser',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
109 password => 'mypass',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
110 host => 'localhost',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
111 grant => ['SELECT', 'UPDATE'],
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
112 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
113 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
114
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
115 To use a different resource name with exported resources:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
117 ```puppet
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
118 @@mysql::db { "mydb_${fqdn}":
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
119 user => 'myuser',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
120 password => 'mypass',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
121 dbname => 'mydb',
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
122 host => ${fqdn},
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
123 grant => ['SELECT', 'UPDATE'],
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
124 tag => $domain,
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
125 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
126 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
127
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
128 Then you can collect it on the remote DB server:
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
129
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
130 ```puppet
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
131 Mysql::Db <<| tag == $domain |>>
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
132 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
133
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
134 If you set the sql parameter to a file when creating a database, the file is imported into the new database.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
135
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
136 For large sql files, increase the `import_timeout` parameter, which defaults to 300 seconds.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
137
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
138 If you have installed the mysql client in a non standard bin/sbin path you can set this with `mysql_exec_path` .
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
139
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
140 ```puppet
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
141 mysql::db { 'mydb':
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
142 user => 'myuser',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
143 password => 'mypass',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
144 host => 'localhost',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
145 grant => ['SELECT', 'UPDATE'],
443
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
146 sql => ['/path/to/sqlfile.gz'],
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
147 import_cat_cmd => 'zcat',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
148 import_timeout => 900,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
149 mysql_exec_path => '/opt/rh/rh-myql57/root/bin',
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
150 }
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
151 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
152
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
153 ### Customize configuration
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
154
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
155 To add custom MySQL configuration, place additional files into `includedir`. This allows you to override settings or add additional ones, which is helpful if you don't use `override_options` in `mysql::server`. The `includedir` location is by default set to `/etc/mysql/conf.d`.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
156
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
157 ### Managing Root Passwords
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
158
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
159 If you want the password managed by puppet for `127.0.0.1` and `::1` as an end user you would need to explicitly manage them with additional manifest entries. For example:
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
160
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
161 ```puppet
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
162 mysql_user { '[root@127.0.0.1]':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
163 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
164 password_hash => mysql::password($mysql::server::root_password),
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
165 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
166
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
167 mysql_user { 'root@::1':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
168 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
169 password_hash => mysql::password($mysql::server::root_password),
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
170 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
171 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
172
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
173 **Note:** This module is not designed to carry out additional DNS and aliasing.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
174
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
175 ### Work with an existing server
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
176
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
177 To instantiate databases and users on an existing MySQL server, you need a `.my.cnf` file in `root`'s home directory. This file must specify the remote server address and credentials. For example:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
178
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
179 ```ini
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
180 [client]
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
181 user=root
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
182 host=localhost
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
183 password=secret
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
184 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
185
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
186 This module uses the `mysqld_version` fact to discover the server version being used. By default, this is set to the output of `mysqld -V`. If you're working with a remote MySQL server, you may need to set a custom fact for `mysqld_version` to ensure correct behaviour.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
187
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
188 When working with a remote server, do *not* use the `mysql::server` class in your Puppet manifests.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
189
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
190 ### Specify passwords
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
191
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
192 In addition to passing passwords as plain text, you can input them as hashes. For example:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
193
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
194 ```puppet
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
195 mysql::db { 'mydb':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
196 user => 'myuser',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
197 password => '*6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
198 host => 'localhost',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
199 grant => ['SELECT', 'UPDATE'],
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
200 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
201 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
202
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
203 If required, the password can also be an empty string to allow connections without an password.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
204
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
205 ### Create login paths
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
206
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
207 This feature works only for the MySQL Community Edition >= 5.6.6.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
208
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
209 A login path is a set of options (host, user, password, port and socket) that specify which MySQL server to connect to and which account to authenticate as. The authentication credentials and the other options are stored in an encrypted login file named .mylogin.cnf typically under the users home directory.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
210
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
211 More information about MySQL login paths: https://dev.mysql.com/doc/refman/8.0/en/mysql-config-editor.html.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
212
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
213 Some example for login paths:
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
214
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
215 ```puppet
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
216 mysql_login_path { 'client':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
217 owner => root,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
218 host => 'localhost',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
219 user => 'root',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
220 password => Sensitive('secure'),
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
221 socket => '/var/run/mysqld/mysqld.sock',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
222 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
223 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
224
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
225 mysql_login_path { 'remote_db':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
226 owner => root,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
227 host => '10.0.0.1',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
228 user => 'network',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
229 password => Sensitive('secure'),
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
230 port => 3306,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
231 ensure => present,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
232 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
233 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
234 See examples/mysql_login_path.pp for further examples.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
235
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
236 ### Install Percona server on CentOS
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
237
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
238 This example shows how to do a minimal installation of a Percona server on a
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
239 CentOS system. This sets up the Percona server, client, and bindings (including Perl and Python bindings). You can customize this usage and update the version as needed.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
240
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
241 This usage has been tested on Puppet 4.4, 5.5 and 6.3.0 / CentOS 7 / Percona Server 5.7.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
242
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
243 **Note:** The installation of the yum repository is not part of this package
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
244 and is here only to show a full example of how you can install.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
245
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
246 ```puppet
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
247 yumrepo { 'percona':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
248 descr => 'CentOS $releasever - Percona',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
249 baseurl => 'http://repo.percona.com/percona/yum/release/$releasever/RPMS/$basearch',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
250 gpgkey => 'https://repo.percona.com/yum/PERCONA-PACKAGING-KEY',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
251 enabled => 1,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
252 gpgcheck => 1,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
253 }
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
254
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
255 class { 'mysql::server':
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
256 package_name => 'Percona-Server-server-57',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
257 service_name => 'mysql',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
258 config_file => '/etc/my.cnf',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
259 includedir => '/etc/my.cnf.d',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
260 root_password => 'PutYourOwnPwdHere',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
261 override_options => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
262 mysqld => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
263 log-error => '/var/log/mysqld.log',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
264 pid-file => '/var/run/mysqld/mysqld.pid',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
265 },
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
266 mysqld_safe => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
267 log-error => '/var/log/mysqld.log',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
268 },
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
269 },
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
270 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
271
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
272 # Note: Installing Percona-Server-server-57 also installs Percona-Server-client-57.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
273 # This shows how to install the Percona MySQL client on its own
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
274 class { 'mysql::client':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
275 package_name => 'Percona-Server-client-57',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
276 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
277
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
278 # These packages are normally installed along with Percona-Server-server-57
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
279 # If you needed to install the bindings, however, you could do so with this code
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
280 class { 'mysql::bindings':
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
281 client_dev_package_name => 'Percona-Server-shared-57',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
282 client_dev => true,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
283 daemon_dev_package_name => 'Percona-Server-devel-57',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
284 daemon_dev => true,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
285 perl_enable => true,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
286 perl_package_name => 'perl-DBD-MySQL',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
287 python_enable => true,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
288 python_package_name => 'MySQL-python',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
289 }
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
290
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
291 # Dependencies definition
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
292 Yumrepo['percona']->
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
293 Class['mysql::server']
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
294
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
295 Yumrepo['percona']->
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
296 Class['mysql::client']
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
297
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
298 Yumrepo['percona']->
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
299 Class['mysql::bindings']
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
300 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
301
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
302 ### Install MariaDB on Ubuntu
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
303
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
304 #### Optional: Install the MariaDB official repo
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
305
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
306 In this example, we'll use the latest stable (currently 10.3) from the official MariaDB repository, not the one from the distro repository. You could instead use the package from the Ubuntu repository. Make sure you use the repository corresponding to the version you want.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
307
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
308 **Note:** `sfo1.mirrors.digitalocean.com` is one of many mirrors available. You can use any official mirror.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
309
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
310 ```puppet
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
311 include apt
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
312
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
313 apt::source { 'mariadb':
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
314 location => 'http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
315 release => $::facts['os']['codename'],
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
316 repos => 'main',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
317 key => {
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
318 id => '177F4010FE56CA3336300305F1656F24C74CD1D8',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
319 server => 'hkp://keyserver.ubuntu.com:80',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
320 },
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
321 include => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
322 src => false,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
323 deb => true,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
324 },
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
325 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
326 ```
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
327
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
328 #### Install the MariaDB server
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
329
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
330 This example shows MariaDB server installation on Ubuntu Xenial. Adjust the version and the parameters of `my.cnf` as needed. All parameters of the `my.cnf` can be defined using the `override_options` parameter.
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
331
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
332 The folders `/var/log/mysql` and `/var/run/mysqld` are created automatically, but if you are using other custom folders, they should exist as prerequisites for this code.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
333
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
334 All the values set here are an example of a working minimal configuration.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
335
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
336 Specify the version of the package you want with the `package_ensure` parameter.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
337
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
338 ```puppet
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
339 class { 'mysql::server':
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
340 package_name => 'mariadb-server',
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
341 package_ensure => '1:10.3.21+maria~xenial',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
342 service_name => 'mysqld',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
343 root_password => 'AVeryStrongPasswordUShouldEncrypt!',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
344 override_options => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
345 mysqld => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
346 'log-error' => '/var/log/mysql/mariadb.log',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
347 'pid-file' => '/var/run/mysqld/mysqld.pid',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
348 },
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
349 mysqld_safe => {
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
350 'log-error' => '/var/log/mysql/mariadb.log',
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
351 },
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
352 },
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
353 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
354
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
355 # Dependency management. Only use that part if you are installing the repository
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
356 # as shown in the Preliminary step of this example.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
357 Apt::Source['mariadb'] ~>
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
358 Class['apt::update'] ->
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
359 Class['mysql::server']
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
360
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
361 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
362
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
363 #### Install the MariaDB client
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
364
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
365 This example shows how to install the MariaDB client and all of the bindings at once. You can do this installation separately from the server installation.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
366
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
367 Specify the version of the package you want with the `package_ensure` parameter.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
368
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
369 ```puppet
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
370 class { 'mysql::client':
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
371 package_name => 'mariadb-client',
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
372 package_ensure => '1:10.3.21+maria~xenial',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
373 bindings_enable => true,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
374 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
375
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
376 # Dependency management. Only use that part if you are installing the repository as shown in the Preliminary step of this example.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
377 Apt::Source['mariadb'] ~>
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
378 Class['apt::update'] ->
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
379 Class['mysql::client']
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
380 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
381
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
382 ### Install MySQL Community server on CentOS
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
383
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
384 You can install MySQL Community Server on CentOS using the mysql module and Hiera. This example was tested with the following versions:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
385
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
386 * MySQL Community Server 5.6
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
387 * Centos 7.3
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
388 * Puppet 3.8.7 using Hiera
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
389 * puppetlabs-mysql module v3.9.0
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
390
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
391 In Puppet:
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
392
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
393 ```puppet
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
394 include mysql::server
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
395
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
396 create_resources(yumrepo, hiera('yumrepo', {}))
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
397
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
398 Yumrepo['repo.mysql.com'] -> Anchor['mysql::server::start']
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
399 Yumrepo['repo.mysql.com'] -> Package['mysql_client']
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
400
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
401 create_resources(mysql::db, hiera('mysql::server::db', {}))
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
402 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
403
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
404 In Hiera:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
405
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
406 ```yaml
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
407 ---
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
408
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
409 # Centos 7.3
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
410 yumrepo:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
411 'repo.mysql.com':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
412 baseurl: "http://repo.mysql.com/yum/mysql-5.6-community/el/%{::operatingsystemmajrelease}/$basearch/"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
413 descr: 'repo.mysql.com'
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
414 enabled: 1
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
415 gpgcheck: true
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
416 gpgkey: 'http://repo.mysql.com/RPM-GPG-KEY-mysql'
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
417
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
418 mysql::client::package_name: "mysql-community-client" # required for proper MySQL installation
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
419 mysql::server::package_name: "mysql-community-server" # required for proper MySQL installation
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
420 mysql::server::package_ensure: 'installed' # do not specify version here, unfortunately yum fails with error that package is already installed
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
421 mysql::server::root_password: "change_me_i_am_insecure"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
422 mysql::server::manage_config_file: true
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
423 mysql::server::service_name: 'mysqld' # required for puppet module
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
424 mysql::server::override_options:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
425 'mysqld':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
426 'bind-address': '127.0.0.1'
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
427 'log-error': '/var/log/mysqld.log' # required for proper MySQL installation
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
428 'mysqld_safe':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
429 'log-error': '/var/log/mysqld.log' # required for proper MySQL installation
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
430
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
431 # create database + account with access, passwords are not encrypted
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
432 mysql::server::db:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
433 "dev":
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
434 user: "dev"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
435 password: "devpass"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
436 host: "127.0.0.1"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
437 grant:
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
438 - "ALL"
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
439
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
440 ```
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
441
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
442 ### Install Plugins
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
443
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
444 Plugins can be installed by using the `mysql_plugin` defined type. See `examples/mysql_plugin.pp` for futher examples.
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
445
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
446 ### Use Percona XtraBackup
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
447
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
448 This example shows how to configure MySQL backups with Percona XtraBackup. This sets up a weekly cronjob to perform a full backup and additional daily cronjobs for incremental backups. Each backup will create a new directory. A cleanup job will automatically remove backups that are older than 15 days.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
449
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
450 ```puppet
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
451 yumrepo { 'percona':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
452 descr => 'CentOS $releasever - Percona',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
453 baseurl => 'http://repo.percona.com/release/$releasever/RPMS/$basearch',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
454 gpgkey => 'https://www.percona.com/downloads/RPM-GPG-KEY-percona https://repo.percona.com/yum/PERCONA-PACKAGING-KEY',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
455 enabled => 1,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
456 gpgcheck => 1,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
457 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
458
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
459 class { 'mysql::server::backup':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
460 backupuser => 'myuser',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
461 backuppassword => 'mypassword',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
462 backupdir => '/tmp/backups',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
463 provider => 'xtrabackup',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
464 backuprotate => 15,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
465 execpath => '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
466 time => ['23', '15'],
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
467 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
468 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
469
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
470 If the daily or weekly backup was successful, then the empty file `/tmp/mysqlbackup_success` is created, which makes it easy to monitor the status of the database backup.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
471
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
472 After two weeks the backup directory should look similar to the example below.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
473
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
474 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
475 /tmp/backups/2019-11-10_full
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
476 /tmp/backups/2019-11-11_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
477 /tmp/backups/2019-11-13_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
478 /tmp/backups/2019-11-13_23-15-02
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
479 /tmp/backups/2019-11-14_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
480 /tmp/backups/2019-11-15_23-15-02
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
481 /tmp/backups/2019-11-16_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
482 /tmp/backups/2019-11-17_full
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
483 /tmp/backups/2019-11-18_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
484 /tmp/backups/2019-11-19_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
485 /tmp/backups/2019-11-20_23-15-02
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
486 /tmp/backups/2019-11-21_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
487 /tmp/backups/2019-11-22_23-15-02
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
488 /tmp/backups/2019-11-23_23-15-01
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
489 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
490
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
491 A drawback of using incremental backups is the need to keep at least 7 days of backups, otherwise the full backups is removed early and consecutive incremental backups will fail. Furthermore an incremental backups becomes obsolete once the required full backup was removed.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
492
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
493 The next example uses XtraBackup with incremental backups disabled. In this case the daily cronjob will always perform a full backup.
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
494
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
495 ```puppet
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
496 class { 'mysql::server::backup':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
497 backupuser => 'myuser',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
498 backuppassword => 'mypassword',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
499 backupdir => '/tmp/backups',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
500 provider => 'xtrabackup',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
501 incremental_backups => false,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
502 backuprotate => 5,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
503 execpath => '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
504 time => ['23', '15'],
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
505 }
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
506 ```
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
507
443
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
508 The next example shows how to use mariabackup (a fork of xtrabackup) as a backup provider.
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
509 Note that on most Linux/BSD distributions, this will require setting `backupmethod_package => 'mariadb-backup'` in the `mysql::server::backup` declaration in order to override the default xtrabackup package (`percona-xtrabackup`).
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
510
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
511 ```puppet
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
512 class { 'mysql::server':
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
513 package_name => 'mariadb-server',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
514 package_ensure => '1:10.3.21+maria~xenial',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
515 service_name => 'mysqld',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
516 root_password => 'AVeryStrongPasswordUShouldEncrypt!',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
517 }
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
518
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
519 class { 'mysql::server::backup':
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
520 backupuser => 'mariabackup',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
521 backuppassword => 'AVeryStrongPasswordUShouldEncrypt!',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
522 provider => 'xtrabackup',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
523 backupmethod => 'mariabackup',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
524 backupmethod_package => 'mariadb-backup',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
525 backupdir => '/tmp/backups',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
526 backuprotate => 15,
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
527 execpath => '/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin',
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
528 time => ['23', '15'],
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
529 }
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
530 ```
c6c9a2cfcfbd Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 389
diff changeset
531
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
532 ## Reference
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
533
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
534 ### Classes
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
535
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
536 #### Public classes
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
537
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
538 * [`mysql::server`](#mysqlserver): Installs and configures MySQL.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
539 * [`mysql::server::backup`](#mysqlserverbackup): Sets up MySQL backups via cron.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
540 * [`mysql::bindings`](#mysqlbindings): Installs various MySQL language bindings.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
541 * [`mysql::client`](#mysqlclient): Installs MySQL client (for non-servers).
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
542
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
543 #### Private classes
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
544
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
545 * `mysql::server::install`: Installs packages.
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
546 * `mysql::server::installdb`: Implements setup of mysqld data directory (e.g. /var/lib/mysql)
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
547 * `mysql::server::config`: Configures MYSQL.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
548 * `mysql::server::service`: Manages service.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
549 * `mysql::server::account_security`: Deletes default MySQL accounts.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
550 * `mysql::server::root_password`: Sets MySQL root password.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
551 * `mysql::server::providers`: Creates users, grants, and databases.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
552 * `mysql::bindings::client_dev`: Installs MySQL client development package.
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
553 * `mysql::bindings::daemon_dev`: Installs MySQL daemon development package.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
554 * `mysql::bindings::java`: Installs Java bindings.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
555 * `mysql::bindings::perl`: Installs Perl bindings.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
556 * `mysql::bindings::php`: Installs PHP bindings.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
557 * `mysql::bindings::python`: Installs Python bindings.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
558 * `mysql::bindings::ruby`: Installs Ruby bindings.
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
559 * `mysql::client::install`: Installs MySQL client.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
560 * `mysql::backup::mysqldump`: Implements mysqldump backups.
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
561 * `mysql::backup::mysqlbackup`: Implements backups with Oracle MySQL Enterprise Backup.
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
562 * `mysql::backup::xtrabackup`: Implements backups with XtraBackup from Percona or Mariabackup.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
563
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
564 ### Parameters
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
565
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
566 #### mysql::server
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
567
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
568 ##### `create_root_user`
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
569
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
570 Whether root user should be created.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
571
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
572 Valid values are `true`, `false`.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
573
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
574 Defaults to `true`.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
575
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
576 This is useful for a cluster setup with Galera. The root user has to be created only once. You can set this parameter true on one node and set it to false on the remaining nodes.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
577
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
578 ##### `create_root_my_cnf`
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
579
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
580 Whether to create `/root/.my.cnf`.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
581
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
582 Valid values are `true`, `false`.
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
583
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
584 Defaults to `true`.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
585
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
586 `create_root_my_cnf` allows creation of `/root/.my.cnf` independently of `create_root_user`. You can use this for a cluster setup with Galera where you want `/root/.my.cnf` to exist on all nodes.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
587
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
588 ##### `root_password`
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
589
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
590 The MySQL root password. Puppet attempts to set the root password and update `/root/.my.cnf` with it.
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
591
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
592 This is required if `create_root_user` or `create_root_my_cnf` are true. If `root_password` is 'UNSET', then `create_root_user` and `create_root_my_cnf` are assumed to be false --- that is, the MySQL root user and `/root/.my.cnf` are not created.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
593
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
594 Password changes are supported; however, the old password must be set in `/root/.my.cnf`. Effectively, Puppet uses the old password, configured in `/root/my.cnf`, to set the new password in MySQL, and then updates `/root/.my.cnf` with the new password.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
595
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
596 ##### `old_root_password`
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
597
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
598 This parameter no longer does anything. It exists only for backwards compatibility. See the `root_password` parameter above for details on changing the root password.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
599
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
600 ##### `create_root_login_file`
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
601
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
602 Whether to create `/root/.mylogin.cnf` when using mysql 5.6.6+.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
603
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
604 Valid values are `true`, `false`.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
605
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
606 Defaults to `false`.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
607
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
608 `create_root_login_file` will put a copy of your existing `.mylogin.cnf` in the `/root/.mylogin.cnf` location.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
609
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
610 When set to 'true', this option also requires the `login_file` option.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
611
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
612 The `login_file` option is required when set to true.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
613
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
614 #### `login_file`
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
615
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
616 Whether to put the `/root/.mylogin.cnf` in place.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
617
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
618 You need to create the `.mylogin.cnf` file with `mysql_config_editor`, this tool comes with mysql 5.6.6+.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
619
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
620 The created .mylogin.cnf needs to be put under files in your module, see example below on how to use this.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
621
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
622 When the `/root/.mylogin.cnf` exists the environment variable `MYSQL_TEST_LOGIN_FILE` will be set.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
623
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
624 This is required if `create_root_user` and `create_root_login_file` are true. If `root_password` is 'UNSET', then `create_root_user` and `create_root_login_file` are assumed to be false --- that is, the MySQL root user and `/root/.mylogin.cnf` are not created.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
625
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
626 ```puppet
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
627 class { 'mysql::server':
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
628 root_password => 'password',
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
629 create_root_my_cnf => false,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
630 create_root_login_file => true,
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
631 login_file => 'puppet:///modules/${module_name}/mylogin.cnf',
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
632 }
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
633 ```
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
634
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
635 ##### `override_options`
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
636
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
637 Specifies override options to pass into MySQL. Structured like a hash in the my.cnf file:
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
638
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
639 ```puppet
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
640 class { 'mysql::server':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
641 root_password => 'password'
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
642 }
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
643
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
644 mysql_plugin { 'auth_pam':
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
645 ensure => present,
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
646 soname => 'auth_pam.so',
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
647 }
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
648
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
649 ```
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
650
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
651 ### Tasks
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
652
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
653 The MySQL module has an example task that allows a user to execute arbitary SQL against a database. Please refer to to the [PE documentation](https://puppet.com/docs/pe/2017.3/orchestrator/running_tasks.html) or [Bolt documentation](https://puppet.com/docs/bolt/latest/bolt.html) on how to execute a task.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
654
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
655 ## Limitations
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
656
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
657 For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-mysql/blob/main/metadata.json)
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
658
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
659 **Note:** The mysqlbackup.sh does not work and is not supported on MySQL 5.7 and greater.
26
58d1818c2ded Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
660
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
661 ## Development
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
662
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
663 We are experimenting with a new tool for running acceptance tests. Its name is [puppet_litmus](https://github.com/puppetlabs/puppet_litmus) this replaces beaker as the test runner. To run the acceptance tests follow the [instructions](https://puppetlabs.github.io/litmus/Running-acceptance-tests.html) from the Litmus documentation.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
664
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
665 Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
666
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
667 We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
668
244
48d3a1948e4d Update MySQL module
IBBoard <dev@ibboard.co.uk>
parents: 26
diff changeset
669 Check out our the complete [module contribution guide](https://puppet.com/docs/puppet/latest/contributing.html).
0
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
670
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
671 ### Authors
956e484adc12 Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
672
389
668df4711671 Update MySQL modules
IBBoard <dev@ibboard.co.uk>
parents: 244
diff changeset
673 This module is based on work by David Schmitt. Thank you to all of our [contributors](https://github.com/puppetlabs/puppetlabs-mysql/graphs/contributors).