--- /dev/null
+# 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 \
+ nginx/*
+ become: yes
+- name: Install nginx
+ package:
+ name:
+ - nginx
+ state: latest
+ become: yes
+- name: Ensure postfix directory structure exists
+ file:
+ path: "/etc/nginx"
+ state: directory
+ become: yes
+- name: Copy to /etc/nginx
+ copy:
+ src: "/tmp/nginx/{{ item }}"
+ dest: "/etc/nginx"
+ remote_src: true
+ become: true
+ with_items:
+ - mime.types
+ - nginx.conf
+- name: Restart postfix
+ service:
+ name: postfix
+ state: restarted
+ become: yes