initial commit

This commit is contained in:
Patrick Neff 2022-01-24 22:13:12 +01:00
commit cd028c53be
4 changed files with 97 additions and 0 deletions

58
files/zoneminder.conf Normal file
View File

@ -0,0 +1,58 @@
# Ansible Managed
server {
# listen [::]:80 accept_filter=httpready; # for FreeBSD
# listen 80 accept_filter=httpready; # for FreeBSD
listen [::]:80;
listen 80;
server_name 10.0.0.69;
# Custom error pages
include h5bp/errors/custom_errors.conf;
# Include the basic h5bp config set
include h5bp/basic.conf;
index index.php;
root /usr/share/zoneminder;
location /cgi-bin {
auth_basic off;
alias /usr/lib/zoneminder/cgi-bin;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location /zm/cache {
auth_basic off;
alias /var/cache/zoneminder/cache;
}
location ~ /zm/api/(css|img|ico) {
auth_basic off;
rewrite ^/zm/api(.+)$ /api/app/webroot/$1 break;
try_files $uri $uri/ =404;
}
location /zm {
auth_basic off;
alias /usr/share/zoneminder/www;
try_files $uri $uri/ /index.php?$args =404;
location /zm/api {
auth_basic off;
rewrite ^/zm/api(.+)$ /zm/api/app/webroot/index.php?p=$1 last;
}
location ~ \.php$ {
auth_basic off;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param HTTP_PROXY "";
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
}

4
handlers/main.yml Normal file
View File

@ -0,0 +1,4 @@
- name: restart zoneminder
ansible.builtin.service:
name: zoneminder
state: restarted

1
meta/main.yml Normal file
View File

@ -0,0 +1 @@
dependencies: ['ansible-role-nginx']

34
tasks/main.yml Normal file
View File

@ -0,0 +1,34 @@
- name: Install dependencies.
ansible.builtin.package:
name:
- apt-transport-https
- gnupg
- php-mysql
- fcgiwrap
- name: Add zoneminder apt gpg key.
ansible.builtin.apt_key:
url: https://zmrepo.zoneminder.com/debian/archive-keyring.gpg
state: present
- name: Add zoneminder apt repository
ansible.builtin.apt_repository:
repo: deb https://zmrepo.zoneminder.com/debian/release-1.36 bullseye/
state: present
update_cache: yes
- name: Install zoneminder.
ansible.builtin.package:
name: zoneminder
- name: Configure zoneminder system paths.
ansible.builtin.lineinfile:
path: /etc/zm/conf.d/01-system-paths.conf
regexp: ^ZM_PATH_ZMS
line: ZM_PATH_ZMS=/cgi-bin/nph-zms
- name: Copy zoneminder nginx config.
ansible.builtin.copy:
src: zoneminder.conf
dest: /etc/nginx/conf.d/zoneminder.conf
notify: reload nginx