mirror of
https://github.com/davestephens/ansible-nas
synced 2024-11-10 06:04:15 +00:00
Add Silverbullet 🗒️
This commit is contained in:
parent
15a8c7d76c
commit
b7550c9bf5
9 changed files with 140 additions and 0 deletions
|
@ -93,6 +93,7 @@ If you have a spare domain name you can configure applications to be accessible
|
|||
* [RSS-Bridge](https://rss-bridge.github.io/rss-bridge/) - The RSS feed for websites missing it
|
||||
* [Sabnzbd](https://sabnzbd.org/) - A powerful usenet downloader that FreeNAS provides
|
||||
* [Sickchill](https://sickchill.github.io/) - for managing TV episodes
|
||||
* [Silverbullet](https://silverbullet.md) - Note-taking application optimized for people with a hacker mindset
|
||||
* [Sonarr](https://sonarr.tv/) - for downloading and managing TV episodes
|
||||
* [Speedtest-Tracker](https://github.com/henrywhitaker3/Speedtest-Tracker) - Continuously track your internet speed
|
||||
* Stats - Monitor and visualise metrics about your NAS and internet connection using Grafana, Prometheus, Telegraf and more.
|
||||
|
|
4
nas.yml
4
nas.yml
|
@ -358,6 +358,10 @@
|
|||
tags:
|
||||
- sickchill
|
||||
|
||||
- role: silverbullet
|
||||
tags:
|
||||
- silverbullet
|
||||
|
||||
- role: sonarr
|
||||
tags:
|
||||
- sonarr
|
||||
|
|
22
roles/silverbullet/defaults/main.yml
Normal file
22
roles/silverbullet/defaults/main.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
silverbullet_enabled: false
|
||||
silverbullet_available_externally: false
|
||||
|
||||
# directories
|
||||
silverbullet_data_directory: "{{ docker_home }}/silverbullet"
|
||||
|
||||
# network
|
||||
silverbullet_port: 3002
|
||||
silverbullet_hostname: silverbullet
|
||||
|
||||
# docker
|
||||
silverbullet_container_name: "silverbullet"
|
||||
silverbullet_image_name: "zefhemel/silverbullet"
|
||||
silverbullet_image_version: "latest"
|
||||
|
||||
# specs
|
||||
silverbullet_memory: 1g
|
||||
|
||||
# config
|
||||
silverbullet_username: admin
|
||||
silverbullet_password: topSecret
|
6
roles/silverbullet/molecule/default/molecule.yml
Normal file
6
roles/silverbullet/molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
provisioner:
|
||||
inventory:
|
||||
group_vars:
|
||||
all:
|
||||
silverbullet_enabled: true
|
10
roles/silverbullet/molecule/default/side_effect.yml
Normal file
10
roles/silverbullet/molecule/default/side_effect.yml
Normal file
|
@ -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:
|
||||
silverbullet_enabled: false
|
18
roles/silverbullet/molecule/default/verify.yml
Normal file
18
roles/silverbullet/molecule/default/verify.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- ansible.builtin.include_vars:
|
||||
file: ../../defaults/main.yml
|
||||
|
||||
- name: Get Silverbullet container state
|
||||
community.docker.docker_container:
|
||||
name: "{{ silverbullet_container_name }}"
|
||||
register: result
|
||||
|
||||
- name: Check if Silverbullet containers are running
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.container['State']['Status'] == "running"
|
||||
- result.container['State']['Restarting'] == false
|
18
roles/silverbullet/molecule/default/verify_stopped.yml
Normal file
18
roles/silverbullet/molecule/default/verify_stopped.yml
Normal file
|
@ -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 Silverbullet
|
||||
community.docker.docker_container:
|
||||
name: "{{ silverbullet_container_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- name: Check if Silverbullet is stopped
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- not result.changed
|
39
roles/silverbullet/tasks/main.yml
Normal file
39
roles/silverbullet/tasks/main.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Start Silverbullet
|
||||
block:
|
||||
- name: Create Silverbullet Directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "{{ silverbullet_data_directory }}"
|
||||
|
||||
- name: silverbullet Docker Container
|
||||
community.docker.docker_container:
|
||||
name: "{{ silverbullet_container_name }}"
|
||||
image: "{{ silverbullet_image_name }}:{{ silverbullet_image_version }}"
|
||||
pull: true
|
||||
ports:
|
||||
- "{{ silverbullet_port }}:3000"
|
||||
volumes:
|
||||
- "{{ silverbullet_data_directory }}:/space"
|
||||
restart_policy: unless-stopped
|
||||
memory: "{{ silverbullet_memory }}"
|
||||
env:
|
||||
SB_USER: "{{ silverbullet_username }}:{{ silverbullet_password }}"
|
||||
labels:
|
||||
traefik.enable: "{{ silverbullet_available_externally | string }}"
|
||||
traefik.http.routers.silverbullet.rule: "Host(`{{ silverbullet_hostname }}.{{ ansible_nas_domain }}`)"
|
||||
traefik.http.routers.silverbullet.tls.certresolver: "letsencrypt"
|
||||
traefik.http.routers.silverbullet.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||
traefik.http.routers.silverbullet.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||
traefik.http.services.silverbullet.loadbalancer.server.port: "3000"
|
||||
when: silverbullet_enabled is true
|
||||
|
||||
- name: Stop silverbullet
|
||||
block:
|
||||
- name: Stop silverbullet
|
||||
community.docker.docker_container:
|
||||
name: "{{ silverbullet_container_name }}"
|
||||
state: absent
|
||||
when: silverbullet_enabled is false
|
22
website/docs/applications/other/silverbullet.md
Normal file
22
website/docs/applications/other/silverbullet.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: "Silverbullet"
|
||||
---
|
||||
|
||||
Homepage: [https://silverbullet.md](https://silverbullet.md)
|
||||
|
||||
SilverBullet is a note-taking application optimized for people with a
|
||||
[hacker mindset](https://en.wikipedia.org/wiki/Hacker). We all take notes.
|
||||
There’s a million note taking applications out there. [Literally](https://www.noteapps.ca/).
|
||||
Wouldn’t it be nice to have one where your notes are _more_ than plain text files?
|
||||
Where your notes essentially become a _database_ that you can query; that you can build custom
|
||||
knowledge applications on top of?
|
||||
|
||||
## Usage
|
||||
|
||||
Set `silverbullet_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.
|
||||
|
||||
The Silverbullet web interface can be found at [http://ansible_nas_host_or_ip:3002](http://ansible_nas_host_or_ip:3002).
|
||||
|
||||
## Additional Configuration
|
||||
|
||||
Set `silverbullet_username` and `silverbullet_password` to customise the login username and password.
|
Loading…
Reference in a new issue