mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-03-22 12:29:47 +00:00
Compare commits
66 Commits
d460624689
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9297ee3964 | |||
| 0a0e3982e8 | |||
| c0ac96265e | |||
| 71fe67c1e0 | |||
| 8a49477449 | |||
| 46505df323 | |||
| 0294601e2c | |||
| 1e827ede7b | |||
| d8e54b6af4 | |||
| 7f42b439c9 | |||
| 67dc792660 | |||
| 128823f456 | |||
| 9e703cf9fd | |||
| 8ccda6978e | |||
| f832f2ad37 | |||
| f7c345e505 | |||
| 5460418ecb | |||
| 696c542b6b | |||
| 0fda7f84ba | |||
| 82f9ab4ead | |||
| 51c4466103 | |||
| cb1bf070b0 | |||
| 8dec820f1d | |||
| 31f624c429 | |||
| 955d1ac2f2 | |||
| 4377f5917c | |||
| 4eb7726ed8 | |||
| 369b8dae80 | |||
| 1c24b3e030 | |||
| 607a6b82c3 | |||
| 3c4fab1534 | |||
| 4b1fa18f7f | |||
| 40b8d89ee7 | |||
| bdda2191c4 | |||
| 6c5290a118 | |||
| b857640bf6 | |||
| ff0f048859 | |||
| 78659b1c77 | |||
| 32ef4ccb0d | |||
| b509854496 | |||
| c51a7d81be | |||
| b053fc8019 | |||
| 0cb3784757 | |||
| 2115a8aa61 | |||
| 076cb81c9d | |||
| bdafea0784 | |||
| 3b5d59a589 | |||
| 3c07b1b998 | |||
| dbbcc45525 | |||
| d3981868cf | |||
| 6c78b7ce39 | |||
| ebd772665b | |||
| 21d91805ad | |||
| c00cd6a94f | |||
| a34e5a5e8b | |||
| 71ec9945b1 | |||
| 11dbff9b8a | |||
| fecbc54b79 | |||
| d693a947f2 | |||
| 8c882adffe | |||
| fff458af5a | |||
| de1925a486 | |||
| 2fdee619ca | |||
| 47411136d0 | |||
| 08a0bb3761 | |||
| 27b924b558 |
17
README.md
17
README.md
@ -1,3 +1,18 @@
|
|||||||
# iac-ansible-private
|
# iac-ansible-private
|
||||||
|
|
||||||
iac-ansible-private
|
iac-ansible-private
|
||||||
|
|
||||||
|
stolon comes from https://github.com/sorintlab/stolon/blob/master/examples/kubernetes/README.md
|
||||||
|
qbittorrent comes from https://github.com/j4ym0/pia-qbittorrent-docker?tab=readme-ov-file
|
||||||
|
prowlarr comes from https://docs.linuxserver.io/images/docker-prowlarr/#docker-mods
|
||||||
|
and https://wiki.servarr.com/prowlarr/environment-variables
|
||||||
|
sonarr comes from https://wiki.servarr.com/sonarr/environment-variables
|
||||||
|
and https://docs.linuxserver.io/images/docker-sonarr/#supported-architectures
|
||||||
|
jellyfin comes from https://docs.linuxserver.io/images/docker-jellyfin/
|
||||||
|
flaresolverr comes from https://github.com/FlareSolverr/FlareSolverr
|
||||||
|
jellyseer comes from https://hub.docker.com/r/fallenbagel/jellyseerr
|
||||||
|
and https://docs.seerr.dev/extending-jellyseerr/database-config
|
||||||
|
decluttarr comes from https://github.com/ManiMatter/decluttarr
|
||||||
|
minecraft comes from https://www.civo.com/learn/deploying-minecraft-server-kubernetes
|
||||||
|
|
||||||
|

|
||||||
BIN
fenix-iac.png
Normal file
BIN
fenix-iac.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
29
playbook.yml
29
playbook.yml
@ -6,7 +6,7 @@
|
|||||||
- vaultwarden
|
- vaultwarden
|
||||||
- kubernetes
|
- kubernetes
|
||||||
- kube-master
|
- kube-master
|
||||||
- stolon
|
- nvidia-base
|
||||||
|
|
||||||
- name: Configure Kubernetes Nodes
|
- name: Configure Kubernetes Nodes
|
||||||
hosts: workers
|
hosts: workers
|
||||||
@ -16,3 +16,30 @@
|
|||||||
- vaultwarden
|
- vaultwarden
|
||||||
- kubernetes
|
- kubernetes
|
||||||
- kube-node
|
- kube-node
|
||||||
|
- nvidia-base
|
||||||
|
|
||||||
|
- name: Configure Kubernetes Data
|
||||||
|
hosts: master
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- nvidia
|
||||||
|
- stolon
|
||||||
|
- cloudflared
|
||||||
|
- qbittorrent
|
||||||
|
- prowlarr
|
||||||
|
- sonarr
|
||||||
|
- radarr
|
||||||
|
- jellyfin
|
||||||
|
- flaresolverr
|
||||||
|
- jellyseerr
|
||||||
|
- decluttarr
|
||||||
|
- bazarr
|
||||||
|
- libreTranslate
|
||||||
|
- lingarr
|
||||||
|
- cripto
|
||||||
|
- anchorr
|
||||||
|
- lazylibrarian
|
||||||
|
- mangareader
|
||||||
|
- bookshelf
|
||||||
|
- shelfarr
|
||||||
|
- minecraft
|
||||||
46
roles/anchorr/files/anchorr-deployment.yaml
Normal file
46
roles/anchorr/files/anchorr-deployment.yaml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: anchorr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: anchorr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: anchorr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: anchorr
|
||||||
|
image: nairdah/anchorr:latest
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 8282
|
||||||
|
name: webhook
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
- name: NODE_ENV
|
||||||
|
value: 'production'
|
||||||
|
- name: WEBHOOK_PORT
|
||||||
|
value: '8282'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /usr/src/app/config
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: anchorr-config-pvc
|
||||||
|
|
||||||
11
roles/anchorr/files/anchorr-nfs-csi.yaml
Normal file
11
roles/anchorr/files/anchorr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: anchorr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/anchorr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
29
roles/anchorr/files/anchorr-pvcs.yaml
Normal file
29
roles/anchorr/files/anchorr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: anchorr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: anchorr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/anchorr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: anchorr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: anchorr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: anchorr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
12
roles/anchorr/files/anchorr-service.yaml
Normal file
12
roles/anchorr/files/anchorr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: anchorr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8282
|
||||||
|
targetPort: 8282
|
||||||
|
selector:
|
||||||
|
app: anchorr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/anchorr/tasks/main.yml
Normal file
51
roles/anchorr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/anchorr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/anchorr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/anchorr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/anchorr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.anchorr.secret", dest: "/tmp/stack-arr/anchorr/kubernetes-files/files/anchorr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/anchorr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/anchorr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/anchorr/vars/main.yml
Normal file
4
roles/anchorr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
70
roles/bazarr/files/bazarr-deployment.yaml
Normal file
70
roles/bazarr/files/bazarr-deployment.yaml
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: bazarr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: bazarr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: bazarr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: bazarr
|
||||||
|
image: lscr.io/linuxserver/bazarr:1.5.3
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 6767
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
- name: POSTGRES_ENABLED
|
||||||
|
value: 'true'
|
||||||
|
- name: POSTGRES_HOST
|
||||||
|
value: 'stolon-proxy-service.postgresql.svc.cluster.local'
|
||||||
|
- name: POSTGRES_PORT
|
||||||
|
value: '5432'
|
||||||
|
- name: POSTGRES_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bazarr-secret
|
||||||
|
key: username
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bazarr-secret
|
||||||
|
key: password
|
||||||
|
- name: POSTGRES_DATABASE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: bazarr-secret
|
||||||
|
key: maindb
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: media
|
||||||
|
mountPath: /media
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bazarr-config-pvc
|
||||||
|
- name: media
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bazarr-media-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/bazarr/files/bazarr-nfs-csi.yaml
Normal file
11
roles/bazarr/files/bazarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: bazarr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bazarr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
60
roles/bazarr/files/bazarr-pvcs.yaml
Normal file
60
roles/bazarr/files/bazarr-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: bazarr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: bazarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bazarr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: bazarr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: bazarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: bazarr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: bazarr-media-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: bazarr-media-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: bazarr-media-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
11
roles/bazarr/files/bazarr-secret.yaml
Normal file
11
roles/bazarr/files/bazarr-secret.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: bazarr-secret
|
||||||
|
namespace: stack-arr
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
username: dXNlcm5hbWU=
|
||||||
|
password: cGFzc3dvcmQ=
|
||||||
|
maindb: bWFpbmRiLXByb3dsYXJy
|
||||||
|
logsdb: bG9nZGItcHJvd2xhcnI=
|
||||||
12
roles/bazarr/files/bazarr-service.yaml
Normal file
12
roles/bazarr/files/bazarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: bazarr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 6767
|
||||||
|
targetPort: 6767
|
||||||
|
selector:
|
||||||
|
app: bazarr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/bazarr/tasks/main.yml
Normal file
51
roles/bazarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/bazarr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/bazarr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/bazarr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/bazarr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.stackarr.bazarr.secret", dest: "/tmp/stack-arr/bazarr/kubernetes-files/files/bazarr-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/bazarr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/bazarr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/bazarr/vars/main.yml
Normal file
4
roles/bazarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
54
roles/bookshelf/files/bookshelf-deployment.yaml
Normal file
54
roles/bookshelf/files/bookshelf-deployment.yaml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: bookshelf
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: bookshelf
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: bookshelf
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: bookshelf
|
||||||
|
image: ghcr.io/pennydreadful/bookshelf:softcover-v0.4.20.91
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 8787
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: books
|
||||||
|
mountPath: /books
|
||||||
|
- name: downloads
|
||||||
|
mountPath: /downloads
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bookshelf-config-pvc
|
||||||
|
- name: books
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: bookshelf-books-pvc
|
||||||
|
- name: downloads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-downloads-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/bookshelf/files/bookshelf-nfs-csi.yaml
Normal file
11
roles/bookshelf/files/bookshelf-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bookshelf
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
60
roles/bookshelf/files/bookshelf-pvcs.yaml
Normal file
60
roles/bookshelf/files/bookshelf-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 20Gi
|
||||||
|
storageClassName: bookshelf-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bookshelf/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: bookshelf-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: bookshelf-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-media-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-books-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: bookshelf-media-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
12
roles/bookshelf/files/bookshelf-service.yaml
Normal file
12
roles/bookshelf/files/bookshelf-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: bookshelf-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8787
|
||||||
|
targetPort: 8787
|
||||||
|
selector:
|
||||||
|
app: bookshelf
|
||||||
|
type: ClusterIP
|
||||||
51
roles/bookshelf/tasks/main.yml
Normal file
51
roles/bookshelf/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/bookshelf/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/bookshelf/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.bookshelf.secret", dest: "/tmp/stack-arr/bookshelf/kubernetes-files/files/bookshelf-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/bookshelf/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/bookshelf/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/bookshelf/vars/main.yml
Normal file
4
roles/bookshelf/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
4
roles/cloudflared/files/cloudflare-namespace.yaml
Normal file
4
roles/cloudflared/files/cloudflare-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: cloudflare
|
||||||
49
roles/cloudflared/files/cloudflared-tunnel-deployment.yaml
Normal file
49
roles/cloudflared/files/cloudflared-tunnel-deployment.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: cloudflared-tunnel
|
||||||
|
namespace: cloudflare
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: cloudflared
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: cloudflared
|
||||||
|
spec:
|
||||||
|
securityContext:
|
||||||
|
sysctls:
|
||||||
|
# Allows ICMP traffic (ping, traceroute) to resources behind cloudflared.
|
||||||
|
- name: net.ipv4.ping_group_range
|
||||||
|
value: "65532 65532"
|
||||||
|
containers:
|
||||||
|
- image: cloudflare/cloudflared:latest
|
||||||
|
name: cloudflared
|
||||||
|
env:
|
||||||
|
# Defines an environment variable for the tunnel token.
|
||||||
|
- name: TUNNEL_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: tunnel-token-secret
|
||||||
|
key: token
|
||||||
|
command:
|
||||||
|
# Configures tunnel run parameters
|
||||||
|
- cloudflared
|
||||||
|
- tunnel
|
||||||
|
- --no-autoupdate
|
||||||
|
- --loglevel
|
||||||
|
- debug
|
||||||
|
- --metrics
|
||||||
|
- 0.0.0.0:2000
|
||||||
|
- run
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
# Cloudflared has a /ready endpoint which returns 200 if and only if
|
||||||
|
# it has an active connection to Cloudflare's network.
|
||||||
|
path: /ready
|
||||||
|
port: 2000
|
||||||
|
failureThreshold: 1
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
8
roles/cloudflared/files/tunnel-token-secret.yaml
Normal file
8
roles/cloudflared/files/tunnel-token-secret.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: tunnel-token-secret
|
||||||
|
namespace: cloudflare
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
token: <CLOUDFLARE_TUNNEL_TOKEN>
|
||||||
51
roles/cloudflared/tasks/main.yml
Normal file
51
roles/cloudflared/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/cloudflare/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/cloudflare/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/cloudflare/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/cloudflare/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.cloudflare.tunnel.secret", dest: "/tmp/cloudflare/kubernetes-files/files/tunnel-token-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/cloudflare/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/cloudflare/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/cloudflared/vars/main.yml
Normal file
4
roles/cloudflared/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
94
roles/cripto/files/ai-deployment.yaml
Normal file
94
roles/cripto/files/ai-deployment.yaml
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: fenix-ai
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: crypto-forecast-api-deployment
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
replicas: 0
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: crypto-forecast-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: crypto-forecast-api
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: crypto-forecast-api
|
||||||
|
image: gitea.fenix-dev.com/fenix-gitea-admin/fenix-cripto-api:0.0.19
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||||
|
env:
|
||||||
|
- name: ASPNETCORE_ENVIRONMENT
|
||||||
|
value: Development
|
||||||
|
volumeMounts:
|
||||||
|
- name: model
|
||||||
|
mountPath: /models
|
||||||
|
volumes:
|
||||||
|
- name: model
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: crypto-forecast-api-model-pvc
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: crypto-forecast-api-svc
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: crypto-forecast-api
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: crypto-forecast-api-model-pv
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 20Gi
|
||||||
|
storageClassName: fenix-ai-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/fenix/ai/api/model
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: crypto-forecast-api-model-pvc
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
storageClassName: fenix-ai-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: crypto-forecast-api-model-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: fenix-ai-nfs-csi
|
||||||
|
namespace: fenix-ai
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
4
roles/cripto/files/ai-namespace.yaml
Normal file
4
roles/cripto/files/ai-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: fenix-ai
|
||||||
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
97
roles/cripto/files/ai-ollama-deployment.yaml
Normal file
@ -0,0 +1,97 @@
|
|||||||
|
apiVersion: metallb.io/v1beta1
|
||||||
|
kind: IPAddressPool
|
||||||
|
metadata:
|
||||||
|
name: local-pool-2
|
||||||
|
namespace: metallb-system
|
||||||
|
spec:
|
||||||
|
addresses:
|
||||||
|
- 192.168.1.100-192.168.1.200
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: ollama-deployment
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: ollama
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: ollama
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: ollama
|
||||||
|
image: ollama/ollama:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 11434
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: 1 # garante uso da tua RTX 4060 Ti
|
||||||
|
env:
|
||||||
|
- name: OLLAMA_HOST
|
||||||
|
value: "0.0.0.0"
|
||||||
|
volumeMounts:
|
||||||
|
- name: ollama-data
|
||||||
|
mountPath: /root/.ollama
|
||||||
|
volumes:
|
||||||
|
- name: ollama-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: ollama-data-pvc
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: ollama-api-svc
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: ollama
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 11434
|
||||||
|
targetPort: 11434
|
||||||
|
type: NodePort # ou LoadBalancer se tiveres suporte
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: ollama-data-pv
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 20Gi
|
||||||
|
storageClassName: ollama-ai-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: ollama-data-pvc
|
||||||
|
namespace: fenix-ai
|
||||||
|
spec:
|
||||||
|
storageClassName: ollama-ai-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: ollama-ai-nfs-csi
|
||||||
|
namespace: fenix-ai
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/ollama
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
51
roles/cripto/tasks/main.yml
Normal file
51
roles/cripto/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/fenix-ai/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/fenix-ai/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/fenix-ai/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/fenix-ai/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.decluttarr.secret", dest: "/tmp/stack-arr/decluttarr/kubernetes-files/files/decluttarr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/fenix-ai/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/fenix-ai/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/cripto/vars/main.yml
Normal file
4
roles/cripto/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
79
roles/decluttarr/files/decluttarr-deployment.yaml
Normal file
79
roles/decluttarr/files/decluttarr-deployment.yaml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: decluttarr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: decluttarr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: decluttarr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: decluttarr
|
||||||
|
image: ghcr.io/manimatter/decluttarr:v1.50.2
|
||||||
|
env:
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: VERBOSE
|
||||||
|
- name: REMOVE_TIMER
|
||||||
|
value: '3'
|
||||||
|
- name: REMOVE_FAILED
|
||||||
|
value: 'True'
|
||||||
|
- name: REMOVE_FAILED_IMPORTS
|
||||||
|
value: 'False'
|
||||||
|
- name: REMOVE_METADATA_MISSING
|
||||||
|
value: 'True'
|
||||||
|
- name: REMOVE_MISSING_FILES
|
||||||
|
value: 'True'
|
||||||
|
- name: REMOVE_ORPHANS
|
||||||
|
value: 'True'
|
||||||
|
- name: REMOVE_SLOW
|
||||||
|
value: 'False'
|
||||||
|
- name: REMOVE_STALLED
|
||||||
|
value: 'True'
|
||||||
|
- name: REMOVE_UNMONITORED
|
||||||
|
value: 'False'
|
||||||
|
- name: MIN_DOWNLOAD_SPEED
|
||||||
|
value: '100'
|
||||||
|
- name: PERMITTED_ATTEMPTS
|
||||||
|
value: '3'
|
||||||
|
- name: SONARR_URL
|
||||||
|
value: http://sonarr-service.stack-arr.svc.cluster.local:8989
|
||||||
|
- name: SONARR_KEY
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: decluttarr-secret
|
||||||
|
key: sonarrkey
|
||||||
|
- name: QBITTORRENT_URL
|
||||||
|
value: http://qbittorrent-service.stack-arr.svc.cluster.local:8080
|
||||||
|
- name: QBITTORRENT_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: decluttarr-secret
|
||||||
|
key: qbittorrentuser
|
||||||
|
- name: QBITTORRENT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: decluttarr-secret
|
||||||
|
key: qbittorrentpass
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: downloads
|
||||||
|
mountPath: /data/downloads
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: decluttarr-config-pvc
|
||||||
|
- name: downloads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-downloads-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
12
roles/decluttarr/files/decluttarr-nfs-csi.yaml
Normal file
12
roles/decluttarr/files/decluttarr-nfs-csi.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: decluttarr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/decluttarr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
|
---
|
||||||
30
roles/decluttarr/files/decluttarr-pvcs.yaml
Normal file
30
roles/decluttarr/files/decluttarr-pvcs.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: decluttarr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: decluttarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/decluttarr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: decluttarr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: decluttarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: decluttarr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
10
roles/decluttarr/files/decluttarr-secret.yaml
Normal file
10
roles/decluttarr/files/decluttarr-secret.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: decluttarr-secret
|
||||||
|
namespace: stack-arr
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
sonarrkey: M2tkMDRscjk1bGY5M29lMDNsZTAzbGU=
|
||||||
|
qbittorrentuser: dXNlcg==
|
||||||
|
qbittorrentpass: cGFzcw==
|
||||||
51
roles/decluttarr/tasks/main.yml
Normal file
51
roles/decluttarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/decluttarr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/decluttarr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/decluttarr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/decluttarr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.stackarr.decluttarr.secret", dest: "/tmp/stack-arr/decluttarr/kubernetes-files/files/decluttarr-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/decluttarr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/decluttarr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/decluttarr/vars/main.yml
Normal file
4
roles/decluttarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
32
roles/flaresolverr/files/flaresolverr-deployment.yaml
Normal file
32
roles/flaresolverr/files/flaresolverr-deployment.yaml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: flaresolverr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: flaresolverr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: flaresolverr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: flaresolverr
|
||||||
|
image: ghcr.io/flaresolverr/flaresolverr:latest
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 8191
|
||||||
|
name: porta
|
||||||
|
env:
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: "info"
|
||||||
|
|
||||||
|
|
||||||
12
roles/flaresolverr/files/flaresolverr-service.yaml
Normal file
12
roles/flaresolverr/files/flaresolverr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: flaresolverr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8191
|
||||||
|
targetPort: 8191
|
||||||
|
selector:
|
||||||
|
app: flaresolverr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/flaresolverr/tasks/main.yml
Normal file
51
roles/flaresolverr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/sonarr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/sonarr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/sonarr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/sonarr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.sonarr.secret", dest: "/tmp/stack-arr/sonarr/kubernetes-files/files/sonarr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/sonarr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/sonarr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/flaresolverr/vars/main.yml
Normal file
4
roles/flaresolverr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
65
roles/jellyfin/files/jellyfin-deployment.yaml
Normal file
65
roles/jellyfin/files/jellyfin-deployment.yaml
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: jellyfin
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: jellyfin
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: jellyfin
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: jellyfin
|
||||||
|
image: lscr.io/linuxserver/jellyfin:10.11.5
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "9G" # Maximum memory allowed
|
||||||
|
cpu: "4" # Maximum CPU allowed
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 8096
|
||||||
|
name: webui
|
||||||
|
- containerPort: 8920
|
||||||
|
name: webuihttps
|
||||||
|
- containerPort: 1900
|
||||||
|
name: dlnaudp
|
||||||
|
- containerPort: 7359
|
||||||
|
name: discoveryudp
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: videos
|
||||||
|
mountPath: /videos
|
||||||
|
- name: books
|
||||||
|
mountPath: /books
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: jellyfin-config-pvc
|
||||||
|
- name: videos
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: jellyfin-videos-pvc
|
||||||
|
- name: books
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: jellyfin-books-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
23
roles/jellyfin/files/jellyfin-nfs-csi.yaml
Normal file
23
roles/jellyfin/files/jellyfin-nfs-csi.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/jellyfin
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-videos-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
93
roles/jellyfin/files/jellyfin-pvcs.yaml
Normal file
93
roles/jellyfin/files/jellyfin-pvcs.yaml
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: jellyfin-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/jellyfin/config
|
||||||
|
mountOptions:
|
||||||
|
- nolock
|
||||||
|
- nfsvers=3
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: jellyfin-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-videos-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-videos-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: jellyfin-videos-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-books-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-books-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: jellyfin-books-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
22
roles/jellyfin/files/jellyfin-service.yaml
Normal file
22
roles/jellyfin/files/jellyfin-service.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: jellyfin-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8096
|
||||||
|
targetPort: 8096
|
||||||
|
name: webui
|
||||||
|
- port: 8920
|
||||||
|
targetPort: 8920
|
||||||
|
name: webuihttps
|
||||||
|
- port: 1900
|
||||||
|
targetPort: 1900
|
||||||
|
name: dlnaudp
|
||||||
|
- port: 7359
|
||||||
|
targetPort: 7359
|
||||||
|
name: discoveryudp
|
||||||
|
selector:
|
||||||
|
app: jellyfin
|
||||||
|
type: ClusterIP
|
||||||
51
roles/jellyfin/tasks/main.yml
Normal file
51
roles/jellyfin/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/jellyfin/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/jellyfin/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/jellyfin/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/jellyfin/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.jellyfin.secret", dest: "/tmp/stack-arr/jellyfin/kubernetes-files/files/jelly-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/jellyfin/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/jellyfin/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/jellyfin/vars/main.yml
Normal file
4
roles/jellyfin/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
62
roles/jellyseerr/files/jellyseerr-deployment.yaml
Normal file
62
roles/jellyseerr/files/jellyseerr-deployment.yaml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: jellyseerr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: jellyseerr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: jellyseerr
|
||||||
|
image: fallenbagel/jellyseerr:2.7.3
|
||||||
|
ports:
|
||||||
|
- containerPort: 5055
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: 'debug'
|
||||||
|
- name: DB_TYPE
|
||||||
|
value: 'postgres'
|
||||||
|
- name: DB_HOST
|
||||||
|
value: 'stolon-proxy-service.postgresql.svc.cluster.local'
|
||||||
|
- name: DB_PORT
|
||||||
|
value: '5432'
|
||||||
|
- name: DB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: jellyseerr-secret
|
||||||
|
key: username
|
||||||
|
- name: DB_PASS
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: jellyseerr-secret
|
||||||
|
key: password
|
||||||
|
- name: DB_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: jellyseerr-secret
|
||||||
|
key: maindb
|
||||||
|
- name: DB_LOG_QUERIES
|
||||||
|
value: 'false'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /app/config
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: jellyseerr-config-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/jellyseerr/files/jellyseerr-nfs-csi.yaml
Normal file
11
roles/jellyseerr/files/jellyseerr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/jellyseerr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
30
roles/jellyseerr/files/jellyseerr-pvcs.yaml
Normal file
30
roles/jellyseerr/files/jellyseerr-pvcs.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: jellyseerr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/jellyseerr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyseerr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: jellyseerr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
10
roles/jellyseerr/files/jellyseerr-secret.yaml
Normal file
10
roles/jellyseerr/files/jellyseerr-secret.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr-secret
|
||||||
|
namespace: stack-arr
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
username: dXNlcm5hbWU=
|
||||||
|
password: cGFzc3dvcmQ=
|
||||||
|
maindb: bWFpbmRiLXByb3dsYXJy
|
||||||
12
roles/jellyseerr/files/jellyseerr-service.yaml
Normal file
12
roles/jellyseerr/files/jellyseerr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: jellyseerr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 5055
|
||||||
|
targetPort: 5055
|
||||||
|
selector:
|
||||||
|
app: jellyseerr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/jellyseerr/tasks/main.yml
Normal file
51
roles/jellyseerr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/jellyseerr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/jellyseerr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/jellyseerr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/jellyseerr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.stackarr.jellyseerr.secret", dest: "/tmp/stack-arr/jellyseerr/kubernetes-files/files/jellyseerr-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/jellyseerr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/jellyseerr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/jellyseerr/vars/main.yml
Normal file
4
roles/jellyseerr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
54
roles/lazylibrarian/files/lazylibrarian-deployment.yaml
Normal file
54
roles/lazylibrarian/files/lazylibrarian-deployment.yaml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: lazylibrarian
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: lazylibrarian
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: lazylibrarian
|
||||||
|
image: lscr.io/linuxserver/lazylibrarian:latest
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 5299
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: books
|
||||||
|
mountPath: /books
|
||||||
|
- name: downloads
|
||||||
|
mountPath: /downloads
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: lazylibrarian-config-pvc
|
||||||
|
- name: books
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: lazylibrarian-books-pvc
|
||||||
|
- name: downloads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-downloads-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/lazylibrarian/files/lazylibrarian-nfs-csi.yaml
Normal file
11
roles/lazylibrarian/files/lazylibrarian-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lazylibrarian
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
60
roles/lazylibrarian/files/lazylibrarian-pvcs.yaml
Normal file
60
roles/lazylibrarian/files/lazylibrarian-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 20Gi
|
||||||
|
storageClassName: lazylibrarian-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lazylibrarian/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: lazylibrarian-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: lazylibrarian-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-media-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-books-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: lazylibrarian-media-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
12
roles/lazylibrarian/files/lazylibrarian-service.yaml
Normal file
12
roles/lazylibrarian/files/lazylibrarian-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: lazylibrarian-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 5299
|
||||||
|
targetPort: 5299
|
||||||
|
selector:
|
||||||
|
app: lazylibrarian
|
||||||
|
type: ClusterIP
|
||||||
51
roles/lazylibrarian/tasks/main.yml
Normal file
51
roles/lazylibrarian/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/lazylibrarian/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.lazylibrarian.secret", dest: "/tmp/stack-arr/lazylibrarian/kubernetes-files/files/lazylibrarian-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/lazylibrarian/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/lazylibrarian/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/lazylibrarian/vars/main.yml
Normal file
4
roles/lazylibrarian/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
26
roles/libreTranslate/files/libretranslate-deployment.yaml
Normal file
26
roles/libreTranslate/files/libretranslate-deployment.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: libretranslate
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: libretranslate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: libretranslate
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: libretranslate
|
||||||
|
image: libretranslate/libretranslate:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 5000
|
||||||
|
env:
|
||||||
|
- name: LT_HTTP_HOST
|
||||||
|
value: "0.0.0.0"
|
||||||
|
- name: LT_HTTP_PORT
|
||||||
|
value: "5000"
|
||||||
|
|
||||||
12
roles/libreTranslate/files/libretranslate-service.yaml
Normal file
12
roles/libreTranslate/files/libretranslate-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: libretranslate-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 5000
|
||||||
|
targetPort: 5000
|
||||||
|
selector:
|
||||||
|
app: libretranslate
|
||||||
|
type: ClusterIP
|
||||||
51
roles/libreTranslate/tasks/main.yml
Normal file
51
roles/libreTranslate/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/libreTranslate/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/libreTranslate/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/libreTranslate/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/libreTranslate/vars/main.yml
Normal file
4
roles/libreTranslate/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
36
roles/lingarr/files/lingarr-deployment.yaml
Normal file
36
roles/lingarr/files/lingarr-deployment.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: lingarr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: lingarr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: lingarr
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: lingarr
|
||||||
|
image: lingarr/lingarr:latest
|
||||||
|
ports:
|
||||||
|
- containerPort: 9876
|
||||||
|
env:
|
||||||
|
- name: ASPNETCORE_URLS
|
||||||
|
value: "http://+:9876"
|
||||||
|
- name: WHISPER_BASE_URL
|
||||||
|
value: "http://whisperasr-service.stack-arr.svc.cluster.local:9000"
|
||||||
|
- name: SOURCE_LANGUAGE
|
||||||
|
value: "auto"
|
||||||
|
- name: TARGET_LANGUAGE
|
||||||
|
value: "pt"
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /app/config
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: lingarr-config-pvc
|
||||||
11
roles/lingarr/files/lingarr-nfs-csi.yaml
Normal file
11
roles/lingarr/files/lingarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: lingarr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lingarr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
29
roles/lingarr/files/lingarr-pvcs.yaml
Normal file
29
roles/lingarr/files/lingarr-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: lingarr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 10Gi
|
||||||
|
storageClassName: lingarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/lingarr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: lingarr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: lingarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: lingarr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
12
roles/lingarr/files/lingarr-service.yaml
Normal file
12
roles/lingarr/files/lingarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: lingarr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 9876
|
||||||
|
targetPort: 9876
|
||||||
|
selector:
|
||||||
|
app: lingarr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/lingarr/tasks/main.yml
Normal file
51
roles/lingarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/lingarr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/lingarr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/lingarr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/lingarr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.radarr.secret", dest: "/tmp/stack-arr/radarr/kubernetes-files/files/radarr-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/lingarr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/lingarr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/lingarr/vars/main.yml
Normal file
4
roles/lingarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
90
roles/mangareader/files/mangareader-deployment.yaml
Normal file
90
roles/mangareader/files/mangareader-deployment.yaml
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mangareader
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mangareader
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mangareader
|
||||||
|
spec:
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1013
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: mangareader
|
||||||
|
image: ghcr.io/suwayomi/tachidesk:v2.1.2061
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 4567
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
- name: AUTO_DOWNLOAD_CHAPTERS
|
||||||
|
value: 'true'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_MANGA
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_CATEGORIES
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_CHAPTERS
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_TRACKING
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_HISTORY
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_CLIENT_DATA
|
||||||
|
value: 'false'
|
||||||
|
- name: AUTO_BACKUP_INCLUDE_SERVER_SETTINGS
|
||||||
|
value: 'false'
|
||||||
|
- name: FLARESOLVERR_ENABLED
|
||||||
|
value: 'true'
|
||||||
|
- name: FLARESOLVERR_URL
|
||||||
|
value: 'http://flaresolverr-service.stack-arr.svc.cluster.local:8191'
|
||||||
|
- name: DATABASE_TYPE
|
||||||
|
value: 'POSTGRESQL'
|
||||||
|
- name: DATABASE_URL
|
||||||
|
value: 'postgresql://stolon-proxy-service.postgresql.svc.cluster.local:5432/mangareader'
|
||||||
|
- name: DATABASE_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mangareader-secret
|
||||||
|
key: username
|
||||||
|
- name: DATABASE_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mangareader-secret
|
||||||
|
key: password
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /home/suwayomi/.local/share/Tachidesk
|
||||||
|
- name: books
|
||||||
|
mountPath: /books
|
||||||
|
- name: downloads
|
||||||
|
mountPath: /downloads
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mangareader-config-pvc
|
||||||
|
- name: books
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: mangareader-books-pvc
|
||||||
|
- name: downloads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-downloads-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/mangareader/files/mangareader-nfs-csi.yaml
Normal file
11
roles/mangareader/files/mangareader-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: mangareader-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/mangareader
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
60
roles/mangareader/files/mangareader-pvcs.yaml
Normal file
60
roles/mangareader/files/mangareader-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: mangareader-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 20Gi
|
||||||
|
storageClassName: mangareader-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/mangareader/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mangareader-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: mangareader-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: mangareader-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: mangareader-media-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 150Gi
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Livros
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: mangareader-books-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: jellyfin-videos-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: mangareader-media-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 150Gi
|
||||||
|
---
|
||||||
9
roles/mangareader/files/mangareader-secret.yaml
Normal file
9
roles/mangareader/files/mangareader-secret.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mangareader-secret
|
||||||
|
namespace: stack-arr
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
username: dXNlcm5hbWU=
|
||||||
|
password: cGFzc3dvcmQ=
|
||||||
12
roles/mangareader/files/mangareader-service.yaml
Normal file
12
roles/mangareader/files/mangareader-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mangareader-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 4567
|
||||||
|
targetPort: 4567
|
||||||
|
selector:
|
||||||
|
app: mangareader
|
||||||
|
type: ClusterIP
|
||||||
51
roles/mangareader/tasks/main.yml
Normal file
51
roles/mangareader/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/mangareader/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/mangareader/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/mangareader/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/mangareader/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.stackarr.mangareader.secret", dest: "/tmp/stack-arr/mangareader/kubernetes-files/files/mangareader-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/mangareader/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/mangareader/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/mangareader/vars/main.yml
Normal file
4
roles/mangareader/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
15
roles/minecraft/files/minecraft-configmap.yaml
Normal file
15
roles/minecraft/files/minecraft-configmap.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: minecraft-configmap
|
||||||
|
namespace: minecraft
|
||||||
|
data:
|
||||||
|
SERVER_NAME: "Example Minecraft Server"
|
||||||
|
EULA: "true"
|
||||||
|
VERSION: "1.21.1"
|
||||||
|
MAX_PLAYERS: "10"
|
||||||
|
OPS: |
|
||||||
|
tomas
|
||||||
|
ENABLE_WHITELIST: "true"
|
||||||
|
WHITELIST: |
|
||||||
|
tomas
|
||||||
4
roles/minecraft/files/minecraft-namespace.yaml
Normal file
4
roles/minecraft/files/minecraft-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: minecraft
|
||||||
11
roles/minecraft/files/minecraft-nfs-csi.yaml
Normal file
11
roles/minecraft/files/minecraft-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: minecraft-nfs-csi
|
||||||
|
namespace: minecraft
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/Minecraft/TI0
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
29
roles/minecraft/files/minecraft-pvcs.yaml
Normal file
29
roles/minecraft/files/minecraft-pvcs.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: minecraft-config-pv
|
||||||
|
namespace: minecraft
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 30Gi
|
||||||
|
storageClassName: minecraft-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/Minecraft/TI0
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: minecraft-config-pvc
|
||||||
|
namespace: minecraft
|
||||||
|
spec:
|
||||||
|
storageClassName: minecraft-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: minecraft-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 30Gi
|
||||||
12
roles/minecraft/files/minecraft-service.yaml
Normal file
12
roles/minecraft/files/minecraft-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: minecraft-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 19132
|
||||||
|
protocol: UDP
|
||||||
|
selector:
|
||||||
|
app: minecraft
|
||||||
|
type: ClusterIP
|
||||||
46
roles/minecraft/files/minecraft-statefulset.yaml
Normal file
46
roles/minecraft/files/minecraft-statefulset.yaml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: minecraft
|
||||||
|
namespace: minecraft
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: minecraft
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: minecraft
|
||||||
|
spec:
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 1013
|
||||||
|
fsGroup: 1013
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: minecraft
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
stdin: true
|
||||||
|
tty: true
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 2
|
||||||
|
memory: 5Gi
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: minecraft-configmap
|
||||||
|
ports:
|
||||||
|
- containerPort: 19132
|
||||||
|
name: serverport
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: minecraft-config-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
52
roles/minecraft/tasks/main.yml
Normal file
52
roles/minecraft/tasks/main.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/minecraft/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/minecraft/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/minecraft/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/minecraft/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Obter várias notas do Bitwarden
|
||||||
|
# shell: |
|
||||||
|
# echo "unlock"
|
||||||
|
# BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
# echo "get item"
|
||||||
|
# bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
# loop:
|
||||||
|
# - { id: "iac.ansible.stackarr.minecraft.secret", dest: "/tmp/stack-arr/minecraft/kubernetes-files/files/minecraft-secret.yaml" }
|
||||||
|
# args:
|
||||||
|
# executable: /bin/bash
|
||||||
|
# environment:
|
||||||
|
# BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/minecraft/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/minecraft/kubernetes-files/files/minecraft-namespace.yaml
|
||||||
|
kubectl apply -f /tmp/stack-arr/minecraft/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/minecraft/vars/main.yml
Normal file
4
roles/minecraft/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
66
roles/nvidia-base/tasks/main.yml
Normal file
66
roles/nvidia-base/tasks/main.yml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
- name: Instalar driver NVIDIA
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nvidia-driver-550
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Instalar utilitários NVIDIA
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nvidia-utils-550
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
|
- name: Reboot host e esperar voltar
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.reboot:
|
||||||
|
reboot_timeout: 600 # tempo máximo para o host voltar (segundos)
|
||||||
|
test_command: whoami # comando usado para validar que o host voltou
|
||||||
|
|
||||||
|
- name: Adicionar chave GPG da NVIDIA
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit.gpg
|
||||||
|
args:
|
||||||
|
creates: /usr/share/keyrings/nvidia-container-toolkit.gpg
|
||||||
|
|
||||||
|
- name: Adicionar repositório NVIDIA
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
|
||||||
|
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
|
||||||
|
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||||
|
args:
|
||||||
|
creates: /etc/apt/sources.list.d/nvidia-container-toolkit.list
|
||||||
|
|
||||||
|
- name: Atualizar cache de pacotes
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
- name: Instalar NVIDIA Container Toolkit
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nvidia-container-toolkit
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
|
- name: Configurar runtime containerd
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
nvidia-ctk runtime configure --runtime=containerd
|
||||||
|
|
||||||
|
- name: Reiniciar containerd
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: containerd
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado nvidia-smi
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: nvidia_smi_output.stdout
|
||||||
|
|
||||||
17
roles/nvidia/files/time-slicing-config.yaml
Normal file
17
roles/nvidia/files/time-slicing-config.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: time-slicing-config-all
|
||||||
|
namespace: gpu-operator
|
||||||
|
data:
|
||||||
|
any: |-
|
||||||
|
version: v1
|
||||||
|
flags:
|
||||||
|
migStrategy: none
|
||||||
|
sharing:
|
||||||
|
timeSlicing:
|
||||||
|
renameByDefault: false
|
||||||
|
failRequestsGreaterThanOne: false
|
||||||
|
resources:
|
||||||
|
- name: nvidia.com/gpu
|
||||||
|
replicas: 4
|
||||||
67
roles/nvidia/tasks/main.yml
Normal file
67
roles/nvidia/tasks/main.yml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
- name: Adicionar repositório Helm do nvida gpu
|
||||||
|
command: >
|
||||||
|
helm repo add nvidia https://nvidia.github.io/gpu-operator
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Atualizar repositórios Helm
|
||||||
|
command: helm repo update
|
||||||
|
|
||||||
|
- name: Instalar nvida gpu Driver via Helm
|
||||||
|
command: helm upgrade --install nvidia-operator nvidia/gpu-operator --namespace gpu-operator --create-namespace
|
||||||
|
register: resultado_nvidia
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
|
|
||||||
|
- name: Mostrar resultado do nvida gpu Driver
|
||||||
|
debug:
|
||||||
|
var: resultado_nvidia.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Remover o diretório /tmp/nvidia/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/nvidia/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/nvidia/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/nvidia/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/nvidia/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o files
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/nvidia/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o files
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl patch clusterpolicies.nvidia.com/cluster-policy -n gpu-operator --type merge -p "{\"spec\": {\"devicePlugin\": {\"config\": {\"name\": \"time-slicing-config-all\", \"default\": \"any\"}}}}"
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
|
|
||||||
|
|
||||||
67
roles/prowlarr/files/prowlarr-deployment.yaml
Normal file
67
roles/prowlarr/files/prowlarr-deployment.yaml
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: prowlarr
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: prowlarr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: prowlarr
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: prowlarr
|
||||||
|
image: lscr.io/linuxserver/prowlarr:2.1.5
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 9696
|
||||||
|
name: webui
|
||||||
|
env:
|
||||||
|
- name: PUID
|
||||||
|
value: "1013"
|
||||||
|
- name: PGID
|
||||||
|
value: "1013"
|
||||||
|
- name: TZ
|
||||||
|
value: 'Etc/UTC'
|
||||||
|
- name: PROWLARR__POSTGRES__HOST
|
||||||
|
value: 'stolon-proxy-service.postgresql.svc.cluster.local'
|
||||||
|
- name: PROWLARR__POSTGRES__USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prowlarr-secret
|
||||||
|
key: username
|
||||||
|
- name: PROWLARR__POSTGRES__PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prowlarr-secret
|
||||||
|
key: password
|
||||||
|
- name: PROWLARR__POSTGRES__MAINDB
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prowlarr-secret
|
||||||
|
key: maindb
|
||||||
|
- name: PROWLARR__POSTGRES__LOGDB
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: prowlarr-secret
|
||||||
|
key: logsdb
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: prowlarr-config-pvc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
11
roles/prowlarr/files/prowlarr-nfs-csi.yaml
Normal file
11
roles/prowlarr/files/prowlarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/prowlarr
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
30
roles/prowlarr/files/prowlarr-pvcs.yaml
Normal file
30
roles/prowlarr/files/prowlarr-pvcs.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-config-pv
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 2Gi
|
||||||
|
storageClassName: prowlarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
nfs:
|
||||||
|
server: 192.168.1.22
|
||||||
|
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/prowlarr/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-config-pvc
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
storageClassName: prowlarr-nfs-csi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeName: prowlarr-config-pv
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 2Gi
|
||||||
|
---
|
||||||
11
roles/prowlarr/files/prowlarr-secret.yaml
Normal file
11
roles/prowlarr/files/prowlarr-secret.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-secret
|
||||||
|
namespace: stack-arr
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
username: dXNlcm5hbWU=
|
||||||
|
password: cGFzc3dvcmQ=
|
||||||
|
maindb: bWFpbmRiLXByb3dsYXJy
|
||||||
|
logsdb: bG9nZGItcHJvd2xhcnI=
|
||||||
12
roles/prowlarr/files/prowlarr-service.yaml
Normal file
12
roles/prowlarr/files/prowlarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: prowlarr-service
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 9696
|
||||||
|
targetPort: 9696
|
||||||
|
selector:
|
||||||
|
app: prowlarr
|
||||||
|
type: ClusterIP
|
||||||
51
roles/prowlarr/tasks/main.yml
Normal file
51
roles/prowlarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
- name: Remover o diretório /tmp/stack-arr/prowlarr/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/stack-arr/prowlarr/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/stack-arr/prowlarr/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Copy file with owner and permissions
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ../files
|
||||||
|
dest: /tmp/stack-arr/prowlarr/kubernetes-files
|
||||||
|
owner: fenix
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
- name: Obter várias notas do Bitwarden
|
||||||
|
shell: |
|
||||||
|
echo "unlock"
|
||||||
|
BW_SESSION=$(bw unlock {{ bw_password }} --raw)
|
||||||
|
echo "get item"
|
||||||
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
|
loop:
|
||||||
|
- { id: "iac.ansible.stackarr.prowlarr.secret", dest: "/tmp/stack-arr/prowlarr/kubernetes-files/files/prowlarr-secret.yaml" }
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
environment:
|
||||||
|
BW_PASSWORD: "{{ BW_PASSWORD }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Listar conteúdo do diretório remoto
|
||||||
|
shell: ls -l /tmp/stack-arr/prowlarr/kubernetes-files/files
|
||||||
|
register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
- name: Mostrar resultado do ls
|
||||||
|
debug:
|
||||||
|
var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o stolon
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f /tmp/stack-arr/prowlarr/kubernetes-files/files/
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
4
roles/prowlarr/vars/main.yml
Normal file
4
roles/prowlarr/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bw_password: "{{ lookup('env', 'BW_PASSWORD') }}"
|
||||||
|
VAULTWARDEN_LINK: "{{ lookup('env', 'VAULTWARDEN_LINK') }}"
|
||||||
|
BW_CLIENTID: "{{ lookup('env', 'BW_CLIENTID') }}"
|
||||||
|
BW_CLIENTSECRET : "{{ lookup('env', 'BW_CLIENTSECRET') }}"
|
||||||
9
roles/qbittorrent/files/docker-secrets.yaml
Normal file
9
roles/qbittorrent/files/docker-secrets.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: regcred
|
||||||
|
namespace: stack-arr
|
||||||
|
data:
|
||||||
|
.dockerconfigjson: >-
|
||||||
|
eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRvY2tlci5pby92MS8iOnsidXNlcm5hbWUiOiJ1c2VyIiwicGFzc3dvcmQiOiJwYXNzIiwiYXV0aCI6ImRmamlla2ZlcldFS1dFa29mY2RrbzM0MzUzZmQ9In19fQ==
|
||||||
|
type: kubernetes.io/dockerconfigjson
|
||||||
69
roles/qbittorrent/files/qbittorrent-deployment.yaml
Normal file
69
roles/qbittorrent/files/qbittorrent-deployment.yaml
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: qbittorrentvpn
|
||||||
|
namespace: stack-arr
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: qbittorrentvpn
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: qbittorrentvpn
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- name: qbittorrentvpn
|
||||||
|
image: j4ym0/pia-qbittorrent:5.1.2-ubuntu
|
||||||
|
securityContext:
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
name: webui
|
||||||
|
- containerPort: 51413
|
||||||
|
name: torrent-tcp
|
||||||
|
- containerPort: 51413
|
||||||
|
name: torrent-udp
|
||||||
|
protocol: UDP
|
||||||
|
env:
|
||||||
|
- name: USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: vpn-secret
|
||||||
|
key: username
|
||||||
|
- name: PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: vpn-secret
|
||||||
|
key: password
|
||||||
|
- name: REGION
|
||||||
|
value: "Netherlands" # ou outro servidor PIA
|
||||||
|
- name: WEBUI_PORT
|
||||||
|
value: "8080"
|
||||||
|
- name: DNS_SERVERS
|
||||||
|
value: "1.1.1.1,1.0.0.1"
|
||||||
|
- name: UID
|
||||||
|
value: "1013"
|
||||||
|
- name: GID
|
||||||
|
value: "1013"
|
||||||
|
- name: PORT_FORWARDING
|
||||||
|
value: 'true'
|
||||||
|
- name: HOSTHEADERVALIDATION
|
||||||
|
value: 'false'
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /config
|
||||||
|
- name: downloads
|
||||||
|
mountPath: /downloads
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-config-pvc
|
||||||
|
- name: downloads
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: qbittorrent-downloads-pvc
|
||||||
4
roles/qbittorrent/files/qbittorrent-namespace.yaml
Normal file
4
roles/qbittorrent/files/qbittorrent-namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: stack-arr
|
||||||
11
roles/qbittorrent/files/qbittorrent-nfs-csi.yaml
Normal file
11
roles/qbittorrent/files/qbittorrent-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: qbittorrent-nfs-csi
|
||||||
|
namespace: stack-arr
|
||||||
|
provisioner: nfs.csi.k8s.io
|
||||||
|
parameters:
|
||||||
|
server: 192.168.1.22
|
||||||
|
share: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bittorrent
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
reclaimPolicy: Retain
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user