summaryrefslogtreecommitdiff
path: root/roles/slim/raspbian/tasks/main.yml
blob: d943d6aa4a0625ed6f307bc8a98b9e8b9b8a4a5e (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: enable/disable wifi
  lineinfile:
    path: /boot/config.txt
    line: dtoverlay=disable-wifi
    insertafter: '^\[all\]'
    state: "{{ raspbian_disable_wifi | ternary('present', 'absent') }}"

- name: enable/disable bluetooh
  lineinfile:
    path: /boot/config.txt
    line: dtoverlay=disable-bt
    insertafter: '^\[all\]'
    state: "{{ raspbian_disable_bluetooth | ternary('present', 'absent') }}"

- name: enable/disable audio
  lineinfile:
    path: /boot/config.txt
    regexp: '^dtparam=audio='
    line: "dtparam=audio={{ raspbian_disable_audio | ternary('off', 'on') }}"

- name: enable ssh-server
  systemd:
    name: ssh
    enabled: yes

- name: remove pi user
  user:
    name: pi
    state: absent
    remove: yes
    force: yes

- name: remove sudoers config for pi user
  file:
    path: /etc/sudoers.d/010_pi-nopasswd
    state: absent

- name: set hostname
  hostname:
    name: "{{ host_name }}"

- name: update hostname in /etc/hosts
  lineinfile:
    path: /etc/hosts
    backrefs: yes
    regexp: '^(127.0.1.1\s+)'
    line: '\g<1>{{ host_name }}'

- name: remove vscode sources.list and microsoft gpg key
  loop:
  - sources.list.d/vscode.list
  - trusted.gpg.d/microsoft.gpg
  file:
    path: "/etc/apt/{{ item }}"
    state: absent