salt-formula-manager/README.md

95 lines
4.9 KiB
Markdown
Raw Permalink Normal View History

2017-07-20 12:07:45 -04:00
# Salt Formula Manager
Tool to automate the downloading of Salt formulas
### Table of Contents
1. [Overview - what you just read...](#overview)
2. [Usage - How to use this thing](#usage)
2017-07-25 10:49:41 -04:00
3. [Configuration - Getting this thing ready to roll](#configuration)
4. [To Do - What needs getting done](#to-do)
5. [License - Licensing information](#license)
6. [Contact - How to contact me](#contact)
2017-07-20 12:07:45 -04:00
## Overview
The goal of this tool is provide a flexible, yet powerful tool to manage Salt formulas. It aims to support many different configurations in an intuitive manner, such as, but not limited to:
* Downloading formulas from multiple sources
* Keeping formula management to one single configuration file
* Avoiding needing to modify the Salt master config file to add new formula sources
Indeed, SaltStack are working on a tool, Salt Package Manager, that aims to do similar things. However, that tool feels a little "hacky", in my opinion, and doesn't use some of the tools that are already available to us, such as git/GitHub, and it requires the use of hosting packages out of a separate repository. Granted, that approach does have its positives, but I felt that I needed something a little lighter than that solution. To each their own :)
## Usage
2017-07-31 13:11:16 -04:00
As it currently stands, you should only need to run a simple `salt-formula-manager.py` in a directory containing your SFM configuration. There are plans to 1) add a "system-wide" or "default" configuration path, so you do not need to be in a specific directory to run this, and 2) to add a `-c /path/to/config.yaml` parameter to override the default path to the configuration file.
2017-07-20 12:07:45 -04:00
## Configuration
2017-07-31 13:11:16 -04:00
Here's an explanation of the current list of configuration parameters...
#### `formulas_url`
Defines the default remote URL to use for Salt formulas. The default here is a common repository (https://github.com/SaltStack-Formulas) that, theoretically, most of your formulas will share.
#### `formulas_dir`
This defines where your formulas are going to be stored. This can be the same directory as your locally-written Salt states, or this can be an entirely separate directory altogether (Note: you WILL need to have permission to write to this directory).
#### `purge_formulas`
If true, SFM will attempt to remove all of the "unmanaged" Salt formulas that are present in the directory defined by `formulas_dir` (noted above).
#### `formulas`
This is just a simple hash/list of formulas to download/manage. Simply giving an array entry (e.g. `- munin` - note there is no colon), or an empty hash (e.g. `- munin: {}`) will let SFM attempt to guess the URL and destination directory.
#### Formula definitions
Each formula listed (as noted above) has specific options that may be set to change the default.
#### `url`
The remote URL to use - theoretically, this should work with SSH URLs if you have permission to clone over SSH, otherwise, HTTPS URLs will work just fine if you have permission to access the repository.
#### `version`
2017-07-31 13:11:16 -04:00
**REQUIRED!** This defines a specific Git TAG to track, if the formula is not on said tag, SFM will attempt to checkout the desired tag.
**Note:** This currently only supports git tags! Future support for using commit hashes and branch names is planned.
2017-07-31 13:11:16 -04:00
#### `name`
This option is not very important - if the URL isn't specified for a formula, then SFM will attempt to guess the formula's repository URL based off of the default repository URL and the name/title of the formula. If the name isn't specified, SFM will use the title of the title of the entry appended with "-formula" as its name. Thus, a name of "munin-form" with the default URL "https://github.com/SaltStack-Formulas" when end up with "https://github.com/SaltStack-Formula/munin-form"
**Note:** I'm debating removing this in a future release, as I don't see the use beyond saving a few characters here and there.
2017-07-20 12:07:45 -04:00
2017-07-25 10:49:41 -04:00
## To Do
What still needs done...
2017-07-28 11:53:40 -04:00
* Creating symlinks from formulas directory to states directory (to avoid having to check/modify the Salt master configuration)
* Check/modify the Salt master's configuration to allow loading of the downloaded formulas
* Logging actions, failures, etc into a log file
2017-07-31 13:12:08 -04:00
* Find some way of properly tracking versions in a logical and flexible mannger
2017-07-28 11:53:40 -04:00
* Tracking a specific commit (maybe?)
* Tracking a tag (maybe?)
2017-07-25 10:49:41 -04:00
* Better configuration management (e.g. maybe using a class to handle configuration, where to put the configuration files, etc)
* Maybe not running a `git pull` on every repo, every time the script is run?
* Managing multiple Salt environments
2017-07-20 12:07:45 -04:00
## License
This program is licensed under the Mozilla Public License, version 2.0 (I'm not a license guru, if this needs to be changed to comply with other licenses, I'll gladly change it)
## Contact
Email me at: brotherballantine@gmail.com
Or you can find me on:
* [Mastodon](https://mastodon.rocks/@brotherballan)
2017-07-31 13:11:16 -04:00
* Wire (@brotherballan)
2017-07-20 12:07:45 -04:00
* [Google+](https://plus.google.com/+GregoryBallantine1)
2016-09-14 14:23:43 -04:00