diff --git a/states/maildb/init.sls b/states/maildb/init.sls index f643cc1..e39dc86 100644 --- a/states/maildb/init.sls +++ b/states/maildb/init.sls @@ -1,30 +1,3 @@ --- -{%- from "maildb/map.jinja" import maildb with context %} -maildb-pkg: - pkg.latest: - - pkgs: - - python3 - - python3-psycopg2 - -maildb-user-vmail: - user.present: - - name: vmail - - home: /home/vmail - -maildb-apps-dir: - file.directory: - - name: {{ maildb.appdir }} - - user: vmail - - group: vmail - - mode: "0755" - - makedirs: true - -maildb-script: - file.managed: - - name: {{ maildb.appdir }}/maildb.py - - source: salt://maildb/maildb.py - - user: vmail - - group: vmail - - mode: "0755" - - require: - - file: maildb-apps-dir +include: + - .install diff --git a/states/maildb/install.sls b/states/maildb/install.sls new file mode 100644 index 0000000..c0bf374 --- /dev/null +++ b/states/maildb/install.sls @@ -0,0 +1,30 @@ +--- +{%- from "maildb/map.jinja" import maildb with context %} +maildb-pkg: + pkg.installed: + - pkgs: + - python3 + - python3-psycopg2 + +maildb-user-vmail: + user.present: + - name: vmail + - home: /home/vmail + +maildb-apps-dir: + file.directory: + - name: {{ maildb.appdir }} + - user: vmail + - group: vmail + - mode: "0755" + - makedirs: true + +maildb-script: + file.managed: + - name: {{ maildb.appdir }}/maildb.py + - source: salt://maildb/maildb.py + - user: vmail + - group: vmail + - mode: "0755" + - require: + - file: maildb-apps-dir