Master config
file_roots:
base:
- /srv/salt/state
pillar_roots:
base:
- /srv/salt/pillar
mysql:
user: salt
pass: salt
db: salt
host: raven.ping.lan
ext_pillar:
- mysql:
fromdb:
query: 'SELECT pillar, value FROM pillar WHERE minion_id = %s'
depth: 2
as_list: True
MySQL schema
CREATE TABLE pillar (
pillar_id INTEGER NOT NULL,
minion_id VARCHAR(30) NOT NULL,
pillar VARCHAR(30) NOT NULL,
value VARCHAR(30) NOT NULL,
CONSTRAINT pk_pillar PRIMARY KEY (pillar_id)
);
MySQL output
mysql> select pillar, value from pillar where minion_id = 'nexus'\G
*************************** 1. row ***************************
pillar: foo
value: bar
1 row in set (0.00 sec)
Salt commands to see ext_pillar information.
salt nexus saltutil.refresh_pillar
salt nexus pillar.data
Hi, I'm trying to use Mysql module but doesn't works.
This is my master configuration:
mysql:
user: "root"
pass: "password"
db: "ADMIN_db"
host: localhost
ext_pillar:
fromdb:
query: 'SELECT * FROM adminApp_m_service'
depth: 2
as_list: True
When I run salt nexus saltutil.refresh_pillar and salt nexus pillar.data, doesn't show anything.
If I run salt-run pillar.show_pillar the next error appears:
[CRITICAL] Specified ext_pillar interface mysql is unavailable
Can you help me please? Where I am wrong?
Thanks!!