Merge pull request #184 from mkotsbak/fix_relative_references

Make formula relative to actual directory by using 'tpldir'
This commit is contained in:
Niels Abspoel 2018-06-18 19:52:22 +02:00 committed by GitHub
commit 25375839d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 35 additions and 35 deletions

View file

@ -1,7 +1,7 @@
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:

View file

@ -1,4 +1,4 @@
{% 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

View file

@ -1,4 +1,4 @@
{% 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 %}

View file

@ -1,4 +1,4 @@
{% 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:

View file

@ -1,4 +1,4 @@
{% 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:

View file

@ -1,5 +1,5 @@
{% 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 %}

View file

@ -1,4 +1,4 @@
{% 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:

View file

@ -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:

View file

@ -1,7 +1,7 @@
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

View file

@ -1,5 +1,5 @@
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') %}

View file

@ -1,8 +1,8 @@
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

View file

@ -1,4 +1,4 @@
{% 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() %}

View file

@ -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