mirror of
				https://github.com/MatteZ02/infra.git
				synced 2025-11-04 01:59:33 +00:00 
			
		
		
		
	Tasks Update: Adding Backup tasks
This commit is contained in:
		@@ -29,3 +29,11 @@
 | 
				
			|||||||
      tags:
 | 
					      tags:
 | 
				
			||||||
        - deployer
 | 
					        - deployer
 | 
				
			||||||
        - never
 | 
					        - never
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: "Backup"
 | 
				
			||||||
 | 
					      import_tasks: tasks/backup.yml
 | 
				
			||||||
 | 
					      vars:
 | 
				
			||||||
 | 
					        ansible_python_interpreter: "{{ ansible_facts.user_dir }}/.venv/ansible/bin/python3"
 | 
				
			||||||
 | 
					      tags:
 | 
				
			||||||
 | 
					        - backup
 | 
				
			||||||
 | 
					        - never
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										19
									
								
								tasks/backup.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								tasks/backup.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					- name: "Backup - Minecraft - Stop"
 | 
				
			||||||
 | 
					  containers.podman.podman_container:
 | 
				
			||||||
 | 
					    name: minecraft
 | 
				
			||||||
 | 
					    state: stopped
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: "Backup - Minecraft - Save"
 | 
				
			||||||
 | 
					  community.general.archive:
 | 
				
			||||||
 | 
					    path:
 | 
				
			||||||
 | 
					      - "~/data/minecraft"
 | 
				
			||||||
 | 
					    exclude_path:
 | 
				
			||||||
 | 
					      - "~/data/minecraft/plugins/dynmap/web/tiles"
 | 
				
			||||||
 | 
					    dest: "~/data/backups/minecraft-{{ ansible_facts.date_time.date }}.zip"
 | 
				
			||||||
 | 
					    format: zip
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: "Backup - Minecraft - Start"
 | 
				
			||||||
 | 
					  containers.podman.podman_container:
 | 
				
			||||||
 | 
					    name: minecraft
 | 
				
			||||||
 | 
					    state: started
 | 
				
			||||||
@@ -119,3 +119,12 @@
 | 
				
			|||||||
    job: "~/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/MatteZ02/infra -d ~/.ansible/pull/matte/infra --accept-host-key --private-key ~/.ssh/keys/matte/infra --vault-password-file ~/.ansible/vault/matte.yml tasks.yml -t deployer"
 | 
					    job: "~/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/MatteZ02/infra -d ~/.ansible/pull/matte/infra --accept-host-key --private-key ~/.ssh/keys/matte/infra --vault-password-file ~/.ansible/vault/matte.yml tasks.yml -t deployer"
 | 
				
			||||||
  tags:
 | 
					  tags:
 | 
				
			||||||
    - cron
 | 
					    - cron
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: "Installer : Schedule : Backup"
 | 
				
			||||||
 | 
					  cron:
 | 
				
			||||||
 | 
					    name: "Matte - Infra - Backup"
 | 
				
			||||||
 | 
					    hour: "5"
 | 
				
			||||||
 | 
					    minute: "0"
 | 
				
			||||||
 | 
					    job: "~/.venv/ansible/bin/ansible-pull -U ssh://git@github.com/MatteZ02/infra -d ~/.ansible/pull/matte/infra --accept-host-key --private-key ~/.ssh/keys/matte/infra --vault-password-file ~/.ansible/vault/matte.yml tasks.yml -t backup"
 | 
				
			||||||
 | 
					  tags:
 | 
				
			||||||
 | 
					    - cron
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user