Skip to content
Snippets Groups Projects
Commit 4a8a9bf6 authored by Marius Kotsbak's avatar Marius Kotsbak
Browse files

Make formula relative to actual directory by using 'tpldir'

parent ec3ae803
No related branches found
No related tags found
No related merge requests found
include:
- mysql.config
- .config
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
mysql:
......
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% set os_family = salt['grains.get']('os_family', None) %}
......@@ -18,7 +18,7 @@ mysql_server_config:
file.managed:
- name: {{ mysql.config_directory + mysql.server_config.file }}
- template: jinja
- source: salt://mysql/files/server.cnf
- source: salt://{{ tpldir }}/files/server.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
......@@ -31,7 +31,7 @@ mysql_galera_config:
file.managed:
- name: {{ mysql.config_directory + mysql.galera_config.file }}
- template: jinja
- source: salt://mysql/files/galera.cnf
- source: salt://{{ tpldir }}/files/galera.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
......@@ -44,7 +44,7 @@ mysql_library_config:
file.managed:
- name: {{ mysql.config_directory + mysql.library_config.file }}
- template: jinja
- source: salt://mysql/files/client.cnf
- source: salt://{{ tpldir }}/files/client.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
......@@ -57,7 +57,7 @@ mysql_clients_config:
file.managed:
- name: {{ mysql.config_directory + mysql.clients_config.file }}
- template: jinja
- source: salt://mysql/files/mysql-clients.cnf
- source: salt://{{ tpldir }}/files/mysql-clients.cnf
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
- group: root
......@@ -72,9 +72,9 @@ mysql_config:
- name: {{ mysql.config.file }}
- template: jinja
{% if "config_directory" in mysql %}
- source: salt://mysql/files/my-include.cnf
- source: salt://{{ tpldir }}/files/my-include.cnf
{% else %}
- source: salt://mysql/files/my.cnf
- source: salt://{{ tpldir }}/files/my.cnf
{% endif %}
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
- user: root
......
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% set mysql_root_user = salt['pillar.get']('mysql:server:root_user', 'root') %}
......@@ -10,7 +10,7 @@
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
include:
- mysql.python
- .python
{% for database_obj in salt['pillar.get']('mysql:database', []) %}
{% set state_id = 'mysql_db_' ~ loop.index0 %}
......
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) %}
mysql_dev:
......
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) %}
mysql:
......
{% from 'mysql/database.sls' import db_states with context %}
{% from 'mysql/user.sls' import user_states with context %}
{% from tpldir ~ '/database.sls' import db_states with context %}
{% from tpldir ~ '/user.sls' import user_states with context %}
{% macro requisites(type, states) %}
{%- for state in states %}
......@@ -11,14 +11,14 @@
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', False) %}
include:
- mysql.server
- .server
{% if mysql_salt_user %}
- mysql.salt-user
- .salt-user
{% endif %}
- mysql.database
- mysql.user
- .database
- .user
{% if mysql_dev %}
- mysql.dev
- .dev
{% endif %}
......
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) %}
mysql_python:
......
......@@ -5,7 +5,7 @@
{% set mysql_salt_pass = salt['pillar.get']('mysql:salt_user:salt_user_password', mysql_root_pass) %}
include:
- mysql.python
- .python
mysql remove test database:
mysql_database.absent:
......
include:
- mysql.config
- .config
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
# Completely ignore non-RHEL based systems
......
include:
- mysql.server
- .server
{% set os_family = salt['grains.get']('os_family', None) %}
{% set mysql_salt_user = salt['pillar.get']('mysql:salt_user:salt_user_name', 'salt') %}
......
include:
- mysql.config
- mysql.python
- .config
- .python
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% set os = salt['grains.get']('os', None) %}
......@@ -163,7 +163,7 @@ mysqld:
mysql_additional_config:
file.managed:
- name: /usr/my.cnf
- source: salt://mysql/files/usr-my.cnf
- source: salt://{{ tpldir }}/files/usr-my.cnf
- create: False
- watch_in:
- service: mysqld
{% from "mysql/defaults.yaml" import rawmap with context %}
{% from tpldir ~ "/defaults.yaml" import rawmap with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) %}
{%- 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')) %}
......@@ -10,7 +10,7 @@
{% set user_hosts = [] %}
include:
- mysql.python
- .python
{% for name, user in salt['pillar.get']('mysql:user', {}).items() %}
......
......@@ -58,23 +58,23 @@ mysql:
schema:
foo:
load: True
source: salt://mysql/files/foo.schema
source: salt://{{ tpldir }}/files/foo.schema
bar:
load: False
baz:
load: True
source: salt://mysql/files/baz.schema.tmpl
source: salt://{{ tpldir }}/files/baz.schema.tmpl
template: jinja
qux:
load: True
source: salt://mysql/files/qux.schema.tmpl
source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja
context:
encabulator: Turbo
girdlespring: differential
quux:
load: True
source: salt://mysql/files/qux.schema.tmpl
source: salt://{{ tpldir }}/files/qux.schema.tmpl
template: jinja
context:
encabulator: Retro
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment