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
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:
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
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: