forked from davestephens/ansible-nas
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #115 from anarion80/add_obsidian
✨ Add Obsidian
- Loading branch information
Showing
11 changed files
with
178 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 |
---|---|---|
|
@@ -494,6 +494,10 @@ | |
tags: | ||
- nzbhydra2 | ||
|
||
- role: obsidian | ||
tags: | ||
- obsidian | ||
|
||
- role: octoprint | ||
tags: | ||
- octoprint | ||
|
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,52 @@ | ||
--- | ||
obsidian_enabled: false | ||
obsidian_available_externally: false | ||
|
||
# directories | ||
obsidian_data_directory: "{{ docker_home }}/obsidian" | ||
|
||
# network | ||
obsidian_port_http: "8132" | ||
obsidian_port_https: "8133" | ||
obsidian_hostname: "obsidian" | ||
|
||
# specs | ||
obsidian_memory: 1g | ||
|
||
# docker | ||
obsidian_container_name: obsidian | ||
obsidian_image_name: "lscr.io/linuxserver/obsidian" | ||
obsidian_image_version: latest | ||
obsidian_user_id: "1000" | ||
obsidian_group_id: "1000" | ||
|
||
# obsidian | ||
obsidian_custom_port: "3000" | ||
obsidian_custom_https_port: "3001" | ||
obsidian_custom_user: "abc" | ||
obsidian_password: "abc" | ||
obsidian_subfolder: "/subfolder/" | ||
obsidian_title: "Obsidian" | ||
obsidian_fm_home: "/config" | ||
obsidian_start_docker: "false" | ||
obsidian_drinode: "/dev/dri/renderD128" | ||
obsidian_lc_all: "en_US.UTF-8" | ||
obsidian_no_decor: "false" | ||
obsidian_no_full: "true" | ||
|
||
obsidian_env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
PUID: "{{ obsidian_user_id }}" | ||
PGID: "{{ obsidian_group_id }}" | ||
CUSTOM_PORT: "{{ obsidian_custom_port }}" | ||
CUSTOM_HTTPS_PORT: "{{ obsidian_custom_https_port }}" | ||
CUSTOM_USER: "{{ obsidian_custom_user }}" | ||
PASSWORD: "{{ obsidian_password }}" | ||
# SUBFOLDER: "{{ obsidian_subfolder }}" | ||
TITLE: "{{ obsidian_title }}" | ||
FM_HOME: "{{ obsidian_fm_home }}" | ||
START_DOCKER: "{{ obsidian_start_docker }}" | ||
# DRINODE: "{{ obsidian_drinode }}" | ||
LC_ALL: "{{ obsidian_lc_all }}" | ||
NO_DECOR: "{{ obsidian_no_decor }}" | ||
NO_FULL: "{{ obsidian_no_full }}" |
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 @@ | ||
# Obsidian | ||
|
||
Homepage: [https://obsidian.md/](https://obsidian.md/) | ||
|
||
Obsidian is a note-taking app that lets you create, link, and organize your notes on your device, with hundreds of plugins and themes to customize your workflow. You can also publish your notes online, access them offline, and sync them securely with end-to-end encryption. | ||
|
||
## Usage | ||
|
||
Set `obsidian_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
Obsidian web interface can be found at [http://ansible_nas_host_or_ip:8132](http://ansible_nas_host_or_ip:8132). |
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: | ||
obsidian_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: | ||
obsidian_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,19 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get obsidian container state | ||
community.docker.docker_container: | ||
name: "{{ obsidian_container_name }}" | ||
register: result | ||
|
||
- name: Check if obsidian 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,19 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Try and stop and remove obsidian | ||
community.docker.docker_container: | ||
name: "{{ obsidian_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check if obsidian 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 @@ | ||
../../requirements.yml |
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,42 @@ | ||
--- | ||
- name: Start Obsidian | ||
block: | ||
- name: Create obsidian Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ obsidian_data_directory }}" | ||
|
||
- name: Create Obsidian Docker Container | ||
community.docker.docker_container: | ||
container_default_behavior: no_defaults | ||
name: "{{ obsidian_container_name }}" | ||
image: "{{ obsidian_image_name }}:{{ obsidian_image_version }}" | ||
pull: true | ||
volumes: | ||
- "{{ obsidian_data_directory }}/config:/config:rw" | ||
ports: | ||
- "{{ obsidian_port_http }}:3000" | ||
- "{{ obsidian_port_https }}:3001" | ||
env: "{{ obsidian_env }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ obsidian_memory }}" | ||
security_opts: | ||
- seccomp:unconfined | ||
labels: | ||
traefik.enable: "{{ obsidian_available_externally | string }}" | ||
traefik.http.routers.obsidian.rule: "Host(`{{ obsidian_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.obsidian.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.obsidian.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.obsidian.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.obsidian.loadbalancer.server.port: "3000" | ||
when: obsidian_enabled is true | ||
|
||
- name: Stop Obsidian | ||
block: | ||
- name: Stop Obsidian | ||
community.docker.docker_container: | ||
name: "{{ obsidian_container_name }}" | ||
state: absent | ||
when: obsidian_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,13 @@ | ||
--- | ||
title: "Obsidian" | ||
description: "Obsidian is the private and flexible writing app that adapts to the way you think." | ||
--- | ||
Homepage: [https://obsidian.md/](https://obsidian.md/) | ||
|
||
Obsidian is a note-taking app that lets you create, link, and organize your notes on your device, with hundreds of plugins and themes to customize your workflow. You can also publish your notes online, access them offline, and sync them securely with end-to-end encryption. | ||
|
||
## Usage | ||
|
||
Set `obsidian_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
Obsidian web interface can be found at [http://ansible_nas_host_or_ip:8132](http://ansible_nas_host_or_ip:8132). |