summaryrefslogtreecommitdiff
path: root/chaos-at-home/r3-0x10.yml
blob: 267bc5960ccec4bfa27240c7bd952e8f2e5fb3d0 (plain) (blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: Basic Setup
  hosts: r3-0x10
  roles:
  - role: apt-repo/base
  - role: core/base
  - role: core/sshd/base
  - role: core/zsh
  - role: core/ntp

- name: Payload Setup
  hosts: r3-0x10
  roles:
  - role: nginx/base
  - role: apt-repo/spreadspace
  - role: x509/acmetool/base
  post_tasks:
  - name: install git and golang
    apt:
      name:
      - git
      - go
      state: present

  - name: checkout telme10 repo
    git:
      repo: 'https://github.com/realraum/telme10.git'
      dest: /srv/telme10

  - name: configure default vhost 0x10.r3.at
    vars:
      nginx_vhost:
        default: yes
        name: 0x10
        template: generic
        tls:
          certificate_provider: acmetool
        hostnames:
        - 0x10.r3.at
        - 0x10.realraum.at
        locations:
          '/':
            root: /srv/telme10/web
            index: index.html
    include_role:
      name: nginx/vhost

  - name: create user for telme10
    user:
      name: telme10
      home: /var/lib/telme10
      system: yes

  - name: build telme10
    command: go build -tags netgo
    args:
      chdir: /srv/telme10
      creates: /srv/telme10/telme10

  - name: install systemd service units
    loop:
    - socket
    - service
    copy:
      src: "/srv/telme10/telme10.{{ item }}"
      remote_src: yes
      dest: "/etc/systemd/system/telme10.{{ item }}"

  - name: make sure the systemd socket unit is enabled and started
    systemd:
      daemon_reload: yes
      name: telme10.socket
      enabled: yes
      state: started