summaryrefslogtreecommitdiff
path: root/ansible/roles/holywood2/tasks/main.yml
blob: 2bcb304f1f131518b3b8ca45dab6d47398b0d39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
- name: create soile group
  group:
    name: soile
    gid: 501

- name: create soile account
  user:
    name: soile
    comment: Soile Mottisenkangas
    createhome: no
    group: soile
    uid: 501

- name: install NFS server
  apt:
    name: nfs-kernel-server

- name: install /etc/exports
  copy:
    src: exports
    dest: /etc/exports
    owner: root
    group: root
    mode: 0644

- name: install borg
  apt:
    name: borgbackup
#    default_release: stretch-backports

- name: install borg scripting
  copy:
    src: "{{ item }}"
    dest: /root
    owner: root
    group: root
    mode: 0755
  with_items:
    - run-borg
    - borg-all

- name: install borg passphrase
  copy:
    content: "{{ lookup('pipe', 'pass borg/holywood2-to-willikins') }}"
    dest: /etc/borg-passphrase
    owner: root
    group: root
    mode: 0600

- name: run borg from cron
  copy:
    content: |
      20 7 * * * root /root/borg-all
    dest: /etc/cron.d/local-backup
    owner: root
    group: root
    mode: 0755