restic: role for installing restic client
							parent
							
								
									74f9120957
								
							
						
					
					
						commit
						c38bda8dfd
					
				| 
						 | 
				
			
			@ -11,3 +11,4 @@ lander_commit_sha: 'e438bd045ca2ee64e3d9ab98f416027b5417c3f6'
 | 
			
		|||
lander_api_key: "{{ vault_lander_api_key }}"
 | 
			
		||||
 | 
			
		||||
restic_rest_version: '0.12.1'
 | 
			
		||||
restic_version: '0.16.2'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										7
									
								
								nas.yml
								
								
								
								
							
							
						
						
									
										7
									
								
								nas.yml
								
								
								
								
							| 
						 | 
				
			
			@ -62,3 +62,10 @@
 | 
			
		|||
  roles:
 | 
			
		||||
    - restic-rest
 | 
			
		||||
  tags: restic-rest
 | 
			
		||||
 | 
			
		||||
- name: Install Restic
 | 
			
		||||
  hosts: nas
 | 
			
		||||
  become: yes
 | 
			
		||||
  roles:
 | 
			
		||||
    - restic
 | 
			
		||||
  tags: restic
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,9 @@
 | 
			
		|||
 | 
			
		||||
      # Periodic tasks
 | 
			
		||||
      - cron
 | 
			
		||||
 | 
			
		||||
      # General compression tools
 | 
			
		||||
      - bzip2
 | 
			
		||||
    state: present
 | 
			
		||||
 | 
			
		||||
- name: Ensure cron service is enabled
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,27 @@
 | 
			
		|||
---
 | 
			
		||||
- name: Ensure download directory is present
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
    path: "/home/debian/restic-{{ restic_version }}"
 | 
			
		||||
    state: directory
 | 
			
		||||
    mode: '0755'
 | 
			
		||||
 | 
			
		||||
- name: Ensure compressed binary is downloaded
 | 
			
		||||
  ansible.builtin.get_url:
 | 
			
		||||
    url: "https://github.com/restic/restic/releases/download/v{{ restic_version }}/restic_{{ restic_version }}_linux_arm64.bz2"
 | 
			
		||||
    dest: "/home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
 | 
			
		||||
  register: res
 | 
			
		||||
 | 
			
		||||
- name: Ensure binary is decompressed
 | 
			
		||||
  ansible.builtin.shell:
 | 
			
		||||
    cmd: "bunzip2 -k /home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}.bz2"
 | 
			
		||||
  when: 'res.changed'
 | 
			
		||||
 | 
			
		||||
- name: Ensure binary is copied to correct location
 | 
			
		||||
  ansible.builtin.copy:
 | 
			
		||||
    src: "/home/debian/restic-{{ restic_version }}/restic-{{ restic_version }}"
 | 
			
		||||
    remote_src: true
 | 
			
		||||
    dest: '/usr/local/bin/restic'
 | 
			
		||||
    owner: 'root'
 | 
			
		||||
    group: 'root'
 | 
			
		||||
    mode: '0755'
 | 
			
		||||
  when: 'res.changed'
 | 
			
		||||
		Loading…
	
		Reference in New Issue