Skip to content

Heimdall #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
- name: Set up Timetagger.
ansible.builtin.import_tasks: tasks/timetagger.yml
when: timetagger_enable

- name: Set up Heimdall.
ansible.builtin.import_tasks: tasks/heimdall.yml
when: heimdall_enable
7 changes: 7 additions & 0 deletions tasks/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@
build: never
state: restarted
become: false

- name: Restart heimdall
community.docker.docker_compose_v2:
project_src: "{{ config_dir }}/heimdall/"
build: never
state: restarted
become: false
21 changes: 21 additions & 0 deletions tasks/heimdall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Ensure Heimdall directory exists.
file:
path: "{{ config_dir }}/heimdall"
state: directory
mode: 0755
become: false

- name: Copy heimdall docker-compose template to Pi.
ansible.builtin.template:
src: templates/heimdall-docker-compose.yml.j2
dest: "{{ config_dir }}/heimdall/docker-compose.yml"
mode: '0640'
become: false
notify: Restart heimdall

- name: Ensure Heimdall is running.
community.docker.docker_compose_v2:
project_src: "{{ config_dir }}/heimdall/"
build: never
become: false
43 changes: 43 additions & 0 deletions templates/heimdall-docker-compose.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# {{ ansible_managed }}
---

# Use the same networks as internet-monitoring.
{# Make sure heimdall and nginx-proxy are in the same network #}
networks:
{% if domain_name_enable and domain_name %}
front-tier:
name: internet-monitoring-front-tier
external: true
{% endif %}

volumes:
heimdall:

services:
heimdall:
image: lscr.io/linuxserver/heimdall:latest
container_name: heimdall
environment:
PUID: 1000
PGID: 1000
TZ: America/Los_Angeles
{% if domain_name_enable and domain_name %}
VIRTUAL_HOST: {{ domain_name }}
VIRTUAL_PORT: 8080
{% if ssl_enable %}
LETSENCRYPT_HOST: {{ domain_name }}
{% endif %}
{% endif %}
volumes:
- heimdall:/config
ports:
- 8080:80
- 8443:443
restart: unless-stopped
{% if domain_name_enable and domain_name %}
networks:
- front-tier
{% endif %}
dns:
- 8.8.8.8
- 8.8.4.4
2 changes: 1 addition & 1 deletion templates/timetagger-docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
restart: unless-stopped
hostname: '{{ timetagger_hostname }}'
ports:
- "8080:8080"
- "8880:8080"
environment:
TIMETAGGER_BIND: 0.0.0.0:8080
TIMETAGGER_DATADIR: /root/_timetagger
Expand Down