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
+31
View File
@@ -0,0 +1,31 @@
{% set pmg_services = salt['pillar.get']('pmg:pmg_services', []) %}
{% set manage_hosts_file = salt['pillar.get']('pmg:manage_hosts_file', False) %}
{% set hosts_file_entries = salt['pillar.get']('pmg:hosts_file_entries', []) %}
{% for svc in pmg_services %}
pmg-service-{{ svc }}:
service.running:
- name: {{ svc }}
- enable: true
{% endfor %}
pmg-cluster-status:
cmd.run:
- name: pmgcm status
{% if manage_hosts_file %}
pmg-managed-hosts:
file.blockreplace:
- name: /etc/hosts
- marker_start: "#-- SALT PMG HOSTS START --"
- marker_end: "#-- SALT PMG HOSTS END --"
- append_if_not_found: true
- content: |
{% for host in hosts_file_entries %}
{% if host.get('aliases', []) %}
{{ host['ip'] }} {{ host['hostname'] }} {{ ' '.join(host['aliases']) }}
{% else %}
{{ host['ip'] }} {{ host['hostname'] }}
{% endif %}
{% endfor %}
{% endif %}