This is a part two of my previous blog post AWS Salt Cloud provisioning from Docker. Sometimes it is much easier to store SaltStack states and pillars on GitHub. Also, this is preferred way if you need to provision Salt master on AWS. In this post, I will go through configuration options and describe how to provision Salt master using
salt-cloud and also how to use git fileserver for states and pillars.
Configuring git states and pillars
To configure salt master to use git fileserver you need to add gitfs related properties. Also check your root directories for states and pillars:
- master https://github.com/komljen/rancher-salt
It is still possible to use additional pillars on the host, except those hosted on GitHub. This is useful if you have some sensitive information in pillars like passwords or secret keys which you don’t want to store on GitHub repo:
Provisioning Salt master to use git fileserver
You will need
python-git (Ubuntu) or
GitPython (RHEL/CentOS) package installed before be able to use git fileserver. This is easy to do when using local machine, but to provision a new VM on AWS you need to install that package along with SaltStack. To do that add bootstrap script parameters to ec2 profile:
script_args: -p python-git -q git v2016.3.2
Here is complete ec2 profile file for a reference: ubuntu_ec2.conf
Keep in mind that this is for using public git repository. If you need to use authentication please refer to official docs.
If you encounter any problems during configuration, please leave a comment.