summaryrefslogtreecommitdiff
path: root/dan/ele-ymir.yml
blob: 1d7bb60e0a10db744b27f7512555e310e554d942 (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
---
- name: Basic Setup
  hosts: ele-ymir
  roles:
  - role: apt-repo/base
  - role: core/base
  - role: core/sshd/base
  - role: core/zsh
  - role: core/ntp
  - role: core/cpu-microcode

- name: Payload Setup
  hosts: ele-ymir
  roles:
  - role: apt-repo/spreadspace
  - role: nginx/base
  - role: monitoring/prometheus/exporter
  - role: ws/base
  - role: core/admin-users
  post_tasks:
  ## TODO: move to network/netplan when this is done
  - name: install vlan interfaces
    loop: "{{ network.vlans | dict2items }}"
    loop_control:
      label: "{{ item.key }} ({{ item.value | join(',') }})"
    copy:
      dest: "/etc/netplan/20-{{ item.key }}.yaml"
      content: |
        network:
          vlans:
        {% for vlan in item.value %}
        {%   set vlan_ifname = item.key + '.' + (vlan | string) %}
        {%   set vlan_iface = (network.interfaces | selectattr('name', 'eq', vlan_ifname)) %}
            {{ vlan_ifname }}:
              id: {{ vlan }}
              link: {{ item.key }}
        {%   if vlan_iface %}
              addresses:
                - {{ (vlan_iface | first).address }}
        {%   endif %}
        {% endfor %}

  - name: install script to play videos fullscreen
    copy:
      dest: /usr/local/bin/play-video.sh
      mode: 0755
      content: |
        #!/bin/bash

        exec mpv --vo=gpu --keep-open=yes --geometry=1920x1080+0+0 --fs --osd-level=0 \
                 --term-status-msg='${?pause==yes:(Paused) }${time-remaining}  ${time-pos} / ${duration} (${percent-pos}%)  A-V: ${avsync}'   "$@"