mirror of
https://github.com/saltstack-formulas/mysql-formula.git
synced 2025-04-16 09:40:26 +00:00
Make formula relative to actual directory by using 'tpldir'
This commit is contained in:
parent
ec3ae803bf
commit
4a8a9bf69a
13 changed files with 35 additions and 35 deletions
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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') %}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() %}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue