I have a config.py configuration file in my git repository. It has special configuration settings.
I also have the same file as the salt managed file, which has a production specific configuration.
The configuration directive for this file is as follows:
python_config: file.managed: - name: /opt/github/python_config/config.py - source: salt:
Since /opt/github is a git repository, whenever I try to update this directory, I get an error: "Local changes to python_config / config.py will be overwritten by merge."
Here is what my salt directive for this github repository looks like:
code: git.latest: - name: {{ pillar['git_repo'] }} - rev: {{ pillar['git_rev'] }} - target: {{ pillar['source_path'] }} - force: True - require: - pkg: app-pkgs - file: deploykey - file: publickey - file: ssh_config
This error makes sense - I checked the repository by making changes (through my managed file), so new changes to this dev-specific configuration file cause problems.
How can I make salt perform tasks in a specific order? (e.g. give a git checkout config.py before proceeding with git pull ?)
Alternatively, is there a better way I should manage this prod-vs-dev configuration in salt?
source share