summaryrefslogtreecommitdiff
path: root/task-master-client.yaml
blob: 57f7ec6d198398bff09bf8b666fd8ca0234b1c66 (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
---
- name: Install taskwarrior master client
  hosts: raspberry
  tasks:
     - name: Install taskwarrior
       tags:
       - slow
       apt:
         pkg:
         - taskwarrior

     - name: Add user to server
       become: true
       tags:
       - one-time
       shell: |
         taskd add org 'eug-vs-xyz' --data /var/lib/taskd
         taskd add user 'eug-vs-xyz' 'eug-vs' --data /var/lib/taskd
         chown -R taskd:taskd /var/lib/taskd
         ls /var/lib/taskd/orgs/eug-vs-xyz/users > /home/eug-vs/taskd-user-id

     - name: Generate keys & certificates
       become: true
       shell: |
         mkdir /home/eug-vs/.task
         cd /tmp/taskserver/pki
         ./generate.client eug-vs
         cp eug-vs.*.pem /home/eug-vs/.task
         cp ca.cert.pem /home/eug-vs/.task
         chown -R eug-vs:eug-vs /home/eug-vs/.task

     - name: Create master taskrc
       shell: |
         echo "confirmation=off" >> ~/.taskrc
         task config taskd.certificate -- ~/.task/eug-vs.cert.pem
         task config taskd.key         -- ~/.task/eug-vs.key.pem
         task config taskd.ca          -- ~/.task/ca.cert.pem
         task config taskd.server      -- taskd.eug-vs.xyz:53589
         task config taskd.credentials -- eug-vs-xyz\/eug-vs\/$(cat /home/eug-vs/taskd-user-id)
         task config taskd.trust       -- ignore hostname

     - name: Run task sync init
       shell: task sync init