forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15a8c7d
commit b7550c9
Showing
9 changed files
with
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -358,6 +358,10 @@ | |
tags: | ||
- sickchill | ||
|
||
- role: silverbullet | ||
tags: | ||
- silverbullet | ||
|
||
- role: sonarr | ||
tags: | ||
- sonarr | ||
|
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,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 |
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: | ||
silverbullet_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: | ||
silverbullet_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 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 |
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 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 |
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,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 |
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,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. |