From: Matt Birkholz Date: Sun, 21 Dec 2025 23:49:28 +0000 (-0700) Subject: Install logrotate and its drop-in directory before configuring. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7d9031ecd0cf26f2e2bfae169b8ef8a8a9b730ea;p=Network.git Install logrotate and its drop-in directory before configuring. --- diff --git a/README.org b/README.org index 7bc838a..7c91d9f 100644 --- a/README.org +++ b/README.org @@ -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=]] diff --git a/roles_t/abbey-front/tasks/main.yml b/roles_t/abbey-front/tasks/main.yml index 9b1fe83..168b195 100644 --- a/roles_t/abbey-front/tasks/main.yml +++ b/roles_t/abbey-front/tasks/main.yml @@ -139,13 +139,6 @@ - { 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: @@ -153,6 +146,24 @@ 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