--- - name: Install taskd hosts: raspberry tasks: # Installation # TODO: install from repository when finally supported for aarch64 - name: Install build tools tags: - slow apt: pkg: - gcc - make - cmake - gnutls-dev - uuid-dev - name: Build taskd from source tags: - slow shell: | cd /tmp git clone --recursive https://github.com/GothenburgBitFactory/taskserver.git cd taskserver cmake -DCMAKE_BUILD_TYPE=release . make - name: Install taskd become: true shell: | 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: Push vars for generating keys copy: src: ./files/taskd/vars dest: /tmp/taskserver/pki - name: Generate keys & certificates become: true 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 - name: Add hostname become: true shell: echo "192.168.0.131 taskd.eug-vs.xyz" >> /etc/hosts - name: Create systemd unit copy: src: ./files/taskd/taskd.service dest: /etc/systemd/system - name: Enable and start the service become: true systemd: name: taskd state: restarted