Integrate SaltStack Appliance with GIT

By | 11. August 2021

vRealize Automation 8.x includes SaltStack Config as configuration management tool. This works with state files that define which configurations will be applied on target system. One of the options to store state files is leveraging a git repository. In this blog I will explain how the SaltStack appliance can be configured to leverage such a repository. It’s important to note that some parts might be different to the native git integration documentation as the appliance uses PhotonOS as underlying system.

Following procedure is required to configure it properly.

Create git repository

To store your state files, you must create a git repository. Best practice is to create a sub folder for your service and store sls files like init.sls in it.

Configure git integration on Salt Master

All following commands must be executed on the salt master (appliance) by an SSH connection.

Install GitPython (in this example GitPython is used)
pip3 install GitPython
Install git client
yum install git
Modify /et/salt/master.d/raas.conf file
# Enable fileserver backends to use eAPI first, then local filesystem

fileserver_backend:
  - sseapi
  - roots
  - gitfs
Create /etc/salt/master.d/fileserver_backend.conf file

Replace <account> by your git account name (e.g. cferber in my case)
Replace <repository.git> by your git repository name (e.g. saltstack.git in my case)

gitfs_provider: gitpython
gitfs_remotes:
  - https://github.com/<account>/<repository.git>:
    - base: main
    - mountpoint: /
Restart salt master
systemctl restart salt-master
Clear Cache
rm -rf /var/cache/salt/master/files
rm -rf /var/cache/salt/master/gitfs
Update file server
salt-run fileserver.update -l info

Test git integration

Verify if git integration works by listing all the files available on the file server. The file server on SaltStack is like a virtual file services that stores files from different sources incl. local and git.

With this command you can scan the files available in file server and check if the one’s from git are listed:

salt-run fileserver.file_list

 

Have fun!

print
Christian Ferber
Latest posts by Christian Ferber (see all)
Category: Cloud Management Uncategorized vRA Tags: ,

About Christian Ferber

Christian ist seit Juli 2015 bei VMware als Senior Systems Engineer für Enterprise Management tätig. Durch die Arbeit in diversen Cloud-Projekten auch in seinen vergangenen Tätigkeiten hat er Erfahrung im Bereich Rechenzentrumsthemen wie Server, Storage, Networking und Cloud-Management aufgebaut. Heute liegt sein Schwerpunkt im Bereich Automatisierung, Betriebsmonitoring bzw. Analyse und Verrechnung. Er betreut die vRealize Produktfamilie für Enterprise-Kunden in Deutschland.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.