Skip to content

Commit

Permalink
Introduce standardized mapping files
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Jun 24, 2018
1 parent 2537583 commit 1e826ea
Show file tree
Hide file tree
Showing 19 changed files with 442 additions and 474 deletions.
5 changes: 2 additions & 3 deletions mysql/client.sls
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include:
- .config

{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% from tpldir ~ "/map.jinja" import mysql with context %}
mysql:
pkg.installed:
- name: {{ mysql.client }}
- name: {{ mysql.clientpkg }}
13 changes: 11 additions & 2 deletions mysql/config.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% from tpldir ~ "/map.jinja" import mysql with context %}
{% set os_family = salt['grains.get']('os_family', None) %}
{% if "config_directory" in mysql %}
Expand All @@ -20,6 +19,8 @@ mysql_server_config:
- template: jinja
- source: salt://{{ tpldir }}/files/server.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
Expand All @@ -33,6 +34,8 @@ mysql_galera_config:
- template: jinja
- source: salt://{{ tpldir }}/files/galera.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
Expand All @@ -46,6 +49,8 @@ mysql_library_config:
- template: jinja
- source: salt://{{ tpldir }}/files/client.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
Expand All @@ -59,6 +64,8 @@ mysql_clients_config:
- template: jinja
- source: salt://{{ tpldir }}/files/mysql-clients.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- context:
tpldir: {{ tpldir }}
- user: root
- group: root
- mode: 644
Expand All @@ -76,6 +83,8 @@ mysql_config:
{% else %}
- source: salt://{{ tpldir }}/files/my.cnf
{% endif %}
- context:
tpldir: {{ tpldir }}
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
Expand Down
3 changes: 1 addition & 2 deletions mysql/database.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% from tpldir ~ "/map.jinja" import mysql with context %}
{% set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
{% set mysql_root_pass = salt['pillar.get']('mysql:server:root_password', salt['grains.get']('server_id')) %}
Expand Down
Loading

0 comments on commit 1e826ea

Please sign in to comment.