From b6c8119fcae4cda54d1788f76f47dd2c2cf5055b Mon Sep 17 00:00:00 2001 From: Julian Rother Date: Wed, 19 Nov 2025 01:09:41 +0100 Subject: [PATCH] Initial commit --- handlers/main.yml | 4 ++++ tasks/main.yml | 28 ++++++++++++++++++++++++++++ templates/03-local.conf.j2 | 3 +++ 3 files changed, 35 insertions(+) create mode 100644 handlers/main.yml create mode 100644 tasks/main.yml create mode 100644 templates/03-local.conf.j2 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..9ee5d25 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart zoneminder + ansible.builtin.service: + name: zoneminder + state: restarted diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..c79c861 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,28 @@ +- name: install packages + ansible.builtin.apt: + pkg: + - zoneminder + - fcgiwrap + +- name: fix config premissions + ansible.builtin.file: + path: /etc/zm/zm.conf + group: www-data + mode: "0640" + notify: restart zoneminder + +- name: update config + ansible.builtin.template: + src: 03-local.conf.j2 + dest: /etc/zm/conf.d/03-local.conf + owner: root + group: www-data + mode: "0640" + notify: restart zoneminder + +- name: enable zoneminder + ansible.builtin.service: + name: zoneminder + enabled: True + +# TODO: db setup (/usr/share/zoneminder/db/zm_create.sql has hard-coded db name) diff --git a/templates/03-local.conf.j2 b/templates/03-local.conf.j2 new file mode 100644 index 0000000..514929a --- /dev/null +++ b/templates/03-local.conf.j2 @@ -0,0 +1,3 @@ +{% for key, value in zoneminder_config.items() %} +{{ key }}={{ value }} +{% endfor %}