]> git.ekhem.eu.org Git - turnup.git/commitdiff
Add a script for configuring postfix.
authorJakub Czajka <jakub@ekhem.eu.org>
Wed, 27 Sep 2023 20:56:25 +0000 (22:56 +0200)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
server/postfix.yaml [new file with mode: 0644]

diff --git a/server/postfix.yaml b/server/postfix.yaml
new file mode 100644 (file)
index 0000000..4dbbcc0
--- /dev/null
@@ -0,0 +1,36 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- name: Checkout configuration
+  command: |
+    git --work-tree=/tmp --git-dir=/srv/git/server.git checkout main --force \
+      postfix/*
+  become: yes
+- name: Install postfix
+  package:
+    name:
+      - postfix
+      - postfix-pgsql
+    state: latest
+  become: yes
+- name: Ensure postfix directory structure exists
+  file:
+    path: "/etc/postfix"
+    state: directory
+  become: yes
+- name: Copy to /etc/postfix
+  copy:
+    src: "/tmp/postfix/{{ item }}"
+    dest: "/etc/postfix"
+    remote_src: true
+  become: true
+  with_items:
+    - address_book.cf
+    - domains.cf
+    - main.cf
+    - master.cf
+- name: Restart postfix
+  service:
+    name: postfix
+    state: restarted
+  become: yes