]> birchwood-abbey.net Git - Network.git/commitdiff
Install logrotate and its drop-in directory before configuring.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sun, 21 Dec 2025 23:49:28 +0000 (16:49 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sun, 21 Dec 2025 23:49:28 +0000 (16:49 -0700)
README.org
roles_t/abbey-front/tasks/main.yml

index 7bc838ac0d632bee14f8dbe07bc009a2b2e6cc8a..7c91d9ff220a6d4baaabe2c9bcec100d9d84f21c 100644 (file)
@@ -511,19 +511,30 @@ The replacement =logrotate-mailer= does, and includes it in a
   - { regexp: "^\tmail ", line: "\tmail webmaster" }
   - { regexp: "^\tmailfirst", line: "\tmailfirst" }
 
-- name: Configure logrotate.
-  become: yes
-  copy:
-    src: logrotate-mailer.conf
-    dest: /etc/systemd/system/logrotate.service.d/mailer.conf
-  notify: Reload systemd.
-
 - name: Install logrotate mailer.
   become: yes
   copy:
     src: logrotate-mailer
     dest: /usr/local/sbin/logrotate-mailer
     mode: u=rwx,g=rx,o=rx
+
+- name: Install logrotate.
+  become: yes
+  apt: pkg=logrotate
+
+- name: Create logrotate drop-in configuration directory.
+  become: yes
+  file:
+    path: /etc/systemd/system/logrotate.service.d
+    state: directory
+    mode: u=rwx,g=rx,o=rx
+
+- name: Configure logrotate.
+  become: yes
+  copy:
+    src: logrotate-mailer.conf
+    dest: /etc/systemd/system/logrotate.service.d/mailer.conf
+  notify: Reload systemd.
 #+END_SRC
 
 #+CAPTION: [[file:roles_t/abbey-front/handlers/main.yml][=roles_t/abbey-front/handlers/main.yml=]]
index 9b1fe83679ba14498b7aa2da580ccf5cd41cbf89..168b19519b9f23b6c6757a935f8710a4d72e0959 100644 (file)
   - { regexp: "^\tmail ", line: "\tmail webmaster" }
   - { regexp: "^\tmailfirst", line: "\tmailfirst" }
 
-- name: Configure logrotate.
-  become: yes
-  copy:
-    src: logrotate-mailer.conf
-    dest: /etc/systemd/system/logrotate.service.d/mailer.conf
-  notify: Reload systemd.
-
 - name: Install logrotate mailer.
   become: yes
   copy:
     dest: /usr/local/sbin/logrotate-mailer
     mode: u=rwx,g=rx,o=rx
 
+- name: Install logrotate.
+  become: yes
+  apt: pkg=logrotate
+
+- name: Create logrotate drop-in configuration directory.
+  become: yes
+  file:
+    path: /etc/systemd/system/logrotate.service.d
+    state: directory
+    mode: u=rwx,g=rx,o=rx
+
+- name: Configure logrotate.
+  become: yes
+  copy:
+    src: logrotate-mailer.conf
+    dest: /etc/systemd/system/logrotate.service.d/mailer.conf
+  notify: Reload systemd.
+
 - name: Install Certbot for Apache.
   become: yes
   apt: pkg=python3-certbot-apache