Saltstack [SOLVED]: Standalone masterless Salt minion won't pick up matching pillar

Saltstack [SOLVED]: Standalone masterless Salt minion won't pick up matching pillar

Home Forums Automation Tools Saltstack Tutorials Saltstack [SOLVED]: Standalone masterless Salt minion won't pick up matching pillar

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #233212

    Cloudy Point
    Keymaster

    QuestionQuestion

    I have a standalone minion installed on the web1 server:

    me@web1:~$ hostname
    web1
    
    me@web1:~$ sudo salt-call network.get_hostname
    local:
        web1
    
    me@web1:~$ cat /etc/salt/minion|egrep -v '^#'|egrep -v '^$'
    file_client: local
    file_roots:
      base:
        - /srv/salt
    pillar_roots:
      base:
        - /srv/pillar
    

    My pillar is set up something like this:

    me@web1:~$ cat /srv/pillar/top.sls
    base:
      '*':
        - db
      'web1':
        - env.production
    
    me@web1:~$ cat /srv/pillar/db.sls
    postgres:
      use_upstream_repo: true
      version: '9.6'
      pkg: 'postgresql-9.6'
      pkg_client: 'postgresql-client-9.6'
    
    me@web1:~$ cat /srv/pillar/env/production.sls
    env: production
    

    But when I use pillar.items, I only see this:

    me@web1:~$ sudo salt-call pillar.items
    local:
        ----------
        postgres:
            ----------
            use_upstream_repo:
                True
            version:
                9.6
            pkg:
                postgresql-9.6
            pkg_client:
                postgresql-client-9.6
    

    The standalone server seems to only be applying pillars in the '*' match-all section, but not the direct-match 'web1' hostname section. What am I doing wrong here?

    #233213

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    the top file matches the minion_id that may be different from the hostname (for instance it may be the FQDN or something manually set by you).

    Can you check the content of /etc/salt/minion_id? That’s the minion_id salt is going to match in the top file

    Source: https://stackoverflow.com/questions/47555520/standalone-masterless-salt-minion-wont-pick-up-matching-pillar
    Author: ProT-0-TypE
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.