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

     - name: Add user to server
       remote_user: taskd
       environment:
         TASKDDATA: /home/taskd/data
       tags:
       - one-time
       shell: |
         taskd add org 'eug-vs-xyz'
         taskd add user 'eug-vs-xyz' 'eug-vs'
         ls ~/data/orgs/eug-vs-xyz/users > /tmp/taskd-user-id

     - name: Configure taskwarrior client
       shell: |
         mkdir -p ~/.config/task
         echo "confirmation=off" > ~/.taskrc
         task config taskd.certificate -- ~/.config/task/api.cert.pem
         task config taskd.key         -- ~/.config/task/api.key.pem
         task config taskd.ca          -- ~/.config/task/ca.cert.pem
         task config taskd.server      -- taskd.eug-vs.xyz:53589
         task config taskd.credentials -- eug-vs-xyz\/eug-vs\/$(cat /tmp/taskd-user-id)
         task config taskd.trust       -- ignore hostname
         mv ~/.taskrc ~/.config/task/taskrc.server
         echo "include ~/.config/task/taskrc.server" > ~/.taskrc

     - name: Copy certificates
       become: true
       shell: |
         cd /tmp/taskserver/pki
         cp api.*.pem /home/eug-vs/.config/task
         cp ca.cert.pem /home/eug-vs/.config/task
         chown -R eug-vs:eug-vs /home/eug-vs/.config/task

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