-
-
Save cebe/8af5127baf49be0269015f834e4121fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set up mariadb APT repository | |
# mirror taken from https://downloads.mariadb.org/mariadb/repositories/#distro=Debian&distro_release=jessie--jessie&version=10.0&mirror=digitalocean-nyc | |
mariadb_repo: | |
pkgrepo.managed: | |
- humanname: MariaDB Official Debian Repository | |
# grains.lsb_distrib_codename will evaluate to "jessie" on debian 8 | |
- name: deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/{% if 'version' in pillar.mariadb %}{{ pillar.mariadb.version }}{% else %}10.1{% endif %}/debian {{ grains.lsb_distrib_codename }} main | |
- file: /etc/apt/sources.list.d/mariadb.list | |
- keyserver: keyserver.ubuntu.com | |
- keyid: CBCB082A1BB943DB | |
# install mariadb package | |
mariadb_package: | |
pkg.installed: | |
{% if pillar.mariadb.type == 'galera' %} | |
- name: mariadb-galera-server | |
{% elif pillar.mariadb.type == 'server' %} | |
- name: mariadb-server | |
{% else %} | |
{{ salt.test.exception("mariadb type must be either 'galera' or 'server'!") }} | |
{% endif %} | |
- require: | |
- pkgrepo: mariadb_repo | |
# configuration files | |
/etc/mysql/my.cnf: | |
file: | |
- managed | |
- user: root | |
- group: root | |
- mode: 0644 | |
- template: jinja | |
- source: salt://mariadb/{{ pillar.mariadb.type }}/my.cnf | |
- require: | |
- pkg: mariadb_package |
iggy
commented
Jan 9, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment