various fix

switch from cron to systemd
bypass hadoly anubis protection
This commit is contained in:
2026-02-15 10:00:59 +01:00
parent c111d737bb
commit 5b57905b21
5 changed files with 26 additions and 13 deletions

View File

@@ -1,2 +1,5 @@
---
# handlers file for borg_client
# handlers file for borg_client
- name: reload systemd
ansible.builtin.systemd_service:
daemon_reload: true

View File

@@ -1,3 +1,8 @@
- name: remove old cronfile
ansible.builtin.file:
path: /etc/cron.d/backup
state: absent
- name: Deploy systemd service and timer unit files
ansible.builtin.template:
src: "{{ item }}"

View File

@@ -24,12 +24,19 @@
state: directory
- name: get borgbackup script
ansible.builtin.get_url:
url: "{{ item.url }}"
mode: "{{ item.mode }}"
delegate_to: localhost
become: false
ansible.builtin.git:
repo: "ssh://git@git-ssh.hadoly.fr:6900/CS_CT/borg.git"
dest: "/home/tom/tmp/borg"
- name: copy script
ansible.builtin.copy:
src: /home/tom/tmp/borg/borg.sh
dest: "{{ borg_script_dir }}"
loop:
- { url: "https://git.hadoly.fr/CS_CT/borg/raw/tag/1.0/borg.sh", mode: "0700" }
mode: 0700
owner: root
group: root
- name: get borgbackup config
vars:

View File

@@ -9,7 +9,7 @@
owner: root
group: root
- name: create repo
- name: create repo directory
file:
path: "{{ borg_remote_dir }}{{ inventory_hostname }}"
state: directory
@@ -37,15 +37,13 @@
delegate_to: "{{ borg_server }}"
- name: check if repository is created
tags: wip
delegate_to: "{{ borg_server }}"
ansible.builtin.stat:
path: "{{ borg_remote_dir }}{{ inventory_hostname }}/config"
register: repo_content
- name: create repository
tags: wip
when: repo_content.stat.isfile is not defined
when: repo_content.stat.exists == false
ansible.builtin.command: "/usr/bin/borg init --encryption=keyfile {{ borg_account }}@{{ borg_server }}:{{ borg_remote_dir }}{{ inventory_hostname }}"
environment:
BORG_PASSPHRASE: "{{ borg_passphrase }}"

View File

@@ -1,9 +1,9 @@
# {{ansible_managed}}
# this file was created from the role: {{ ansible_role_name }}
[Unit]
Description = get installed packages list
Description = do a borg backup
[Service]
Type = oneshot
ExecStart = {{ borg_script_dir }}/borg.sh
User = tom
ExecStart = {{ borg_script_dir }}/borg.sh create
User = root