From 7b125c64559b8110ffd1971b7618d7539830b3c8 Mon Sep 17 00:00:00 2001 From: Ali Makki Date: Sun, 1 Jul 2018 21:32:12 -0400 Subject: [PATCH] temp commit --- playbooks/roles/tinyproxy/tasks/main.yml | 10 ---------- playbooks/roles/tinyproxy/templates/tinyproxy.conf.j2 | 2 +- .../roles/tinyproxy/templates/tinyproxy.service.j2 | 4 ++-- .../roles/tinyproxy/templates/tinyproxytmp.conf.j2 | 1 + playbooks/roles/tinyproxy/vars/main.yml | 3 +++ 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/playbooks/roles/tinyproxy/tasks/main.yml b/playbooks/roles/tinyproxy/tasks/main.yml index 07e6c5c44..d532f9b2b 100644 --- a/playbooks/roles/tinyproxy/tasks/main.yml +++ b/playbooks/roles/tinyproxy/tasks/main.yml @@ -3,11 +3,6 @@ apt: name: tinyproxy -- name: Stop (init.d's) tinyproxy - systemd: - name: tinyproxy.service - state: stopped - - name: Create the tinyproxy config directory file: path: "{{ tinyproxy_conf_dir }}" @@ -40,11 +35,6 @@ group: root mode: 0644 -#- name: Clean up the installed-by-default tinyproxy configuration file -# file: -# path: /etc/tinyproxy.conf -# state: absent - - name: Enable and restart the tinyproxy service systemd: daemon_reload: yes diff --git a/playbooks/roles/tinyproxy/templates/tinyproxy.conf.j2 b/playbooks/roles/tinyproxy/templates/tinyproxy.conf.j2 index 4b829a0c7..41c264461 100644 --- a/playbooks/roles/tinyproxy/templates/tinyproxy.conf.j2 +++ b/playbooks/roles/tinyproxy/templates/tinyproxy.conf.j2 @@ -55,7 +55,7 @@ StatFile "/usr/share/tinyproxy/stats.html" # and enable the Syslog directive. These directives are mutually # exclusive. # -Logfile "/var/log/tinyproxy/tinyproxy.log" +# Logfile "{{ tinyproxy_log_file }}" # # LogLevel: diff --git a/playbooks/roles/tinyproxy/templates/tinyproxy.service.j2 b/playbooks/roles/tinyproxy/templates/tinyproxy.service.j2 index 63a799ac3..75289b646 100644 --- a/playbooks/roles/tinyproxy/templates/tinyproxy.service.j2 +++ b/playbooks/roles/tinyproxy/templates/tinyproxy.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=tinyproxy - a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems -After=network-online.target sshd.service +After=network.target sshd.service Documentation=man:tinyproxy(8) Documentation=https://www.banu.com/tinyproxy/ @@ -8,9 +8,9 @@ Documentation=https://www.banu.com/tinyproxy/ Type=forking PIDFile={{ tinyproxy_pid_file }} ExecStart=/usr/sbin/tinyproxy -c {{ tinyproxy_conf_file }} -ExecStop=/usr/bin/killall -9 tinyproxy ExecReload=/bin/kill -HUP $MAINPID PrivateTmp=true +PrivateDevices=yes RestartSec=5s Restart=on-failure diff --git a/playbooks/roles/tinyproxy/templates/tinyproxytmp.conf.j2 b/playbooks/roles/tinyproxy/templates/tinyproxytmp.conf.j2 index df4df4aa5..92205b781 100644 --- a/playbooks/roles/tinyproxy/templates/tinyproxytmp.conf.j2 +++ b/playbooks/roles/tinyproxy/templates/tinyproxytmp.conf.j2 @@ -2,3 +2,4 @@ # tinyproxy to write its PID file # https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html d {{ tinyproxy_pid_dir }} 0755 nobody nogroup - +d {{ tinyproxy_log_dir }} 0755 nobody nogroup - diff --git a/playbooks/roles/tinyproxy/vars/main.yml b/playbooks/roles/tinyproxy/vars/main.yml index 21d667f54..ef4df9142 100644 --- a/playbooks/roles/tinyproxy/vars/main.yml +++ b/playbooks/roles/tinyproxy/vars/main.yml @@ -5,6 +5,9 @@ tinyproxy_port: 8888 tinyproxy_listen_address: "127.0.0.1" tinyproxy_log_level: "Critical" +tinyproxy_log_dir: "/var/log/tinyproxy" +tinyproxy_log_file: "{{ tinyproxy_log_dir }}/tinyproxy.log" + tinyproxy_pid_dir: "/var/run/tinyproxy" tinyproxy_pid_file: "{{ tinyproxy_pid_dir }}/tinyproxy.pid"