From 0e6284bbb63bad57189d2ef2107d118fa764ad6e Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Fri, 14 Jun 2024 16:41:42 -0700 Subject: [PATCH] updated scripts to include new programs --- inventory/hosts.yaml | 7 ++++++- playbooks/apt_qol.yaml | 6 +++++- roles/restic/files/.autorestic.yml | 19 +++++++++++++++++++ roles/restic/tasks/main.yml | 22 ++++++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 roles/restic/files/.autorestic.yml create mode 100644 roles/restic/tasks/main.yml diff --git a/inventory/hosts.yaml b/inventory/hosts.yaml index 23130c7..3e051d3 100644 --- a/inventory/hosts.yaml +++ b/inventory/hosts.yaml @@ -6,7 +6,12 @@ docker: ansible_become_pass: '{{ std_become_pass }}' 10.100.50.40: ansible_become_pass: '{{ std_become_pass }}' - + 10.0.50.154: + ansible_become_pass: '{{ std_become_pass }}' +automation: + hosts: + 10.0.50.70: + ansible_become_pass: '{{ std_become_pass }}' db: hosts: 10.0.50.60: diff --git a/playbooks/apt_qol.yaml b/playbooks/apt_qol.yaml index 42319cd..7448ff9 100644 --- a/playbooks/apt_qol.yaml +++ b/playbooks/apt_qol.yaml @@ -3,8 +3,9 @@ vars_files: - '~/ansible/inventory/vaulted_vars.yaml' become: yes + gather_facts: no tasks: - - name: Install user default applications. tmux, vim-nox, btop, htop, neofetch + - name: Install user default applications. tmux, vim-nox, btop, htop, neofetch, bat, tldr, byobu apt: pkg: - tmux @@ -14,5 +15,8 @@ - neofetch - curl - wget + - bat + - tldr + - byobu update_cache: true state: latest diff --git a/roles/restic/files/.autorestic.yml b/roles/restic/files/.autorestic.yml new file mode 100644 index 0000000..ac8adfc --- /dev/null +++ b/roles/restic/files/.autorestic.yml @@ -0,0 +1,19 @@ +version: 2 + +locations: + db: + from: /srv/backups/somefile + to: esh-local + options: + forget: + keep-last: 5 + keep-daily: 7 + keep-weekly: 4 + keep-monthly: 12 + keep-yearly: 7 + +backends: + esh-local: + type: local + path: /mnt/backup/restic/repo/esh + key: 'Reputable-Evidence-Feed5-Undergo' diff --git a/roles/restic/tasks/main.yml b/roles/restic/tasks/main.yml new file mode 100644 index 0000000..3e62cba --- /dev/null +++ b/roles/restic/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: create backup folder + file: + path: "/srv/backups/autorestic/" + state: directory + +- name: copy configuration + copy: + src: .autorestic.yml + dest: "/srv/backups/autorestic/.autorestic.yml" + +- name: Get autorestic installer + get_url: + url: https://raw.githubusercontent.com/cupcakearmy/autorestic/master/install.sh + dest: /tmp/autorestic_install.sh + mode: '0755' + +- name: Install autorestic + shell: + cmd: /tmp/autorestic_install.sh + executable: /bin/sh + become: yes