summaryrefslogtreecommitdiff
path: root/chaos-at-home/ch-hdmistick.yml
diff options
context:
space:
mode:
Diffstat (limited to 'chaos-at-home/ch-hdmistick.yml')
-rw-r--r--chaos-at-home/ch-hdmistick.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/chaos-at-home/ch-hdmistick.yml b/chaos-at-home/ch-hdmistick.yml
new file mode 100644
index 00000000..b98e60ff
--- /dev/null
+++ b/chaos-at-home/ch-hdmistick.yml
@@ -0,0 +1,49 @@
+---
+- name: Basic Setup
+ hosts: ch-hdmistick
+ roles:
+ - role: apt-repo/base
+ - role: core/base
+ - role: core/sshd/base
+ - role: core/zsh
+ - role: core/ntp
+
+- name: Payload Setup
+ hosts: ch-hdmistick
+ roles:
+ - role: streaming/mpv-headless
+ post_tasks:
+ - name: install wifi stuff
+ apt:
+ name:
+ - wireless-tools
+ - wpasupplicant
+ - firmware-realtek
+ state: present
+
+ - name: generate wireless interface config
+ copy:
+ content: |
+ # ansible generated
+ auto wlan0
+ iface wlan0 inet static
+ up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+ address {{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets[inventory_hostname]) | ansible.utils.ipaddr('address') }}
+ netmask {{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets[inventory_hostname]) | ansible.utils.ipaddr('netmask') }}
+ gateway {{ network_zones.lan.gateway }}
+ dns-nameservers {{ network_zones.lan.dns | join(' ') }}
+ dns-search {{ host_domain }}
+ wpa-ssid "{{ network_zones.lan.wifi.ssid }}"
+ wpa-psk "{{ network_zones.lan.wifi.key }}"
+ dest: /etc/network/interfaces.d/wifi
+ mode: 0600
+
+ - name: remove temporary USB-eth interface config
+ loop:
+ - '^auto {{ network.primary.name }}'
+ - '^iface {{ network.primary.name }}'
+ lineinfile:
+ path: "/etc/network/interfaces"
+ regexp: "{{ item }}"
+ state: absent