aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/sysconf/tasks/_openbsd.yml
blob: d4773a464c9263a945bbb7c8a24a5f39ccf3ac3b (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

# workstation ~~ roles/workstation/tasks/main.yml
# init openbsd based workstation

---

- name: ensure wsconsctl config file exists
  file:
    path: /etc/wsconsctl.conf
    owner: root
    group: wheel
    mode: 0644
    state: touch

- name: append configuration to wsconsctl
  lineinfile:
    path: /etc/wsconsctl.conf
    regexp: "^{{ item[0] }}"
    line: "{{ item[0] }}={{ item[1] }}"
  loop:
    - [screen.brightness, 80]
    - [keyboard.repeat.del1, 180]
    - [keyboard.repeat.deln, 50]
    - [keyboard.bell.volume, 0]
    - [mouse.tp.tapping, 1]

- name: ensure Xorg subdirectory for configuration exists
  file:
    path: /etc/X11/xorg.conf.d
    owner: root
    mode: 0644
    state: directory

- name: generate system wide configurations
  template:
    src: "{{ item }}"
    dest: "/{{ item | regex_replace('-', '/') }}"
    mode: preserve
  loop:
    - etc-X11-xorg.conf.d-intel.conf
    - etc-apm-hibernate
    - etc-apm-suspend
    - etc-apm-resume

- name: ensure sysctl configuration file exists
  file:
    path: /etc/sysctl.conf
    owner: root
    mode: 0644

- name: ensure sysctl memory optimizations
  blockinfile:
    path: /etc/sysctl.conf
    block: |
      kern.shminfo.shmall=3145728
      kern.shminfo.shmmax=1073741823
      kern.shminfo.shmmni=1024
      kern.shminfo.shmseg=1024
      kern.seminfo.semmns=4096
      kern.seminfo.semmni=1024
    marker: "# memory {mark} - managed by Ansible"

- name: ensure sysctl process optimizations
  blockinfile:
    path: /etc/sysctl.conf
    block: |
      kern.maxfiles=102400
      kern.maxproc=32768
      kern.maxfiles=65535
      kern.bufcachepercent=90
      kern.maxvnodes=262144
      kern.somaxconn=2048
    marker: "# process - {mark} managed by Ansible"
remember that computers suck.