machine_setup/ansible/roles/base/tasks/linux.yaml
2023-01-28 01:20:42 -05:00

58 lines
1.2 KiB
YAML

- name: Install packages
package:
name:
- psmisc
- pkgfile
- linux-firmware
- bind # dig
state: present
- name: Start pkgfile update service
systemd:
state: started
name: pkgfile-update.timer
daemon_reload: yes
enabled: yes
# Of questionable value since I don't use swap on my machines
- name: Configure sysctls for swap
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/swap.conf
loop:
- name: vm.swappiness
value: 10
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: mount_disk_image
dest: /usr/local/bin/mount_disk_image
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/dirty.conf
loop:
- name: vm.dirty_writeback_centisecs
value: 2000 # Default is 500 (5 seconds)
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/laptop.conf
loop:
- name: vm.laptop_mode
value: 5