Git Pillar being used regardless of environment
Description of Issue/Question
Hello,
I'm setting up pillars using git and it seems that the minion is picking up the pillar variable regardless of the environment. The pillar data has been assigned to the dev environment and the data is being applied even in the base environment. It also seems that the using folder structures similar to states is not working for pillars. Is that the case?
Thanks in advance.
Setup
Here is the master configuration related to the pillar:
git_pillar_provider: pygit2
git_pillar_pubkey: <path to id_rsa.pub>
git_pillar_privkey: <path to id_rsa>
# Disable global lock
git_pillar_global_lock: False
ext_pillar:
- git:
- master saltmaster@git-server:/home/saltmaster/git/salt_pillars.git
- dev saltmaster@git-server:/home/saltmaster/git/salt_pillars.git
pillar_opts: False
In the master (base) branch of the repo, the top.sls file is blank. In the dev branch the top.sls file is as follows:
dev:
'test-01-v':
- test_root_pwd
Here's the test_root_pwd.sls file:
#!yaml|gpg
# vim: sts=2 ts=2 sw=2 et ai
password: |
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
Nf57gRpRvZqpnlDNU7wKqYBMlqCMSUUuE5ShuSOTrruToK5Dvl+xJPAJA0zKrrbF
m+7+ZhzUY203Vri1St5/Ial1fM1QwOO2FIxt3bSnbGly8DegdPOkdUshv+lMlUtW
OQsbdrKqvVZYip+ZXsVXVots8LOrJhukk8a9UOFipgKKhI7mVsVo/AFYbEJz5dCv
8R3m0csAdQ===122j
-----END PGP MESSAGE-----
Steps to Reproduce Issue
Running the following commands:
salt 'test*' pillar.items
Or
salt 'test*' pillar.items saltenv=dev
will return:
test-01-v:
----------
password:
<secret pwd>
Versions Report
Salt Master:
Salt Version:
Salt: 2016.11.0
Dependency Versions:
cffi: 0.8.6
cherrypy: Not Installed
dateutil: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: 1.3.8
Jinja2: 2.7.2
libgit2: 0.21.0
libnacl: 1.4.3
M2Crypto: 0.21.1
Mako: 0.8.1
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pygit2: 0.21.4
Python: 2.7.5 (default, Sep 15 2016, 22:37:39)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: 0.6.3
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-327.36.3.el7.x86_64
system: Linux
version: CentOS Linux 7.2.1511 Core
Salt Minion:
Salt Version:
Salt: 2016.11.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: 1.3.8
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: 1.4.3
M2Crypto: Not Installed
Mako: 0.8.1
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Sep 15 2016, 22:37:39)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: 0.6.3
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: centos 7.2.1511 Core
machine: x86_64
release: 3.10.0-327.36.3.el7.x86_64
system: Linux
version: CentOS Linux 7.2.1511 Core
@haeac are you only seeing this behavior when you are attempting to call pillar.items or are you seeing thi sbheavior in other places as well? for example calling state files?
It looks like the ability to run the pillar module with saltenv was added here: #37738 which has not been included in a release. If you add that PR does it work?
Also just to make sure was this working previously before upgrading to 2016.11.0?
@Ch3LL , thanks for the response. This is a new setup so I've not tested it with other builds. I'll have to test and see if the pillar actually works in state files. From the looks of it the PR should resolve my issue. In my mind this ticket can be closed.