diff --git a/ansible/atlas.yml b/ansible/atlas.yml index 63dde04..dabe0ab 100644 --- a/ansible/atlas.yml +++ b/ansible/atlas.yml @@ -43,5 +43,4 @@ - {role: postgresql, tags: postgresql} - {role: githubixx.ansible_role_wireguard, tags: wireguard} - {role: ssh_ca, tags: ssh_ca} - # - {role: backup, tags: backup} - {role: backupng, tags: backupng} diff --git a/ansible/roles/backup/backup_control.sh b/ansible/roles/backup/backup_control.sh deleted file mode 100644 index 7563250..0000000 --- a/ansible/roles/backup/backup_control.sh +++ /dev/null @@ -1,15 +0,0 @@ -VIRSH="virsh --connect qemu:///system" -read -p "" option -case "$option" in - up) - for i in $($VIRSH list --all --name --autostart); do $VIRSH start "$i"; done - ;; - down) - for i in $($VIRSH list --state-running --name --autostart); do - $VIRSH shutdown "$i" - until $VIRSH domstate "$i" | grep shut; do - sleep 0.5 - done - done - ;; -esac diff --git a/ansible/roles/backup/handlers/main.yml b/ansible/roles/backup/handlers/main.yml deleted file mode 100644 index 18c505e..0000000 --- a/ansible/roles/backup/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: restart sshd - systemd: - name: sshd - state: restarted diff --git a/ansible/roles/backup/sshd.conf.j2 b/ansible/roles/backup/sshd.conf.j2 deleted file mode 100644 index a8ea7ea..0000000 --- a/ansible/roles/backup/sshd.conf.j2 +++ /dev/null @@ -1,14 +0,0 @@ -TrustedUserCAKeys /etc/ssh/user_ca_key.pub - -Match User {{ backup_share_user }} - AuthorizedPrincipalsFile /etc/ssh/backup_principals - ChrootDirectory /kvm/data - ForceCommand internal-sftp - AllowTcpForwarding no - X11Forwarding no - -Match User {{ backup_control_user }} - AuthorizedPrincipalsFile /etc/ssh/backup_principals - ForceCommand /home/{{ backup_control_user }}/control.sh - AllowTcpForwarding no - X11Forwarding no diff --git a/ansible/roles/backup/tasks/main.yml b/ansible/roles/backup/tasks/main.yml deleted file mode 100644 index 84bf409..0000000 --- a/ansible/roles/backup/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -- name: Add backup share user - user: - name: "{{ backup_share_user }}" - create_home: false - password: '!' - shell: /sbin/nologin - system: true -- name: Add backup control user - user: - name: "{{ backup_control_user }}" - password: '!' - shell: /usr/bin/sh - system: true - groups: "libvirt" -- name: Copy control script - copy: - src: "backup_control.sh" - dest: "/home/{{ backup_control_user }}/control.sh" - owner: "{{ backup_control_user }}" - group: "{{ backup_control_user }}" - mode: u=rx,g=rx,o=rx -- name: Add backup user principals file - copy: - dest: "/etc/ssh/backup_principals" - content: "backup" -- name: Install user CA - copy: - dest: "/etc/ssh/user_ca_key.pub" - content: "{{ user_ca }}" -- name: Copy ssh config for backup user - template: - src: "sshd.conf.j2" - dest: "/etc/ssh/sshd_config.d/custom.conf" - notify: restart sshd