summaryrefslogtreecommitdiff
path: root/roles/ws/minet/tasks/main.yml
blob: 35eafa17396808afe89684c9f57c5a8e86dab06f (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
- name: install minet management script
  copy:
    src: minet
    dest: /usr/local/sbin/
    mode: 0755

- name: install minet management script zsh completion
  copy:
    src: _minet
    dest: /usr/local/share/zsh/site-functions
    mode: 0644

- name: install minet lib dir
  file:
    path: /usr/local/lib/minet
    state: directory

- name: install minet helpers
  copy:
    src: minet_helpers.sh
    dest: /usr/local/lib/minet

- name: install minet connection scripts
  loop: "{{ lookup('fileglob', 'templates/connections/*.j2', wantlist=True) }}"
  loop_control:
    label: "{{ item | basename | splitext | first }}"
  template:
    src: "{{ item }}"
    dest: "/usr/local/lib/minet/{{ item | basename | splitext | first }}"
    mode: 0755

- name: install custom wpa connections
  loop: "{{ ws_minet_wpa_connections | dict2items }}"
  loop_control:
    label: "{{ item.key }} - {{ item.value.description }}"
  template:
    src: wpa-connection.j2
    dest: "/usr/local/lib/minet/{{ item.key }}"
    mode: 0755

- name: install custom open-wifi connections
  loop: "{{ ws_minet_openwifi_connections | dict2items }}"
  loop_control:
    label: "{{ item.key }} - {{ item.value.description }}"
  template:
    src: openwifi-connection.j2
    dest: "/usr/local/lib/minet/{{ item.key }}"
    mode: 0755

- name: install wpa_supplicant config
  when: ws_minet_wpa_supplicant_conf is defined
  copy:
    content: "{{ ws_minet_wpa_supplicant_conf }}"
    dest: /etc/wpa_supplicant.conf
    owner: root
    group: root
    mode: 0600

- name: disable systemd-networkd service units
  loop:
  - systemd-networkd.socket
  - systemd-networkd.service
  - systemd-networkd-wait-online.service
  systemd:
    name: "{{ item }}"
    state: stopped
    masked: yes

- name: create resolvconf symlink to resolvectl
  file:
    src: /usr/bin/resolvectl
    dest: /usr/local/bin/resolvconf
    state: link