summaryrefslogtreecommitdiff
path: root/dan/ele-calypso.yml
blob: 5d8e51ce3e2798f2cc65ed3751e58150cec8761b (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
---
- name: Basic Setup
  hosts: ele-calypso
  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-calypso
  roles:
  - role: apt-repo/spreadspace
  - role: streaming/blackmagic/desktopvideo
  - role: storage/lvm/base
  - role: kubernetes/base
  - role: kubernetes/standalone/base
  - role: streaming/player
  - role: nginx/base
  - role: monitoring/sachet
  - role: monitoring/prometheus/server
  - role: monitoring/prometheus/exporter
  - role: monitoring/prometheus/alertmanager
  - role: monitoring/grafana
  - role: monitoring/landingpage
  post_tasks:
  ## TODO: move to network/interfaces when this is done
  - name: install vlan interfaces
    loop: "{{ network.vlans | dict2items }}"
    loop_control:
      label: "{{ item.key }} ({{ item.value | join(',') }})"
    copy:
      dest: "/etc/network/interfaces.d/{{ item.key }}"
      content: |
        auto {{ item.key }}
        iface {{ item.key }} inet manual
        {% for vlan in item.value %}
        {%   set vlan_ifname = item.key + '.' + (vlan | string) %}
        {%   set vlan_iface = (network.interfaces | selectattr('name', 'eq', vlan_ifname)) %}

        auto {{ vlan_ifname }}
        {%   if vlan_iface %}
        iface {{ vlan_ifname }} inet static
          address {{ (vlan_iface | first).address }}
        {%     for route in vlan_iface[0].static_routes | default([]) %}
          up /bin/ip route add {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
        {%     endfor %}
        {%     for route in vlan_iface[0].static_routes | default([]) | reverse %}
          down /bin/ip route del {{ route.destination }} via {{ route.gateway }}{% if 'source' in route %} src {{ route.source }}{% endif %}{{ '' }}
        {%     endfor %}
        {%   else %}
        iface {{ vlan_ifname }} inet manual
        {%   endif %}
        {% endfor %}