]> birchwood-abbey.net Git - Network.git/commitdiff
Fix the editing of /etc/logrotate.d/apache2.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sun, 11 Jan 2026 21:55:09 +0000 (14:55 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sun, 11 Jan 2026 21:55:09 +0000 (14:55 -0700)
README.org
roles_t/abbey-front/tasks/main.yml

index 63bcb5927cd41a724ed7802f53031c3c47670252..28f9af192193f4758cbdcaba003eb7dae5f15d55 100644 (file)
@@ -553,8 +553,10 @@ The replacement =logrotate-mailer= does, and includes it in a
     path: /etc/logrotate.d/apache2
     regexp: "{{ item.regexp }}"
     line: "{{ item.line }}"
+    insertbefore: "^ *}"
   loop:
-  - { regexp: '^ *daily', line: "\tweekly" }
+  - regexp: '^ *(hourly|daily|weekly|monthly|yearly)'
+    line: "\tweekly"
   - { regexp: '^ *rotate', line: "\trotate 2" }
 
 - name: Configure Apache log email.
@@ -563,7 +565,7 @@ The replacement =logrotate-mailer= does, and includes it in a
     path: /etc/logrotate.d/apache2
     regexp: "{{ item.regexp }}"
     line: "{{ item.line }}"
-    insertbefore: " *}"
+    insertbefore: "^ *}"
     firstmatch: yes
   loop:
   - { regexp: "^\tmail ", line: "\tmail webmaster" }
index 2615f655452047cbac0bc7073b8d182ed0546408..1f6674961b3c8c365ed2affe5fffe2ccbae136be 100644 (file)
     path: /etc/logrotate.d/apache2
     regexp: "{{ item.regexp }}"
     line: "{{ item.line }}"
+    insertbefore: "^ *}"
   loop:
-  - { regexp: '^ *daily', line: "\tweekly" }
+  - regexp: '^ *(hourly|daily|weekly|monthly|yearly)'
+    line: "\tweekly"
   - { regexp: '^ *rotate', line: "\trotate 2" }
 
 - name: Configure Apache log email.
     path: /etc/logrotate.d/apache2
     regexp: "{{ item.regexp }}"
     line: "{{ item.line }}"
-    insertbefore: " *}"
+    insertbefore: "^ *}"
     firstmatch: yes
   loop:
   - { regexp: "^\tmail ", line: "\tmail webmaster" }