Initial commit

This commit is contained in:
Eric Meehan 2026-02-04 11:33:52 -05:00
commit 2c3021b6b6
10 changed files with 440 additions and 0 deletions

38
README.md Normal file
View File

@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

BIN
defaults/.main.yml.swp Normal file

Binary file not shown.

23
defaults/main.yml Normal file
View File

@ -0,0 +1,23 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for ansible-role-open-archiver
open_archiver_all_inclusive_archive: "false"
open_archiver_body_size_limit: "100M"
open_archiver_enable_deletion: "false"
open_archiver_encryption_key: "changeme"
open_archiver_jwt_expires_in: "7d"
open_archiver_jwt_secret: "changeme"
open_archiver_meili_indexing_batch: "500"
open_archiver_meili_master_key: "changeme"
open_archiver_namespace: "open-archiver-hidden"
open_archiver_node_env: "development"
open_archiver_postgres_password: "changeme"
open-archiver_pvc_size_data: "8Gi"
open_archiver_pvc_size_meilidata: "8Gi"
open_archiver_pvc_size_open_archiver: "8Gi"
open_archiver_pvc_size_postgresql: "8Gi"
open_archiver_rate_limit_max_requests: "100"
open_archiver_rate_limit_window_ms: "900000"
open_archiver_redis_password: "changeme"
open_archiver_sync_frequency: "* * * * *"

3
handlers/main.yml Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for ansible-role-open-archiver

35
meta/main.yml Normal file
View File

@ -0,0 +1,35 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

BIN
tasks/.main.yml.swp Normal file

Binary file not shown.

329
tasks/main.yml Normal file
View File

@ -0,0 +1,329 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-open-archiver
- name: namespace
k8s:
state: present
definition:
apiVersion: v1
kind: Namespace
metadata:
name: "{{ open_archiver_namespace }}"
- name: pvc for postgresql
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgresql
namespace: "{{ open_archiver_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ open_archiver_pvc_size_postgresql }}"
- name: pvc for valkey
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: valkey
namespace: "{{ open_archiver_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ open_archiver_pvc_size_data }}"
- name: pvc for meili
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: meili
namespace: "{{ open_archiver_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ open_archiver_pvc_size_meilidata }}"
- name: pvc for open-archiver
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: open-archiver
namespace: "{{ open_archiver_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ open_archiver_pvc_size_open_archiver }}"
- name: deployment for postgresql
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: postgresql
namespace: "{{ open_archiver_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: postgres:17-alpine
env:
- name: POSTGRES_DB
value: open_archiver
- name: POSTGRES_USER
value: open_archiver
- name: POSTGRES_PASSWORD
value: "{{ open_archiver_postgres_password }}"
volumeMounts:
- name: postgresql
mountPath: /var/lib/postgresql/data
ports:
- containerPort: 5432
volumes:
- name: postgresql
persistentVolumeClaim:
claimName: postgresql
- name: service for postgresql
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: postgresql
namespace: "{{ open_archiver_namespace }}"
spec:
selector:
app: postgresql
ports:
- port: 5432
name: postgresql
type: ClusterIP
- name: deployment for valkey
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: valkey
namespace: "{{ open_archiver_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: valkey
template:
metadata:
labels:
app: valkey
spec:
containers:
- name: valkey
image: valkey/valkey:8-alpine
command:
- valkey-server
args:
- "--port"
- "7777"
- "--requirepass"
- "{{ open_archiver_redis_password }}"
volumeMounts:
- name: valkey
mountPath: /data
ports:
- containerPort: 7777
volumes:
- name: valkey
persistentVolumeClaim:
claimName: valkey
- name: service for valkey
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: valkey
namespace: "{{ open_archiver_namespace }}"
spec:
selector:
app: valkey
ports:
- port: 7777
name: valkey
type: ClusterIP
- name: deployment
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: open-archiver
namespace: "{{ open_archiver_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: open-archiver
template:
metadata:
labels:
app: open-archiver
spec:
containers:
- name: open-archiver
image: logiclabshq/open-archiver:latest
env:
- name: NODE_ENV
value: "{{ open_archiver_node_env }}"
- name: APP_URL
value: "https://open-archiver.eom.dev"
- name: ORIGIN
value: "https://open-archiver.eom.dev"
- name: PORT_BACKEND
value: "4000"
- name: PORT_FRONTEND
value: "3000"
- name: SYNC_FREQUENCY
value: "{{ open_archiver_sync_frequency }}"
- name: ALL_INCLUSIVE_ARCHIVE
value: "{{ open_archiver_all_inclusive_archive }}"
- name: POSTGRES_DB
value: "open_archiver"
- name: POSTGRES_USER
value: "open_archiver"
- name: POSTGRES_PASSWORD
value: "{{ open_archiver_postgres_password }}"
- name: DATABASE_URL
value: "postgresql://open_archiver:{{ open_archiver_postgres_password }}@postgresql:5432/open_archiver"
- name: MEILI_MASTER_KEY
value: "{{ open_archiver_meili_master_key }}"
- name: MEILI_HOST
value: "http://localhost:7700"
- name: MEILI_INDEXING_BATCH
value: "{{ open_archiver_meili_indexing_batch }}"
- name: REDIS_HOST
value: "valkey"
- name: REDIS_PORT
value: "7777"
- name: REDIS_PASSWORD
value: "{{ open_archiver_redis_password }}"
- name: REDIS_TLS_ENABLED
value: "false"
- name: STORAGE_TYPE
value: "local"
- name: BODY_SIZE_LIMIT
value: "{{ open_archiver_body_size_limit }}"
- name: STORAGE_LOCAL_ROOT_PATH
value: "/data"
- name: ENABLE_DELETION
value: "{{ open_archiver_enable_deletion }}"
- name: JWT_SECRET
value: "{{ open_archiver_jwt_secret }}"
- name: JWT_EXPIRES_IN
value: "{{ open_archiver_jwt_expires_in }}"
- name: RATE_LIMIT_WINDOW_MS
value: "{{ open_archiver_rate_limit_window_ms }}"
- name: RATE_LIMIT_MAX_REQUESTS
value: "{{ open_archiver_rate_limit_max_requests }}"
- name: ENCRYPTION_KEY
value: "{{ open_archiver_encryption_key }}"
- name: TIKA_URL
value: "http://localhost:9998"
volumeMounts:
- name: open-archiver
mountPath: /data
ports:
- containerPort: 3000
- name: meilisearch
image: getmeili/meilisearch:v1.15
env:
- name: MEILI_MASTER_KEY
value: "{{ open_archiver_meili_master_key }}"
volumeMounts:
- name: meili
mountPath: /meili_data
- name: tika
image: apache/tika:3.2.2.0-full
volumes:
- name: meili
persistentVolumeClaim:
claimName: meili
- name: open-archiver
persistentVolumeClaim:
claimName: open-archiver
- name: service for open-archiver
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: open-archiver
namespace: "{{ open_archiver_namespace }}"
spec:
selector:
app: open-archiver
ports:
- port: 3000
name: http
type: ClusterIP
- name: ingress
k8s:
state: present
definition:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: ca-issuer
name: open-archiver
namespace: open-archiver
spec:
ingressClassName: nginx
rules:
- host: open-archiver.eom.dev
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: open-archiver
port:
number: 3000
tls:
- hosts:
- open-archiver.eom.dev
secretName: open-archiver

3
tests/inventory Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost

6
tests/test.yml Normal file
View File

@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-open-archiver

3
vars/main.yml Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for ansible-role-open-archiver