ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using a Git Repository as a Pillar source in SaltStack

    IT Discussion
    salt saltstack salt pillar gitlab
    1
    1
    2.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ObsolesceO
      Obsolesce
      last edited by Obsolesce

      This is the page that got me up and running using GitLab as my Pillar source in Salt: https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html#module-salt.pillar.git_pillar

      More specifically, this section here: https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html#configuring-git-pillar-for-salt-releases-2015-8-0-and-later

      And finally, this page for using Pillars. Don't use this one for setting it up with GitLab: https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html#pillar-walkthrough

      In my GitLab, it's salt/pillars.

      I added the following to my /etc/salt/master.d/custom.conf file:

      ext_pillar:
        - git:
          - master [email protected]:username/salt.git:
            - root: pillars
            - pubkey: /etc/salt/master.d/ssh-git-ro.pub
            - privkey: /etc/salt/master.d/ssh-git-ro.priv
      

      My salt/pillars/top.sls file:

      {{saltenv}}:
        '*':
          - data
      

      Note that the above top.sls is just a test. It assigns the salt/pillars/data.sls file to all minions.

      My data.sls file only contains the following:

      info: some data
      

      Now you can start using Pillar data in States as shown in that last link, the Walkthrough.

      And for Pillar encryption: https://docs.saltstack.com/en/latest/topics/pillar/#pillar-encryption

      1 Reply Last reply Reply Quote 2
      • 1 / 1
      • First post
        Last post