Add Salt baseline states for Proxmox Mail Gateway.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ruslan Piatrovich
2026-06-04 11:27:44 +03:00
co-authored by Cursor
parent 35d81332fa
commit 85cecf78f6
23 changed files with 729 additions and 1 deletions
+38
View File
@@ -0,0 +1,38 @@
SHELL := /usr/bin/env bash
.RECIPEPREFIX := >
SALT_CALL ?= salt-call
SALT_LINT ?= salt-lint
YAMLLINT ?= yamllint
STATE_ROOT ?= .
PILLAR_ROOT ?= ./pillar
MINION_ID ?= p-mailgw-x2-01.lmru.tech
.PHONY: lint check apply verify update-check update
lint:
>@if command -v $(SALT_LINT) >/dev/null 2>&1; then \
> $(SALT_LINT) pmg/*.sls pillar/*.sls top.sls; \
>else \
> echo "salt-lint не найден, пропускаю"; \
>fi
>@if command -v $(YAMLLINT) >/dev/null 2>&1; then \
> $(YAMLLINT) .; \
>else \
> echo "yamllint не найден, пропускаю"; \
>fi
check:
>sudo $(SALT_CALL) --local --id $(MINION_ID) --file-root=$(STATE_ROOT) --pillar-root=$(PILLAR_ROOT) state.apply pmg.init test=True
apply:
>sudo $(SALT_CALL) --local --id $(MINION_ID) --file-root=$(STATE_ROOT) --pillar-root=$(PILLAR_ROOT) state.apply pmg.init
verify:
>sudo $(SALT_CALL) --local --id $(MINION_ID) --file-root=$(STATE_ROOT) --pillar-root=$(PILLAR_ROOT) state.apply pmg.verify
update-check:
>sudo $(SALT_CALL) --local --id $(MINION_ID) --file-root=$(STATE_ROOT) --pillar-root=$(PILLAR_ROOT) state.apply pmg.update test=True
update:
>sudo $(SALT_CALL) --local --id $(MINION_ID) --file-root=$(STATE_ROOT) --pillar-root=$(PILLAR_ROOT) state.apply pmg.update