summaryrefslogtreecommitdiff
path: root/chaos-at-home/ch-hdmistick.yml
blob: b98e60ff5ce4e76925508e08914f5ecd1b68b0de (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
---
- 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