From c3ee4cf837d6481aef21af3b195380df6e74d12c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 31 Jan 2022 12:50:32 -0500 Subject: [PATCH] Don't run reboot step comment it out for future use --- playbooks/manjaro.yaml | 70 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/playbooks/manjaro.yaml b/playbooks/manjaro.yaml index 12906ef..5d8a6c1 100644 --- a/playbooks/manjaro.yaml +++ b/playbooks/manjaro.yaml @@ -435,10 +435,74 @@ - canonicalization - regions + # Backup + - name: Create backup mount directory + file: + state: directory + path: '/mnt/backup0' + become: yes + tags: backup + - name: Ensure backup0 device exists in crypttab + community.general.crypttab: + name: backup0 + backing_device: UUID=1d7ce570-e695-47a0-9dda-5f14b5b20e21 + password: /home/ducoterra/.lukskeys/backup0 + opts: luks + state: present + become: yes + no_log: true + tags: backup + - name: Ensure backup0 mount exists in fstab + ansible.posix.mount: + path: /mnt/backup0 + src: /dev/mapper/backup0 + fstype: btrfs + opts: defaults,noatime,compress=zstd + state: present + become: yes + tags: backup + - name: Ensure /usr/local/scripts exists + file: + state: directory + path: '/usr/local/scripts' + become: yes + tags: backup + - name: Copy btrfs_backup.sh + ansible.builtin.copy: + src: scripts/btrfs_backup.sh + dest: /usr/local/scripts/btrfs_backup.sh + owner: root + group: root + mode: '0760' + become: yes + tags: backup + - name: Ensure hourly backups of / + ansible.builtin.cron: + name: "hourly backup of /" + minute: "0" + job: "export SOURCE_DIR=/; /usr/local/scripts/btrfs_backup.sh" + become: yes + tags: backup + - name: Ensure hourly backups of /home + ansible.builtin.cron: + name: "hourly backup of /home" + minute: "0" + job: "export SOURCE_DIR=/home; /usr/local/scripts/btrfs_backup.sh" + become: yes + tags: backup + - name: Ensure cronie service started + ansible.builtin.systemd: + name: cronie + state: restarted + daemon_reload: yes + enabled: yes + become: yes + tags: backup + # Secure Boot # https://gist.github.com/umbernhard/d1f4a44430d6d21b3881652c7a7c9ae5 # Reboot - - name: Unconditionally reboot the machine with all defaults - reboot: - become: yes + # - name: Unconditionally reboot the machine with all defaults + # reboot: + # become: yes