mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-02-04 15:53:28 +00:00
anchorr
This commit is contained in:
@ -36,4 +36,5 @@
|
||||
- bazarr
|
||||
- libreTranslate
|
||||
- lingarr
|
||||
- cripto
|
||||
- cripto
|
||||
- anchorr
|
||||
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') }}"
|
||||
@ -17,7 +17,7 @@ spec:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: jellyfin
|
||||
image: lscr.io/linuxserver/jellyfin:10.11.2
|
||||
image: lscr.io/linuxserver/jellyfin:10.11.5
|
||||
resources:
|
||||
limits:
|
||||
memory: "9G" # Maximum memory allowed
|
||||
|
||||
@ -27,4 +27,10 @@ spec:
|
||||
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
|
||||
@ -42,7 +42,7 @@ spec:
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
nfs:
|
||||
server: 192.168.1.22
|
||||
path: /mnt/fenix-main-nas-pool-0/data/k8s-Volumes/k8s-cluster-iac-deployed/stack-arr/bittorrent/downloads
|
||||
path: /mnt/fenix-main-nas-pool-0/data/Filmes_e_Series/Downloads
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
|
||||
Reference in New Issue
Block a user