Commit db0864c4 authored by Victor Penso's avatar Victor Penso
Browse files

New MariaDB example

parent 31417ead
......@@ -4,5 +4,5 @@ maintainer_email 'vic.penso@gmail.com'
license 'Apache 2.0'
description 'Use generic Chef resources by attributes'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.0'
version '1.2.0'
source_url 'https://github.com/vpenso/chef-base'
......@@ -110,7 +110,7 @@ resource_list.each do |resource|
value = value.join("\n") << "\n"
send(key,value)
when 'notifies','subscribes','template'
when 'notifies','subscribes','template','not_if','only_if'
send(key, *value)
# Ignore the following keys...
......
name 'mariadb'
description 'Install and configure MariaDB'
run_list(
'recipe[base]',
)
default_attributes(
directory: {
'/etc/my.cnf.d': {}
},
file: {
# Use official MariaDB packages from the developers
'/etc/yum.repos.d/mariadb.repo': {
content: '
[mariadb]
name = mariadb
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
'
},
# Basic MariaDB server configuration
'/etc/my.cnf.d/server.cnf': {
content: '
[mysqld]
bind-address=0.0.0.0
',
notifies: [ :restart, 'systemd_unit[mariadb.service]' ]
}
},
package: [ 'MariaDB-server','MariaDB-client' ],
execute: {
'firewall-cmd-add-service-mysql': {
command: '
firewall-cmd --zone=public --add-service=mysql --permanent
firewall-cmd --reload
',
not_if: [ 'firewall-cmd --zone=public --query-service=mysql' ]
}
},
systemd_unit: {
'mariadb.service': { action: [:enable,:start] }
}
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment