Skip to content

Instantly share code, notes, and snippets.

@justlooks
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justlooks/9655868 to your computer and use it in GitHub Desktop.
Save justlooks/9655868 to your computer and use it in GitHub Desktop.
i already tested state file in gitfs ,it's ok ,but when i try put pillar into gitfs,salt can not find it
here is my master config file
# grep '^[^#]' /etc/salt/master
default_include: master.d/*.conf
interface: 192.168.10.231
file_recv: True
file_roots:
base:
- /srv/salt/
file_ignore_regex:
- '/\.git($|/)'
fileserver_backend:
- roots
- git
gitfs_remotes:
- git+ssh://git@192.168.10.240/mysaltrepo.git
gitfs_root: salt
ext_pillar:
- git: master git@192.168.10.240:salttest.git root=pillar
nodegroups:
group1: 'saltslave,a2'
i put my pillar and new state file into git and commit it (all this file is tested on local filesystem)
# ls
pillar salt
# git add .
# git commit -m "put pillar into git"
# git push origin master
Everything up-to-date
and restart salt master
when run task get error
# salt 'saltslave' state.sls mytest
saltslave:
Data failed to compile:
----------
Rendering SLS "base:mytest" failed: Jinja variable 'dict' object has no attribute 'info'; line 6
---
/tmp/mytest.sh:
file.managed:
- source: salt://mytest/mytest.sh
- template: jinja
- defaults:
info: {{pillar['info']}} <======================
---
[ERROR ] Failed to load ext_pillar git: too many values to unpack
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/pillar/__init__.py", line 463, in ext_pillar
ext = self.ext_pillars[key](self.opts['id'], pillar, val)
File "/usr/lib/python2.6/site-packages/salt/pillar/git_pillar.py", line 208, in ext_pillar
branch, repo_location = repo_string.strip().split()
ValueError: too many values to unpack
is the git url error in ext_pillar ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment