Updated the Analog configuration.
authorMatt Birkholz <matt@birchwood-abbey.net>
Sun, 23 Nov 2025 19:51:30 +0000 (12:51 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sun, 23 Nov 2025 19:51:30 +0000 (12:51 -0700)
Replaced old settings.  Include OUTFILE: /WWW/campus/analog.html.
Create symlink /WWW/campus/analog/.  Put the DNS cache in
=/Logs/dnscache=, writable only by Monkey.

README.org
roles_t/abbey-core/tasks/main.yml

index 4d25e170fab5710ced849620c77d00858b95ef5c..23d6e8861d2be9519cc089a2d7795d1623547888 100644 (file)
@@ -1488,8 +1488,14 @@ next task configures ~libsensors~ to ignore them.
 
 The abbey's public web site's access and error logs are emailed
 regularly to ~webmaster~, who saves them in =/Logs/apache2-public/=
-and runs ~analog~ to generate =/WWW/campus/analog.html=, available to
-the campus as ~http://www/analog.html~.
+and runs ~analog~ as ~monkey~ to generate =/WWW/campus/analog.html=,
+available to the campus as ~http://www/analog.html~.
+
+: sudo -u monkey analog
+
+The ~analog~ package includes a manual, how-to's and examples in
+=/usr/share/doc/analog/=.  The HTML portions can be viewed on campus
+at ~http://www/doc/analog/~.
 
 #+CAPTION: [[file:roles_t/abbey-core/tasks/main.yml][=roles_t/abbey-core/tasks/main.yml=]]
 #+BEGIN_SRC conf :tangle roles_t/abbey-core/tasks/main.yml
@@ -1498,25 +1504,22 @@ the campus as ~http://www/analog.html~.
   become: yes
   apt: pkg=analog
 
-- name: Configure Analog (removing old /var/log/apache/ LOGFILEs).
-  become: yes
-  lineinfile:
-    path: /etc/analog.cfg
-    regexp: '^LOGFILE /var/log/apache/'
-    state: absent
-
-- name: Configure Analog (adding new configuration lines).
+- name: Configure Analog.
   become: yes
+  vars:
+    dir: /Logs/apache2-public
   lineinfile:
     path: /etc/analog.cfg
-    line: "{{ item }}"
+    regexp: "{{ item.regx }}"
+    line: "{{ item.line }}"
     insertafter: EOF
   loop:
-  - "LOGFILE /Logs/apache2-public/*-access.log.gz"
-  - "ALLCHART OFF"
-  - "DNS WRITE"
-  - "HOSTNAME \"{{ full_name }}\""
-  - "OUTFILE /WWW/campus/analog.html"
+  - { regx: "^LOGFILE ",  line: "LOGFILE {{ dir }}/202?????.log.gz" }
+  - { regx: "^OUTFILE ",  line: "OUTFILE /WWW/campus/analog.html" }
+  - { regx: "HOSTNAME ",  line: "HOSTNAME \"{{ full_name }}\"" }
+  - { regx: "^ALLCHART ", line: "ALLCHART      OFF" }
+  - { regx: "^DNS ",      line: "DNS           WRITE" }
+  - { regx: "^DNSFILE ",  line: "DNSFILE       /Logs/dnscache" }
 
 - name: Create /Logs/.
   become: yes
@@ -1525,6 +1528,14 @@ the campus as ~http://www/analog.html~.
     state: directory
     mode: u=rwx,g=rx,o=rx
 
+- name: Create /Logs/dnscache.
+  become: yes
+  file:
+    path: /Logs/dnscache
+    owner: monkey
+    group: monkey
+    mode: u=rw,g=r,o=r
+
 - name: Create /Logs/apache2-public/.
   become: yes
   file:
@@ -1533,6 +1544,13 @@ the campus as ~http://www/analog.html~.
     owner: monkey
     group: staff
     mode: u=rwx,g=srwx,o=rx
+
+- name: Create /WWW/campus/analog/.
+  become: yes
+  file:
+    state: link
+    path: /WWW/campus/analog
+    src: /usr/share/analog/images
 #+END_SRC
 
 ** Add Monkey to Web Server Group
index 5b602fb2e742bf446dfc838ad27a221c13c6496c..32c7d9611fac79c1e9a3bf70eb28e8c5a3a4d19c 100644 (file)
   become: yes
   apt: pkg=analog
 
-- name: Configure Analog (removing old /var/log/apache/ LOGFILEs).
-  become: yes
-  lineinfile:
-    path: /etc/analog.cfg
-    regexp: '^LOGFILE /var/log/apache/'
-    state: absent
-
-- name: Configure Analog (adding new configuration lines).
+- name: Configure Analog.
   become: yes
+  vars:
+    dir: /Logs/apache2-public
   lineinfile:
     path: /etc/analog.cfg
-    line: "{{ item }}"
+    regexp: "{{ item.regx }}"
+    line: "{{ item.line }}"
     insertafter: EOF
   loop:
-  - "LOGFILE /Logs/apache2-public/*-access.log.gz"
-  - "ALLCHART OFF"
-  - "DNS WRITE"
-  - "HOSTNAME \"{{ full_name }}\""
-  - "OUTFILE /WWW/campus/analog.html"
+  - { regx: "^LOGFILE ",  line: "LOGFILE {{ dir }}/202?????.log.gz" }
+  - { regx: "^OUTFILE ",  line: "OUTFILE /WWW/campus/analog.html" }
+  - { regx: "HOSTNAME ",  line: "HOSTNAME \"{{ full_name }}\"" }
+  - { regx: "^ALLCHART ", line: "ALLCHART      OFF" }
+  - { regx: "^DNS ",      line: "DNS           WRITE" }
+  - { regx: "^DNSFILE ",  line: "DNSFILE       /Logs/dnscache" }
 
 - name: Create /Logs/.
   become: yes
     state: directory
     mode: u=rwx,g=rx,o=rx
 
+- name: Create /Logs/dnscache.
+  become: yes
+  file:
+    path: /Logs/dnscache
+    owner: monkey
+    group: monkey
+    mode: u=rw,g=r,o=r
+
 - name: Create /Logs/apache2-public/.
   become: yes
   file:
     group: staff
     mode: u=rwx,g=srwx,o=rx
 
+- name: Create /WWW/campus/analog/.
+  become: yes
+  file:
+    state: link
+    path: /WWW/campus/analog
+    src: /usr/share/analog/images
+
 - name: Add Monkey to Nextcloud group.
   become: yes
   user: