summaryrefslogtreecommitdiff
path: root/elevate/ele-dione.yml
diff options
context:
space:
mode:
Diffstat (limited to 'elevate/ele-dione.yml')
-rw-r--r--elevate/ele-dione.yml77
1 files changed, 77 insertions, 0 deletions
diff --git a/elevate/ele-dione.yml b/elevate/ele-dione.yml
new file mode 100644
index 00000000..95800036
--- /dev/null
+++ b/elevate/ele-dione.yml
@@ -0,0 +1,77 @@
+---
+- name: Basic Setup
+ hosts: ele-dione
+ 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-dione
+ roles:
+ - role: core/users
+ - role: storage/zfs/base
+ - role: apt-repo/spreadspace
+ - role: nginx/base
+ - role: monitoring/prometheus/exporter
+ - role: streaming/blackmagic/desktopvideo
+ post_tasks:
+ - name: install lm-sensors and i7z
+ apt:
+ name:
+ - lm-sensors
+ - i7z
+ - s-tui
+
+ - name: load modules for lm-sensors
+ vars:
+ sensors_modules:
+ - coretemp
+ block:
+ - name: load special modules for lm-sensors
+ loop: "{{ sensors_modules }}"
+ modprobe:
+ name: "{{ item }}"
+ state: present
+
+ - name: make sure sensor modules are loaded on reboot
+ copy:
+ content: |
+ # Ansible managed
+
+ {% for module in sensors_modules %}
+ {{ module }}
+ {% endfor %}
+ dest: /etc/modules-load.d/sensors.conf
+
+ ## 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 %}