Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BronsonQuick committed Sep 2, 2017
0 parents commit af91a4b
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# A MariaDB extension for Chassis
The MariaDB extension automatically sets up your Chassis instance to be able to use MariaDB.

## Activation
Ensure you have a Chassis instance set up locally already.

```
# In your Chassis dir:
git clone --recursive https://github.com/Chassis/MariaDB.git extensions/mariadb
```

Then you'll need to reprovision
```
cd ..
vagrant provision
```

Alternatively you can add the extension to one of your yaml config files. e.g.
```
# Extensions
#
# Install a list of extensions automatically
extensions:
- chassis/mariadb
```

Then you'll need to reprovision

```
cd ..
vagrant provision
```

MariaDB has now been installed inside your Chassis box.
7 changes: 7 additions & 0 deletions chassis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Extension version.
#
# All modern extensions should use 2 here. Version 1 uses a chassis.pp
# instead, which requires a deprecated feature of Puppet.
#
# Values: 2
version: 2
19 changes: 19 additions & 0 deletions modules/mariadb/chassis.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
################################################################################
#
# EXTENSION DEVELOPERS:
#
# chassis.pp is now deprecated with extensions v2. Extensions should instead
# use Puppet modules:
#
# http://docs.chassis.io/en/latest/extend/#extensions-api-v2
#
################################################################################
#
# CHASSIS CORE DEVELOPERS:
#
# This file is required to ensure the `import extensions/*/chassis.pp` doesn't
# fail for fresh checkouts (Puppet requires at least one file).
#
# Do not remove this file!
#
################################################################################
37 changes: 37 additions & 0 deletions modules/mariadb/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class mariadb (
$path = '/vagrant/extensions/mariadb',
) {

apt::source { 'mariadb':
location => 'http://mirror.aarnet.edu.au/pub/MariaDB/repo/10.2/ubuntu',
release => $::lsbdistcodename,
repos => 'main',
key => {
id => '177F4010FE56CA3336300305F1656F24C74CD1D8',
server => 'hkp://keyserver.ubuntu.com:80',
},
include => {
src => false,
deb => true,
},
}
class { '::mysql::server':
package_name => 'mariadb-server',
package_ensure => 'latest',
service_name => 'mysql',
root_password => 'password',
override_options => {
mysqld => {
'log-error' => '/var/log/mysql/mariadb.log',
'pid-file' => '/var/run/mysqld/mysqld.pid',
},
mysqld_safe => {
'log-error' => '/var/log/mysql/mariadb.log',
},
}
}

Apt::Source['mariadb'] ~>
Class['apt::update'] ->
Class['::mysql::server']
}

0 comments on commit af91a4b

Please sign in to comment.