Comments (15)
Editing /etc/salt/master
solve this odd issue:
extra_filerefs:
- salt://mysql/defaults.yaml
- salt://mysql/supported_sections.yaml
Maybe documentation could be improved or templating file inclusion avoided in order to prevent future issues to be opened.
If there are no new considerations this issue can be closed. Thanks.
from mysql-formula.
Tried with different salt version without success:
Salt: 2015.5.0
Python: 2.7.9 (default, Apr 2 2015, 15:33:21)
Jinja2: 2.7.3
M2Crypto: Not Installed
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: Not Installed
RAET: Not Installed
ZMQ: Not Installed
Mako: 1.0.0
Debian source package: 2015.5.0+ds-1utopic1
from mysql-formula.
I'll try to take a look at this sometimes this week, @iggy this is similar to the other issue with this same problem, however @ogabrielsantos hasn't tried workarounds so we have a clean slate, any suggestions/insight?
from mysql-formula.
change the file root ?
root_dir: .
file_roots:
base:
- srv/salt/states
- srv/salt/formulas
pillar_roots:
base:
- srv/salt/pillars
from mysql-formula.
@puneetk srv/salt/formulas/mysql-formula refer to a git module clone inside formulas. Changing to srv/salt/formulas will invalidate the formula/state.
├── srv
│ └── salt
│ ├── formulas
│ │ └── mysql-formula
│ │ ├── FORMULA
│ │ ├── import_users.py
│ │ ├── LICENSE
│ │ ├── mysql
│ │ │ ├── client.sls
│ │ │ ├── database.sls
│ │ │ ├── defaults.yaml
│ │ │ ├── dev.sls
│ │ │ ├── disabled.sls
│ │ │ ├── files
│ │ │ │ ├── my.cnf
│ │ │ │ └── usr-my.cnf
│ │ │ ├── init.sls
│ │ │ ├── python.sls
│ │ │ ├── remove_test_database.sls
│ │ │ ├── server.sls
│ │ │ ├── supported_sections.yaml
│ │ │ └── user.sls
│ │ ├── pillar.example
│ │ ├── README.rst
│ │ └── scripts
│ │ └── import_users.py
│ ├── pillars
│ │ ├── database.sls
│ │ └── top.sls
│ └── states
│ └── top.sls
from mysql-formula.
I find it interesting that this issue exists: saltstack/salt#21370. @ogabrielsantos can you spin a VM and install a minion then try from there? So via salt itself, and not salt-ssh?
from mysql-formula.
I'll try as soon as possible @gravyboat
I don't think that this is a issue related to mysql-formula
. Tested a sample state with same error:
etc/salt/master
root_dir: .
file_roots:
base:
- srv/salt/states
srv/salt/states/top.sls
base:
'*':
- sample
srv/salt/states/sample/init.sls
{% from "sample/sample.jinja" import sampledata with context %}
{{ sampledata.file }}:
file.managed:
- source: salt://sample/sample.cnf
- template: jinja
srv/salt/states/sample/sample.cnf
{% from "sample/sample.jinja" import sampledata with context %}
srv/salt/states/sample/sample.jinja
{% load_yaml as rawmap %}
RedHat:
file: /etc/my.cnf
{% endload %}
{% set sampledata = rawmap.get(grains.os_family) %}
from mysql-formula.
@ogabrielsantos Interesting, thanks for testing that. I'm headed out for the evening, let me know what it looks like when you're able to test with the minion.
from mysql-formula.
Currently confirmed that CentOS 6.7 (minion) works fine with a CentOS 7 (master) using both salt and salt-ssh. Maybe it is a Saltstack dependency related issue?
Minion
[root@li1289-145 ~]# salt-minion --versions-report
Salt Version:
Salt: 2015.8.0
Dependency Versions:
Jinja2: unknown
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.5.0
Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: centos 6.7 Final
machine: x86_64
release: 4.1.5-x86_64-linode61
system: CentOS 6.7 Final
Master
[root@li1278-54 sample]# salt-ssh --versions-report
Salt Version:
Salt: 2015.8.0
Dependency Versions:
Jinja2: 2.7.3
M2Crypto: Not Installed
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.7.0
Python: 2.7.5 (default, Jun 24 2015, 00:41:19)
RAET: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: Not Installed
smmap: Not Installed
timelib: Not Installed
System Versions:
dist: centos 7.1.1503 Core
machine: x86_64
release: 4.1.5-x86_64-linode61
system: CentOS Linux 7.1.1503 Core
from mysql-formula.
I've patched this workaround which remove extra_filerefs
and jinja templating file inclusion requirements as per @basepi comment
From f42f48666503a970636fd9c06be5dd350be889c5 Mon Sep 17 00:00:00 2001
From: Gabriel Santos <[email protected]>
Date: Mon, 28 Sep 2015 18:24:42 -0300
Subject: [PATCH] Workaround Jinja extra_filerefs requirement
---
mysql/files/my.cnf | 6 ------
mysql/server.sls | 4 ++++
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/mysql/files/my.cnf b/mysql/files/my.cnf
index 8e97641..5c5b794 100644
--- a/mysql/files/my.cnf
+++ b/mysql/files/my.cnf
@@ -2,12 +2,6 @@
# This config is generated by SALTSTACK
# and all change will be overrided on next salt call
{#-
-===== FETCH DATA =====
--#}
-{%- from "mysql/defaults.yaml" import rawmap with context -%}
-{%- from "mysql/supported_sections.yaml" import supported_sections with context -%}
-{%- set datamap = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) -%}
-{#-
===== COMBINE DATA =====
-#}
{%- set goodParamList = datamap.config.sections -%}
diff --git a/mysql/server.sls b/mysql/server.sls
index 1a28cc6..3624107 100644
--- a/mysql/server.sls
+++ b/mysql/server.sls
@@ -1,4 +1,5 @@
{% from "mysql/defaults.yaml" import rawmap with context %}
+{% from "mysql/supported_sections.yaml" import supported_sections with context %}
{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}
{% set os = salt['grains.get']('os', None) %}
@@ -75,6 +76,9 @@ mysql_config:
- name: {{ mysql.config.file }}
- template: jinja
- source: salt://mysql/files/my.cnf
+ - defaults:
+ supported_sections: supported_sections
+ datamap: {{ salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:server:lookup')) }}
- watch_in:
- service: mysqld
{% if os_family in ['Debian', 'Gentoo', 'RedHat'] %}
--
2.1.4
from mysql-formula.
@ogabrielsantos This only had to be added for salt-ssh though right? Worked fine with the master/minion and masterless?
from mysql-formula.
@gravyboat Yep. Currently only salt-ssh needs the extra_filerefs
. master/minion and masterless works fine without any intervention.
from mysql-formula.
Hmm, this is very interesting. I don't really FEEL like you should have to do that. I'm going to leave this open for right now and comment in the other issue. Stealing your extra_filerefs
content and will attribute to you.
from mysql-formula.
There have been a couple issues in the past about extra_filerefs
in a couple different places. It would be really nice if SaltStack could handle that on it's own, but until then, maybe we should start adding something to the README in all the formulas?
from mysql-formula.
@iggy Yeah that would probably be a good plan until we see what happens with saltstack/salt#21370
from mysql-formula.
Related Issues (20)
- Two databases, two pillar files, one minion HOT 2
- Fix empty values in osfamilymap.yaml
- [BUG] RedHat/CentOS state apply with root password fails HOT 4
- [FEATURE] User access for columns HOT 1
- [BUG] Either don't check for my.cnf rights or remove it if symbolic link HOT 2
- [BUG] GRANT SELECT not working for only 1 user on 2 specific databases. Works on others HOT 4
- Specified SLS 'mysql' in environment 'base' is not available on the salt master
- [BUG] Server is installed when only Client is desired HOT 8
- [BUG] Setting mountpoint breaks tplroot HOT 2
- [BUG] Using mysql:host should not check for package/service
- [BUG] Centos 8 - python client for mysql missing HOT 5
- [BUG] Unable to connect to MySQL using CentOS 8 HOT 2
- Last Update BUG HOT 2
- [FEATURE] Use conf.d folder instead of main cnf file, if available on system
- [BUG] MySQL root password vulnerability and proposed fix HOT 1
- [BUG] root_password not set on debian bullseye HOT 1
- [BUG] mysql.client state does not work out of the box HOT 2
- [FEATURE] Please add support for Jammy HOT 1
- [BUG] Arrays being dumped into config file in invalid form.
- [BUG] inconsistent use of mysql_unix_socket in database.sls and user.sls
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql-formula.