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
Category: Aria Automation Cloud Management Uncategorized Tags: ,

About Christian Ferber

Christian has joined VMware in July 2015 as Senior Systems Engineer Cloud Management. Through his work in various cloud projects before and at VMware he has gained experience in datacenter, server, storage, networking and cloud management technologies. Today his primary focus is on automation and operation topics with integration into many surrounding solutions like containers, configuration management, directory services and others. He is responsible for the management components in the VMware Cloud Foundation (VCF) product family for enterprise customers in Germany.

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.