aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/borg-client/tasks
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-15 09:00:49 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-15 09:01:30 +0200
commit4bd33c6a46f57f8a830042795cfaa68ef91963a9 (patch)
tree50aba86781f2725ddadeeb52cc5d7b4853da6eee /ansible/roles/borg-client/tasks
parent9846c2636282e1a62b53b34a54854423e7d6dbac (diff)
downloadinfra-4bd33c6a46f57f8a830042795cfaa68ef91963a9.tar.gz
infra-4bd33c6a46f57f8a830042795cfaa68ef91963a9.tar.bz2
infra-4bd33c6a46f57f8a830042795cfaa68ef91963a9.tar.xz
infra-4bd33c6a46f57f8a830042795cfaa68ef91963a9.zip
o Removing old borg code.
Diffstat (limited to 'ansible/roles/borg-client/tasks')
-rw-r--r--ansible/roles/borg-client/tasks/borg-client.yml115
-rw-r--r--ansible/roles/borg-client/tasks/main.yml3
2 files changed, 0 insertions, 118 deletions
diff --git a/ansible/roles/borg-client/tasks/borg-client.yml b/ansible/roles/borg-client/tasks/borg-client.yml
deleted file mode 100644
index 92aba57..0000000
--- a/ansible/roles/borg-client/tasks/borg-client.yml
+++ /dev/null
@@ -1,115 +0,0 @@
----
-- name: packages
- tags: packages
- apt:
- name: "{{ items }}"
- install_recommends: no
- vars:
- items:
- - borgbackup
-
-- name: mkdir /etc/borg
- file:
- path: /etc/borg
- state: directory
- mode: u=rwx,go=
-
-- name: Generate SSH keys
- command: ssh-keygen -t ed25519 -N "" -f "{{ ssh_key }}" -C "for borg @ {{ ansible_hostname }}"
- args:
- creates: "{{ ssh_key }}"
- register: ssh_key_generated
-
-- when: ssh_key_generated.changed
- fetch:
- src: "{{ ssh_key }}.pub"
- dest: "files"
-
-- name: /etc/borg/env
- copy:
- dest: /etc/borg/env
- mode: u=r,go=
- content: |
- BORG_REPO="borg@{{ borg_client__server }}:{{ ansible_hostname }}"
- BORG_RSH="ssh -i {{ ssh_key}}"
-
-# "
-
-- name: /etc/borg/excludes
- when: borg_client__state == "absent"
- file:
- path: /etc/borg/excludes
- state: absent
-
-- name: /etc/borg/excludes
- when: borg_client__state == "present"
- copy:
- dest: /etc/borg/excludes
- content: |
- /proc
- /dev
- /sys
- /run
-
-- name: /etc/borg/patterns
- copy:
- dest: /etc/borg/patterns
- content: |
- P sh
- R /
- {% for item in borg_client__patterns %}
- {{ item }}
- {% endfor %}
-
-- name: /usr/local/bin/create-backup
- template:
- dest: "/usr/local/bin/{{ item }}"
- src: "bin/{{ item }}"
- mode: u=rwx,go=rx
- owner: root
- group: root
- with_items:
- - create-backup
- - create-backup-send-email
-
-- name: /etc/systemd/system/create-backup.service
- copy:
- dest: /etc/systemd/system/create-backup.service
- content: |
- [Unit]
- Description=Create backup
- # After=network-online.target
- # Wants=network-online.target
-
- [Service]
- Type=oneshot
- WorkingDirectory=/
- ExecStart=-/usr/local/bin/create-backup
- ExecStartPost=-/usr/local/bin/create-backup-send-email root@trygvis.io
- SuccessExitStatus=0 1
- notify:
- - systemctl daemon-reload
-
-- name: /etc/systemd/system/create-backup.timer
- copy:
- dest: /etc/systemd/system/create-backup.timer
- content: |
- [Unit]
- Description=Create backup timer
-
- [Timer]
- OnCalendar=05:24
-
- [Install]
- WantedBy=timers.target
- notify:
- - systemctl daemon-reload
- - service start create-backup.timer
-
-# TODO: remove
-- file:
- path: /etc/systemd/system/create-backup-send-email.service
- state: absent
- register: create_backup_send_email_service
- notify:
- - systemctl daemon-reload
diff --git a/ansible/roles/borg-client/tasks/main.yml b/ansible/roles/borg-client/tasks/main.yml
deleted file mode 100644
index 1afab33..0000000
--- a/ansible/roles/borg-client/tasks/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-- become: yes
- tags: borg-client
- import_tasks: borg-client.yml