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
11 changed files
with
202 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 |
---|---|---|
|
@@ -386,6 +386,10 @@ | |
tags: | ||
- loki | ||
|
||
- role: lubelogger | ||
tags: | ||
- lubelogger | ||
|
||
- role: mattermost | ||
tags: | ||
- mattermost | ||
|
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,41 @@ | ||
--- | ||
lubelogger_enabled: false | ||
lubelogger_available_externally: false | ||
|
||
# directories | ||
lubelogger_data_directory: "{{ docker_home }}/lubelogger" | ||
|
||
# network | ||
lubelogger_port: "8135" | ||
lubelogger_hostname: "lubelogger" | ||
|
||
# specs | ||
lubelogger_memory: 1g | ||
|
||
# docker | ||
lubelogger_container_name: lubelogger | ||
lubelogger_image_name: "ghcr.io/hargata/lubelogger" | ||
lubelogger_image_version: latest | ||
lubelogger_user_id: "1000" | ||
lubelogger_group_id: "1000" | ||
|
||
# lubelogger | ||
lubelogger_lc_all: "en_US.UTF-8" | ||
lubelogger_lang: "en_US.UTF-8" | ||
lubelogger_email_server: "" | ||
lubelogger_email_from: "" | ||
lubelogger_email_use_ssl: "false" | ||
lubelogger_email_port: "587" | ||
lubelogger_email_username: "" | ||
lubelogger_email_password: "" | ||
lubelogger_log_level: "ERROR" | ||
lubelogger_openidconfig_name: "" # Name of the OpenID Connect Provider | ||
lubelogger_openidconfig_clientid: "" # Client Id to Authenticate with the Provider | ||
lubelogger_openidconfig_clientsecret: "" # Client Secret to Authenticate with the Provider | ||
lubelogger_openidconfig_authurl: "" # Authorization URL to the Provider's Login Page | ||
lubelogger_openidconfig_tokenurl: "" # URL to retrieve user JWT from the Provider | ||
lubelogger_openidconfig_redirecturl: "" # https://<yourlubeloggerdomain.com>/Login/RemoteAuth(must be HTTPS) | ||
lubelogger_openidconfig_scope: "" # The scope for retrieving the user's email claim(usually it's just 'email') | ||
lubelogger_openidconfig_validatestate: "false" # true/false(default: false) - whether LubeLogger should validate state. | ||
lubelogger_openidconfig_disableregularlogin: "false" # true/false(default: false) - auto re-direct user to OIDC login. | ||
lubelogger_openidconfig_logouturl: "" # Log Out URL for OIDC Provider, required if DisableRegularLogin=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,11 @@ | ||
# LubeLogger | ||
|
||
Homepage: [https://github.com/hargata/lubelog](https://github.com/hargata/lubelog) | ||
|
||
LubeLogger is a web-based vehicle maintenance and fuel mileage tracker | ||
|
||
## Usage | ||
|
||
Set `lubelogger_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
lubelogger web interface can be found at [http://ansible_nas_host_or_ip:8135](http://ansible_nas_host_or_ip:8135). |
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: | ||
lubelogger_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: | ||
lubelogger_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 lubelogger container state | ||
community.docker.docker_container: | ||
name: "{{ lubelogger_container_name }}" | ||
register: result | ||
|
||
- name: Check if lubelogger 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 lubelogger | ||
community.docker.docker_container: | ||
name: "{{ lubelogger_container_name }}" | ||
state: absent | ||
register: result | ||
|
||
- name: Check if lubelogger 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,76 @@ | ||
--- | ||
- name: Start Lubelogger | ||
block: | ||
- name: Create Lubelogger Directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
with_items: | ||
- "{{ lubelogger_data_directory }}" | ||
- "{{ lubelogger_data_directory }}/config" | ||
- "{{ lubelogger_data_directory }}/data" | ||
- "{{ lubelogger_data_directory }}/translations" | ||
- "{{ lubelogger_data_directory }}/documents" | ||
- "{{ lubelogger_data_directory }}/images" | ||
- "{{ lubelogger_data_directory }}/temp" | ||
- "{{ lubelogger_data_directory }}/log" | ||
- "{{ lubelogger_data_directory }}/keys" | ||
|
||
- name: Create Lubelogger Docker Container | ||
community.docker.docker_container: | ||
container_default_behavior: no_defaults | ||
name: "{{ lubelogger_container_name }}" | ||
image: "{{ lubelogger_image_name }}:{{ lubelogger_image_version }}" | ||
pull: true | ||
volumes: | ||
- "{{ lubelogger_data_directory }}/config:/App/config" | ||
- "{{ lubelogger_data_directory }}/data:/App/data" | ||
- "{{ lubelogger_data_directory }}/translations:/App/wwwroot/translations" | ||
- "{{ lubelogger_data_directory }}/documents:/App/wwwroot/documents" | ||
- "{{ lubelogger_data_directory }}/images:/App/wwwroot/images" | ||
- "{{ lubelogger_data_directory }}/temp:/App/wwwroot/temp" | ||
- "{{ lubelogger_data_directory }}/log:/App/log" | ||
- "{{ lubelogger_data_directory }}/keys:/root/.aspnet/DataProtection-Keys" | ||
ports: | ||
- "{{ lubelogger_port }}:8080" | ||
env: | ||
TZ: "{{ ansible_nas_timezone }}" | ||
PUID: "{{ lubelogger_user_id | quote }}" | ||
PGID: "{{ lubelogger_group_id | quote }}" | ||
LC_ALL: "{{ lubelogger_lc_all }}" | ||
LANG: "{{ lubelogger_lang }}" | ||
MailConfig__EmailServer: "{{ lubelogger_email_server }}" | ||
MailConfig__EmailFrom: "{{ lubelogger_email_from }}" | ||
MailConfig__UseSSL: "{{ lubelogger_email_use_ssl }}" | ||
MailConfig__Port: "{{ lubelogger_email_port }}" | ||
MailConfig__Username: "{{ lubelogger_email_username }}" | ||
MailConfig__Password: "{{ lubelogger_email_password }}" | ||
LOGGING__LOGLEVEL__DEFAULT: "{{ lubelogger_log_level }}" | ||
OpenIDConfig__Name: "{{ lubelogger_openidconfig_name }}" | ||
OpenIDConfig__ClientId: "{{ lubelogger_openidconfig_clientid }}" | ||
OpenIDConfig__ClientSecret: "{{ lubelogger_openidconfig_clientsecret }}" | ||
OpenIDConfig__AuthURL: "{{ lubelogger_openidconfig_authurl }}" | ||
OpenIDConfig__TokenURL: "{{ lubelogger_openidconfig_tokenurl }}" | ||
OpenIDConfig__RedirectURL: "{{ lubelogger_openidconfig_redirecturl }}" | ||
OpenIDConfig__Scope: "{{ lubelogger_openidconfig_scope }}" | ||
OpenIDConfig__ValidateState: "{{ lubelogger_openidconfig_validatestate }}" | ||
OpenIDConfig__DisableRegularLogin: "{{ lubelogger_openidconfig_disableregularlogin }}" | ||
OpenIDConfig__LogOutURL: "{{ lubelogger_openidconfig_logouturl }}" | ||
restart_policy: unless-stopped | ||
memory: "{{ lubelogger_memory }}" | ||
labels: | ||
traefik.enable: "{{ lubelogger_available_externally | string }}" | ||
traefik.http.routers.lubelogger.rule: "Host(`{{ lubelogger_hostname }}.{{ ansible_nas_domain }}`)" | ||
traefik.http.routers.lubelogger.tls.certresolver: "letsencrypt" | ||
traefik.http.routers.lubelogger.tls.domains[0].main: "{{ ansible_nas_domain }}" | ||
traefik.http.routers.lubelogger.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" | ||
traefik.http.services.lubelogger.loadbalancer.server.port: "8080" | ||
when: lubelogger_enabled is true | ||
|
||
- name: Stop Lubelogger | ||
block: | ||
- name: Stop Lubelogger | ||
community.docker.docker_container: | ||
name: "{{ lubelogger_container_name }}" | ||
state: absent | ||
when: lubelogger_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,14 @@ | ||
--- | ||
title: "LubeLogger" | ||
description: "LubeLogger is a web-based vehicle maintenance and fuel mileage tracker" | ||
--- | ||
|
||
Homepage: [https://github.com/hargata/lubelog](https://github.com/hargata/lubelog) | ||
|
||
LubeLogger is a web-based vehicle maintenance and fuel mileage tracker | ||
|
||
## Usage | ||
|
||
Set `lubelogger_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file. | ||
|
||
lubelogger web interface can be found at [http://ansible_nas_host_or_ip:8135](http://ansible_nas_host_or_ip:8135). |