Fix pre-commit hooks and move directories
roles/ and inventory/ are now in playbooks/ also fixed issues reported by ansible-lint
This commit is contained in:
		
							parent
							
								
									dc398ddb6e
								
							
						
					
					
						commit
						4104057771
					
				
					 123 changed files with 91 additions and 39 deletions
				
			
		
							
								
								
									
										6
									
								
								playbooks/roles/backup/files/hooks/immich_database
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										6
									
								
								playbooks/roles/backup/files/hooks/immich_database
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| backup_path="$1" | ||||
| 
 | ||||
| cd /opt/services/immich || exit | ||||
| docker compose exec database sh -c 'pg_dump -U "$DB_USERNAME" "$DB_DATABASE"' | gzip >"$backup_path/immich.sql.gz" | ||||
							
								
								
									
										5
									
								
								playbooks/roles/backup/files/hooks/mailcowdockerized
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										5
									
								
								playbooks/roles/backup/files/hooks/mailcowdockerized
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| export MAILCOW_BACKUP_LOCATION="$1" | ||||
| 
 | ||||
| /opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all --delete-days 1 | ||||
							
								
								
									
										15
									
								
								playbooks/roles/backup/files/hooks/postgresql
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								playbooks/roles/backup/files/hooks/postgresql
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| cd "$1" | ||||
| 
 | ||||
| postgres_tables=$(sudo -u postgres psql -Atc "SELECT datname FROM pg_database WHERE datistemplate = false;") | ||||
| 
 | ||||
| for i in $postgres_tables | ||||
| do | ||||
| 	printf "dumping %s ..." "$i" | ||||
| 	sudo -u postgres pg_dump "$i" | gzip >"pg_dump_$i.sql.gz" | ||||
| 	echo " done" | ||||
| done | ||||
| 
 | ||||
| echo "dumping all" | ||||
| sudo -u postgres pg_dumpall | gzip >"pg_dumpall.sql.gz" | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue