From a645c46070ba0559939a32eb8e0babf42f5175f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Sun, 12 Mar 2017 22:45:18 +0100 Subject: [PATCH 1/3] Update READMe.md with example how to install MySQL Community Server 5.6 on Centos 7.3 This minimal example shows how to install MySQL Community Server 5.6 on Centos 7.3 using Puppet 3.8.7 using hiera. --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/README.md b/README.md index 317ed2979..1fae41c35 100644 --- a/README.md +++ b/README.md @@ -322,6 +322,62 @@ Class['apt::update'] -> Class['::mysql::client'] ``` +### Install MySQL 5.6 server on CentOS + +This minimal example shows how to install MySQL Community Server 5.6 on Centos 7.3 using Puppet 3.8.7 using hiera with puppetlabs-mysql=3.9.0 + +Puppet: + +```puppet + include ::mysql::server + + create_resources(yumrepo, hiera('yumrepo', {})) + + Yumrepo['repo.mysql.com'] -> Anchor['mysql::server::start'] + Yumrepo['repo.mysql.com'] -> Package['mysql_client'] + + create_resources(mysql::db, hiera('mysql::server::db', {})) +``` + +Hiera entry: + +```yaml +--- +# mysql module requies feeding it a bunch of parameters to properly install mysql, and not mariadb +# centos 7.3 +yumrepo: + 'repo.mysql.com': + baseurl: "http://repo.mysql.com/yum/mysql-5.6-community/el/%{::operatingsystemmajrelease}/$basearch/" + descr: 'repo.mysql.com' + enabled: 1 + gpgcheck: true + gpgkey: 'http://repo.mysql.com/RPM-GPG-KEY-mysql' + +mysql::client::package_name: "mysql-community-client" # required for proper mysql installation +mysql::server::package_name: "mysql-community-server" # required for proper mysql installation +mysql::server::package_ensure: 'installed' # do not specify version here, unfortunately yum fails with error that package is already installed +mysql::server::root_password: "change_me_i_am_insecure" +mysql::server::manage_config_file: true +mysql::server::service_name: 'mysqld' # required for puppet module +mysql::server::override_options: + 'mysqld': + 'bind-address': '127.0.0.1' + 'log-error': /var/log/mysqld.log' # required for proper mysql installation + 'mysqld_safe': + 'log-error': '/var/log/mysqld.log' # required for proper mysql installation + +# create database + account with access, passwords are not ecrypted +mysql::server::db: + "dev": + user: "dev" + password: "devpass" + host: "127.0.0.1" + grant: + - "ALL" + +``` + + ## Reference ### Classes From df0a12a85383b6ec9a63f77e00c1ae05bdc1a1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Thu, 6 Jul 2017 16:22:01 +0200 Subject: [PATCH 2/3] Update README.md with suggestions from jbondpdx --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1fae41c35..2d0418d77 100644 --- a/README.md +++ b/README.md @@ -322,11 +322,11 @@ Class['apt::update'] -> Class['::mysql::client'] ``` -### Install MySQL 5.6 server on CentOS +### Install MySQL Community server on CentOS This minimal example shows how to install MySQL Community Server 5.6 on Centos 7.3 using Puppet 3.8.7 using hiera with puppetlabs-mysql=3.9.0 -Puppet: +In Puppet: ```puppet include ::mysql::server @@ -339,12 +339,12 @@ Puppet: create_resources(mysql::db, hiera('mysql::server::db', {})) ``` -Hiera entry: +In Hiera: ```yaml --- -# mysql module requies feeding it a bunch of parameters to properly install mysql, and not mariadb -# centos 7.3 +# mysql module requires feeding it a bunch of parameters to properly install MySQL, instead of MariaDB +# Centos 7.3 yumrepo: 'repo.mysql.com': baseurl: "http://repo.mysql.com/yum/mysql-5.6-community/el/%{::operatingsystemmajrelease}/$basearch/" @@ -353,8 +353,8 @@ yumrepo: gpgcheck: true gpgkey: 'http://repo.mysql.com/RPM-GPG-KEY-mysql' -mysql::client::package_name: "mysql-community-client" # required for proper mysql installation -mysql::server::package_name: "mysql-community-server" # required for proper mysql installation +mysql::client::package_name: "mysql-community-client" # required for proper MySQL installation +mysql::server::package_name: "mysql-community-server" # required for proper MySQL installation mysql::server::package_ensure: 'installed' # do not specify version here, unfortunately yum fails with error that package is already installed mysql::server::root_password: "change_me_i_am_insecure" mysql::server::manage_config_file: true @@ -362,11 +362,11 @@ mysql::server::service_name: 'mysqld' # required for puppet module mysql::server::override_options: 'mysqld': 'bind-address': '127.0.0.1' - 'log-error': /var/log/mysqld.log' # required for proper mysql installation + 'log-error': /var/log/mysqld.log' # required for proper MySQL installation 'mysqld_safe': - 'log-error': '/var/log/mysqld.log' # required for proper mysql installation + 'log-error': '/var/log/mysqld.log' # required for proper MySQL installation -# create database + account with access, passwords are not ecrypted +# create database + account with access, passwords are not encrypted mysql::server::db: "dev": user: "dev" From 777f81f6ae552e4f78811476912ad9f90ab068d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Socho=C5=84?= Date: Thu, 6 Jul 2017 22:25:33 +0200 Subject: [PATCH 3/3] Update README.md about MySQL install, convert specs to list --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d0418d77..3b1d2e35c 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,12 @@ Class['::mysql::client'] ### Install MySQL Community server on CentOS -This minimal example shows how to install MySQL Community Server 5.6 on Centos 7.3 using Puppet 3.8.7 using hiera with puppetlabs-mysql=3.9.0 +You can install MySQL Community Server on CentOS using the mysql module and Hiera. This example was tested with the following versions: + +* MySQL Community Server 5.6 +* Centos 7.3 +* Puppet 3.8.7 using hiera +* puppetlabs-mysql module v3.9.0 In Puppet: