2

Here is my /etc/salt/master config:

#GitFS
gitfs_provider: pygit2
gitfs_base: DEVELOPMENT
gitfs_env_whitelist:
  - base

fileserver_backend:
  - git
gitfs_remotes:
  - ssh://git@github.com/myrepo/salt-states.git:
    - pubkey: /root/.ssh/my.pub
    - privkey: /root/.ssh/my
    - mountpoint: salt:///srv/salt/salt-states

Here is my directory structure for the repo:

.
|-- README.md
|-- formulas
|   `-- test
|       |-- test.sls
`-- top.sls

Here is my very basic top.sls:

base:
  '*':
    - test

If i try to run highstate on my test node I get:

root@saltmaster:/etc/salt] salt -v '*' state.highstate
Executing job with jid 1234567890
-------------------------------------------

test-minion.domain:
----------
          ID: states
    Function: no.None
      Result: False
     Comment: No Top file or external nodes data matches found.
     Started:
    Duration:
     Changes:

Summary for test-minion.domain
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
Total run time:   0.000 ms

I'm not sure why this isn't working and would appreciate any help with this. I've tried just applying the test.sls to see if it was the top file that was the issue but I got this:

root@saltmaster:/etc/salt] salt -v '*' state.sls test
Executing job with jid 1234567890
-------------------------------------------

test-minion.domain:
    Data failed to compile:
----------
    No matching sls found for 'test' in env 'base'
Kryten
  • 595
  • 3
  • 10
  • 25
  • 1
    " No matching sls found for 'test' in env 'base'" points to the fact that 'test' is not a state, in the repo structure shown, it is under formulas. To use as in the top file reference, it should be under salt/test.sls. – Efren Jun 03 '16 at 02:28

2 Answers2

2

I had a similar problem, which was due to the cache being out of sync and not updating. If I tried to run:

salt-run fileserver.update

I got:

[WARNING ] Update lock file is present for gitfs remote 'git@github.com:mention-me/Salt.git', skipping. If this warning persists, it is possible that the update process was interrupted, but the lock could also have been manually set. Removing /var/cache/salt/master/gitfs/7d8d9790a933949777fd5a58284b8850/.git/update.lk or running 'salt-run cache.clear_git_lock gitfs type=update' will allow updates to continue for this remote.

Deleting the cache file specified, and running the above command fixed the problem.

edhgoose
  • 887
  • 8
  • 26
1

I talked to the folks on the saltstack IRC and someone helped me fix the problem. It seems that adding a mountpoint was screwing everything up. Credit goes to:

12:20] ==  realname : Thomas Phipps
[12:20] ==  channels : #salt
[12:20] ==  server   : orwell.freenode.net [NL]
[12:20] ==           : is using a secure connection
[12:20] ==  account  : whytewolf
[12:20] == End of WHOIS
Kryten
  • 595
  • 3
  • 10
  • 25
  • 1
    Did removing the mountpoint fix it? I tried removing gitfs config, restart the master and still have the problem. Is it necessary to clear the cache as well as mentioned @edhgoose 's answer? – Efren Jun 01 '16 at 02:53
  • Yes to both questions – Kryten Jun 03 '16 at 18:01
  • Thanks @pullsumo. I was not able to recover the master, probably deleted too many things, so after reinstalling, in version 2015.5.8, the mounting point at least worked, for what is worth. – Efren Jun 06 '16 at 02:17