added initial autoconfig state

This commit is contained in:
Paul 2021-03-20 10:41:28 +01:00
parent 99d441b27c
commit 55b82fa72c
5 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<clientConfig version="1.1">
<emailProvider id="paulbsd.com">
<domain>paulbsd.com</domain>
<displayName>Services paulbsd.com</displayName>
<displayShortName>paulbsd.com</displayShortName>
<incomingServer type="imap">
<hostname>imap.paulbsd.com</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<outgoingServer type="smtp">
<hostname>smtp.paulbsd.com</hostname>
<port>465</port>
<socketType>SSL</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
</emailProvider>
</clientConfig>

View File

@ -0,0 +1,4 @@
---
autoconfig:
enabled: true
install_dir: /usr/local/apps

View File

@ -0,0 +1,3 @@
---
include:
- .install

View File

@ -0,0 +1,24 @@
---
{%- from "autoconfig/map.jinja" import autoconfig with context %}
autoconfig-directory:
file.directory:
- name: {{ autoconfig.install_dir }}/autoconfig
- user: root
- group: root
- mode: 0755
autoconfig-maildir:
file.directory:
- name: {{ autoconfig.install_dir }}/autoconfig/mail
- user: root
- group: root
- mode: 0755
autoconfig-file:
file.managed:
- name: {{ autoconfig.install_dir }}/autoconfig/mail/config-v1.1.xml
- source: salt://autoconfig/config-v1.1.xml.j2
- user: root
- group: root
- mode: 0644
- template: jinja

View File

@ -0,0 +1,5 @@
{%- import_yaml "autoconfig/defaults.yaml" as default_settings -%}
{%- set defaults = salt['grains.filter_by'](default_settings, default='autoconfig')-%}
{%- set autoconfig = salt['pillar.get']('autoconfig', default=defaults, merge=True) -%}