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.
- Loading branch information
Showing
10 changed files
with
541 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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
standardnotes_enabled: false | ||
standardnotes_available_externally: false | ||
standardnotes_app_client_enabled: false | ||
standardnotes_enable_subscription: false | ||
|
||
# directories | ||
standardnotes_data_directory: "{{ docker_home }}/standardnotes" | ||
|
||
# network | ||
standardnotes_port: "3011" | ||
standardnotes_files_port: "3013" | ||
standardnotes_app_port: "8128" | ||
standardnotes_app_hostname: "standardnotes" | ||
standardnotes_server_hostname: "standardnotes-server" | ||
standardnotes_files_hostname: "standardnotes-files" | ||
standardnotes_network_name: "standardnotes" | ||
|
||
# specs | ||
standardnotes_memory: 1g | ||
standardnotes_localstack_memory: 1g | ||
standardnotes_db_memory: 1g | ||
standardnotes_redis_memory: 1g | ||
standardnotes_app_memory: 4g | ||
|
||
# docker | ||
standardnotes_container_name: standardnotes | ||
standardnotes_image_name: "standardnotes/server" | ||
standardnotes_image_version: latest | ||
|
||
standardnotes_app_container_name: standardnotes-app | ||
standardnotes_app_image_name: "ghcr.io/jackyzy823/standardnotes-web" | ||
standardnotes_app_image_version: latest | ||
|
||
standardnotes_localstack_container_name: standardnotes-localstack | ||
standardnotes_localstack_image_name: "localstack/localstack" | ||
standardnotes_localstack_image_version: "1.4" | ||
|
||
standardnotes_db_container_name: standardnotes-db | ||
standardnotes_db_image_name: "mysql" | ||
standardnotes_db_image_version: "8" | ||
|
||
standardnotes_redis_container_name: standardnotes-redis | ||
standardnotes_redis_image_name: "redis" | ||
standardnotes_redis_image_version: "6.0-alpine" | ||
standardnotes_user_id: "1000" | ||
standardnotes_group_id: "1000" | ||
|
||
# standardnotes | ||
standardnotes_db_database: "standardnotes" | ||
standardnotes_db_user: "standardnotes" | ||
standardnotes_db_root_password: "supersecure" | ||
standardnotes_db_password: "changeme" | ||
standardnotes_db_host: "{{ standardnotes_db_container_name }}" | ||
standardnotes_db_port: "3306" | ||
standardnotes_db_type: "mysql" | ||
standardnotes_db_charset: "utf8mb4" | ||
standardnotes_db_lang: "C.UTF-8" | ||
|
||
######### | ||
# CACHE # | ||
######### | ||
|
||
standardnotes_redis_port: "6379" | ||
standardnotes_redis_host: "{{ standardnotes_redis_container_name }}" | ||
standardnotes_cache_type: "redis" | ||
|
||
######## | ||
# KEYS # | ||
######## | ||
|
||
standardnotes_jwt_secret: "change_me1" | ||
standardnotes_encryption_server_key: "change_me2" | ||
standardnotes_valet_token_secret: "change_me3" | ||
|
||
####### | ||
# APP # | ||
####### | ||
standardnotes_sf_default_server: "https://{{ standardnotes_server_hostname }}.{{ ansible_nas_domain }}" | ||
standardnotes_app_env_port: "3001" | ||
standardnotes_app_host: "https://{{ standardnotes_app_hostname }}.{{ ansible_nas_domain }}" | ||
# Subscription related endpoints | ||
standardnotes_app_dashboard_url: "http://standardnotes.com/dashboard" | ||
standardnotes_app_plans_url: "https://standardnotes.com/plans" | ||
standardnotes_app_purchase_url: "https://standardnotes.com/purchase" | ||
|
||
standardnotes_subscription_email: "" | ||
standardnotes_public_files_server_url: "https://{{ standardnotes_files_hostname }}.{{ ansible_nas_domain }}" |
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,15 @@ | ||
# Standard Notes | ||
|
||
Homepage: <https://standardnotes.com/> | ||
|
||
Standard Notes is a free, secure note-taking app with powerful end-to-end encryption, unparalleled privacy features, and seamless cross-platform syncing on unlimited devices. | ||
|
||
## Usage | ||
|
||
Set `standardnotes_enabled: true` in your `inventories/<your_inventory>/nas.yml` file to install Standard Notes sync server. | ||
|
||
Standard Notes sync server interface can be then found at <http://ansible_nas_host_or_ip:3011>. | ||
|
||
Optionally, set `standardnotes_app_client_enabled: true` to install Standard Notes Client Web App. | ||
|
||
After server installation and creating of admin user, set `standardnotes_subscription_email` to the admin user email, set `standardnotes_enable_subscription: true` and re-run the playbook to enable subscription features. |
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,7 @@ | ||
--- | ||
provisioner: | ||
inventory: | ||
group_vars: | ||
all: | ||
standardnotes_enabled: true | ||
standardnotes_app_client_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: | ||
standardnotes_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,47 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Include vars | ||
ansible.builtin.include_vars: | ||
file: ../../defaults/main.yml | ||
|
||
- name: Get standardnotes localstack container state | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_localstack_container_name }}" | ||
register: result_localstack | ||
|
||
- name: Get standardnotes db container state | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_db_container_name }}" | ||
register: result_db | ||
|
||
- name: Get standardnotes redis container state | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_redis_container_name }}" | ||
register: result_redis | ||
|
||
- name: Get standardnotes container state | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_container_name }}" | ||
register: result | ||
|
||
- name: Get standardnotes web app container state | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_app_container_name }}" | ||
register: result_app | ||
|
||
- name: Check if standardnotes containers are running | ||
ansible.builtin.assert: | ||
that: | ||
- result_db.container['State']['Status'] == "running" | ||
- result_db.container['State']['Restarting'] == false | ||
- result_localstack.container['State']['Status'] == "running" | ||
- result_localstack.container['State']['Restarting'] == false | ||
- result_redis.container['State']['Status'] == "running" | ||
- result_redis.container['State']['Restarting'] == false | ||
- result.container['State']['Status'] == "running" | ||
- result.container['State']['Restarting'] == false | ||
- result_app.container['State']['Status'] == "running" | ||
- result_app.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,47 @@ | ||
--- | ||
- 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 standardnotes | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Try and stop and remove standardnotes redis | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_redis_container_name }}" | ||
state: absent | ||
register: result_redis | ||
|
||
- name: Try and stop and remove standardnotes db | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_db_container_name }}" | ||
state: absent | ||
register: result_db | ||
|
||
- name: Try and stop and remove standardnotes localstack | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_localstack_container_name }}" | ||
state: absent | ||
register: result_localstack | ||
|
||
- name: Try and stop and remove standardnotes web app | ||
community.docker.docker_container: | ||
name: "{{ standardnotes_app_container_name }}" | ||
state: absent | ||
register: result_app | ||
|
||
- name: Check if standardnotes is stopped | ||
ansible.builtin.assert: | ||
that: | ||
- not result.changed | ||
- not result_redis.changed | ||
- not result_db.changed | ||
- not result_localstack.changed | ||
- not result_app.changed |
Oops, something went wrong.