Managing SALT configuration via git: Difference between revisions
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category: | [[Category:SaltStack]] | ||
== Configure Salt Master with Git == | == Configure Salt Master with Git == | ||
| Line 19: | Line 19: | ||
- main https://gitlab.com/tst-servers/ahsoka.git: | - main https://gitlab.com/tst-servers/ahsoka.git: | ||
- user: user | - user: user | ||
- password: glpat- | - password: glpat-... | ||
- root: salts/pillar | - root: salts/pillar | ||
| Line 30: | Line 30: | ||
- https://gitlab.com/tst-servers/ahsoka: | - https://gitlab.com/tst-servers/ahsoka: | ||
- user: user | - user: user | ||
- password: glpat- | - password: glpat-... | ||
- root: salts/salt | - root: salts/salt | ||
- name: salt | - name: salt | ||
- https://gitlab.com/tst-servers/ahsoka: | - https://gitlab.com/tst-servers/ahsoka: | ||
- user: user | - user: user | ||
- password: glpat- | - password: glpat-... | ||
- root: salts/reactor | - root: salts/reactor | ||
- name: reactor | - name: reactor | ||
Latest revision as of 15:27, 27 August 2025
Configure Salt Master with Git
This guide demonstrates how to configure a Salt Master to use Git as the source of states, pillars, and reactors.
1. Create Salt Master Git Configuration
Create or edit the config:
/etc/salt/master.d/git.conf
fileserver_backend:
- git
ext_pillar:
- git:
- main https://gitlab.com/tst-servers/ahsoka.git:
- user: user
- password: glpat-...
- root: salts/pillar
gitfs_env_whitelist:
- main
gitfs_provider: pygit2
gitfs_branch: main
gitfs_remotes:
- https://gitlab.com/tst-servers/ahsoka:
- user: user
- password: glpat-...
- root: salts/salt
- name: salt
- https://gitlab.com/tst-servers/ahsoka:
- user: user
- password: glpat-...
- root: salts/reactor
- name: reactor
2. Sync and Update Salt Data from Git
To apply the latest states and pillar data from Git, run:
salt-run fileserver.update
salt-run git_pillar.update
3. Apply States from the Main Branch
Apply all Salt states from the `main` environment:
salt '*' state.apply saltenv=main