-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #716 from darshitpp/ansible-nas-ispyagentdvr
Support iSpy AgentDVR
- Loading branch information
Showing
10 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,6 +193,10 @@ | |
tags: | ||
- homepage | ||
|
||
- role: ispyagentdvr | ||
tags: | ||
- ispyagentdvr | ||
|
||
- role: jackett | ||
tags: | ||
- jackett | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
ispyagentdvr_enabled: false | ||
ispyagentdvr_available_externally: false | ||
|
||
# directories | ||
ispyagentdvr_config_directory: "{{ docker_home }}/ispyagentdvr/config" | ||
ispyagentdvr_commands_directory: "{{ docker_home }}/ispyagentdvr/commands" | ||
ispyagentdvr_recordings_directory: "{{ downloads_root }}/recordings" | ||
|
||
# uid / gid | ||
ispyagentdvr_user_id: "1000" | ||
ispyagentdvr_group_id: "1000" | ||
|
||
# network | ||
ispyagentdvr_webui_port: "8097" | ||
ispyagentdvr_turn_port: "3478" | ||
ispyagentdvr_agentdvr_host_port: "50000-50010" | ||
|
||
# specs | ||
ispyagentdvr_memory: 1g | ||
|
||
# docker | ||
ispyagentdvr_container_name: ispyagentdvr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# iSpyAgentDVR | ||
|
||
Homepage: <https://www.ispyconnect.com/> | ||
|
||
iSpy - Agent DVR is a video surveillance software. | ||
|
||
## Usage | ||
|
||
Set `ispyagentdvr_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. | ||
|
||
The iSpyAgentDVR UI can be accessed from <http://ansible_nas_host_or_ip:8097>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
ispyagentdvr_enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Stop | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role" | ||
ansible.builtin.include_role: | ||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" | ||
vars: | ||
ispyagentdvr_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get container state | ||
community.docker.docker_container_info: | ||
name: "{{ ispyagentdvr_container_name }}" | ||
register: result | ||
|
||
- name: Check iSpyAgentDVR is running | ||
ansible.builtin.assert: | ||
that: | ||
- result.container['State']['Status'] == "running" | ||
- result.container['State']['Restarting'] == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Try and stop and remove iSpyAgentDVR | ||
community.docker.docker_container: | ||
name: "{{ ispyagentdvr_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check iSpyAgentDVR is stopped | ||
ansible.builtin.assert: | ||
that: | ||
- not result.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
- name: Start iSpyAgentDVR | ||
block: | ||
- name: Create iSpyAgentDVR Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
# mode: 0755 | ||
with_items: | ||
- "{{ ispyagentdvr_config_directory }}" | ||
- "{{ ispyagentdvr_commands_directory }}" | ||
- "{{ ispyagentdvr_recordings_directory }}" | ||
|
||
- name: Create iSpyAgentDVR Docker Container | ||
community.docker.docker_container: | ||
name: "{{ ispyagentdvr_container_name }}" | ||
image: mekayelanik/ispyagentdvr:latest | ||
pull: true | ||
volumes: | ||
- "{{ ispyagentdvr_config_directory }}:/AgentDVR/Media/XML:rw" | ||
- "{{ ispyagentdvr_commands_directory }}:/AgentDVR/Commands:rw" | ||
- "{{ ispyagentdvr_recordings_directory }}:/AgentDVR/Media/WebServerRoot/Media:rw" | ||
ports: | ||
- "{{ ispyagentdvr_webui_port }}:8090" | ||
- "{{ ispyagentdvr_turn_port }}:3478/udp" | ||
- "{{ ispyagentdvr_agentdvr_host_port }}:50000-50010/udp" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
WEBUI_PORT: "{{ ispyagentdvr_webui_port }}" | ||
PUID: "{{ ispyagentdvr_user_id }}" | ||
PGID: "{{ ispyagentdvr_group_id }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ ispyagentdvr_memory }}" | ||
labels: | ||
traefik.enable: "{{ ispyagentdvr_available_externally | string }}" | ||
traefik.http.routers.ispyagentdvr.rule: "Host(`ispyagentdvr.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.ispyagentdvr.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.ispyagentdvr.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.ispyagentdvr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.ispyagentdvr.loadbalancer.server.port: "8097" | ||
homepage.group: Monitoring | ||
homepage.name: iSpy AgentDVR | ||
homepage.icon: ispy.png | ||
homepage.href: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ ispyagentdvr_webui_port }}" | ||
homepage.description: Camera Monitoring software | ||
when: ispyagentdvr_enabled is true | ||
|
||
- name: Stop iSpyAgentDVR | ||
block: | ||
- name: Stop iSpyAgentDVR | ||
community.docker.docker_container: | ||
name: "{{ ispyagentdvr_container_name }}" | ||
state: absent | ||
when: ispyagentdvr_enabled is false |