mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-02-04 07:43:31 +00:00
lazylibrarian, bookshelf, suwayomi (mangareader),, shelfarr
testes
This commit is contained in:
@ -38,3 +38,4 @@
|
||||
- lingarr
|
||||
- cripto
|
||||
- anchorr
|
||||
- lazylibrarian
|
||||
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') }}"
|
||||
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') }}"
|
||||
88
roles/mangareader/files/mangareader-deployment.yaml
Normal file
88
roles/mangareader/files/mangareader-deployment.yaml
Normal file
@ -0,0 +1,88 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mangareader
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mangareader
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mangareader
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: mangareader
|
||||
image: ghcr.io/suwayomi/tachidesk:v2.1.2060
|
||||
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: /config
|
||||
- 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: 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
|
||||
---
|
||||
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') }}"
|
||||
56
roles/shelfarr/files/shelfarr-deployment.yaml
Normal file
56
roles/shelfarr/files/shelfarr-deployment.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: shelfarr
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: shelfarr
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: shelfarr
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcred
|
||||
containers:
|
||||
- name: shelfarr
|
||||
image: ghcr.io/pedro-revez-silva/shelfarr:c49adad
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
ports:
|
||||
- containerPort: 5056
|
||||
name: webui
|
||||
env:
|
||||
- name: PUID
|
||||
value: "1013"
|
||||
- name: PGID
|
||||
value: "1013"
|
||||
- name: HTTP_PORT
|
||||
value: "5056"
|
||||
- name: TZ
|
||||
value: 'Etc/UTC'
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /rails/storage
|
||||
- name: books
|
||||
mountPath: /books
|
||||
- name: downloads
|
||||
mountPath: /downloads
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: shelfarr-config-pvc
|
||||
- name: books
|
||||
persistentVolumeClaim:
|
||||
claimName: shelfarr-books-pvc
|
||||
- name: downloads
|
||||
persistentVolumeClaim:
|
||||
claimName: qbittorrent-downloads-pvc
|
||||
|
||||
|
||||
|
||||
11
roles/shelfarr/files/shelfarr-nfs-csi.yaml
Normal file
11
roles/shelfarr/files/shelfarr-nfs-csi.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: shelfarr-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/shelfarr
|
||||
allowVolumeExpansion: true
|
||||
reclaimPolicy: Retain
|
||||
60
roles/shelfarr/files/shelfarr-pvcs.yaml
Normal file
60
roles/shelfarr/files/shelfarr-pvcs.yaml
Normal file
@ -0,0 +1,60 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: shelfarr-config-pv
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
capacity:
|
||||
storage: 20Gi
|
||||
storageClassName: shelfarr-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/shelfarr/config
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: shelfarr-config-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: shelfarr-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: shelfarr-config-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: shelfarr-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: shelfarr-books-pvc
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
storageClassName: jellyfin-videos-nfs-csi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
volumeName: shelfarr-media-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
---
|
||||
12
roles/shelfarr/files/shelfarr-service.yaml
Normal file
12
roles/shelfarr/files/shelfarr-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: shelfarr-service
|
||||
namespace: stack-arr
|
||||
spec:
|
||||
ports:
|
||||
- port: 5056
|
||||
targetPort: 5056
|
||||
selector:
|
||||
app: shelfarr
|
||||
type: ClusterIP
|
||||
51
roles/shelfarr/tasks/main.yml
Normal file
51
roles/shelfarr/tasks/main.yml
Normal file
@ -0,0 +1,51 @@
|
||||
- name: Remover o diretório /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
ansible.builtin.file:
|
||||
path: /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
state: absent
|
||||
|
||||
- name: Criar diretório temporário no remoto
|
||||
file:
|
||||
path: /tmp/stack-arr/shelfarr/kubernetes-files
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Copy file with owner and permissions
|
||||
ansible.builtin.copy:
|
||||
src: ../files
|
||||
dest: /tmp/stack-arr/shelfarr/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.shelfarr.secret", dest: "/tmp/stack-arr/shelfarr/kubernetes-files/files/shelfarr-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/shelfarr/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/shelfarr/kubernetes-files/files/
|
||||
environment:
|
||||
KUBECONFIG: /home/fenix/.kube/config
|
||||
4
roles/shelfarr/vars/main.yml
Normal file
4
roles/shelfarr/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') }}"
|
||||
Reference in New Issue
Block a user