summaryrefslogtreecommitdiff
path: root/taskd.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'taskd.yaml')
-rw-r--r--taskd.yaml66
1 files changed, 35 insertions, 31 deletions
diff --git a/taskd.yaml b/taskd.yaml
index e006f3c..3d10711 100644
--- a/taskd.yaml
+++ b/taskd.yaml
@@ -1,9 +1,9 @@
---
- name: Install taskd
hosts: raspberry
+ gather_facts: false
tasks:
# Installation
- # TODO: install from repository when finally supported for aarch64
- name: Install build tools
tags:
- slow
@@ -15,7 +15,22 @@
- gnutls-dev
- uuid-dev
+ - name: Create user
+ become: true
+ user:
+ name: taskd
+
+ - name: Add public key to authorized_keys
+ become: true
+ tags:
+ - test
+ authorized_key:
+ user: taskd
+ state: present
+ key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
+
- name: Build taskd from source
+ remote_user: taskd
tags:
- slow
shell: |
@@ -31,53 +46,42 @@
cd /tmp/taskserver
make install
- - name: Create user
- become: true
- user:
- name: taskd
-
# Configuration
- - name: Create data folder
- become: true
- shell: mkdir -p /var/lib/taskd/orgs
-
- - name: Push configuration file
- become: true
- copy:
- src: ./files/taskd/config
- dest: /var/lib/taskd
+ - name: Setup initial config
+ remote_user: taskd
+ environment:
+ TASKDDATA: /home/taskd/data
+ shell: |
+ mkdir -p ~/data/orgs
+ taskd init
+ taskd config server taskd.eug-vs.xyz:53589
- name: Push vars for generating keys
+ remote_user: taskd
copy:
src: ./files/taskd/vars
dest: /tmp/taskserver/pki
- name: Generate keys & certificates
- become: true
+ remote_user: taskd
+ environment:
+ TASKDDATA: /home/taskd/data
shell: |
cd /tmp/taskserver/pki
- sed 's/localhost/taskd.eug-vs.xyz/' -i vars
- sed 's/365/0/' -i vars
./generate
- cp api.*.pem /var/lib/taskd
- cp server.*.pem /var/lib/taskd
- cp ca.cert.pem /var/lib/taskd
-
- - name: Change ownership
- become: true
- shell: chown -R taskd:taskd /var/lib/taskd
-
- - name: Create log file
- become: true
- shell: |
- touch /var/log/taskd.log
- chown -R taskd:taskd /var/log/taskd.log
+ cp server.*.pem ~/data
+ cp ca.cert.pem ~/data
+ taskd config --force server.cert ~/data/server.cert.pem
+ taskd config --force server.key ~/data/server.key.pem
+ taskd config --force server.crl ~/data/server.crl.pem
+ taskd config --force ca.cert ~/data/ca.cert.pem
- name: Add hostname
become: true
shell: echo "192.168.0.131 taskd.eug-vs.xyz" >> /etc/hosts
- name: Create systemd unit
+ become: true
copy:
src: ./files/taskd/taskd.service
dest: /etc/systemd/system