'Salt External Pillar Issues

I am trying to configure an external pillar in github, but no matter what I cannot get the minions to successfully read top.sls. Below is my ext_pillar and pillar_roots config:

pillar_roots:
  base:
  - /srv/pillar
fileserver_backend:
  - gitfs
  - roots
gitfs_update_interval: 60
gitfs_base: main
gitfs_remotes:
  - https://gituser:[email protected]/gitaccount/saltstack.git:
    - mountpoint: salt://
ext_pillar:
  - git:
    - main https://gituser:[email protected]/gitaccount/saltpillar.git

I have the following in the root of my saltpillar repo:

top.sls:

base:
  '*':
    - data

data.sls:

info: some test data from remote pillar

Repos are accessible with the URIs provided. When I run salt '*' saltutil.refresh_pillar and then salt '*' pillar.items I get no results. However, I can put top.sls and data.sls directly into /srv/pillar and it works. I put the master in debug mode and don't see any errors running the commands. Any help is appreciated.



Solution 1:[1]

Does the following ext_pillar configuration fix your issue? I'm assuming your top.sls you posted is still in the main branch of your git repo.

ext_pillar:
  - git:
    - main https://gituser:[email protected]/gitaccount/saltpillar.git
      - env: base

Your top.sls must reference your actual branch name or you can add the env option to specify a different name.

https://docs.saltproject.io/en/latest/ref/pillar/all/salt.pillar.git_pillar.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Utah_Dave