ansible/roles/sysctl_proxmox/tasks/main.yml
2026-03-30 15:19:20 +02:00

55 lines
2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: resolvconf installieren
ansible.builtin.apt:
name: resolvconf
state: present
- name: DNS in resolvconf head setzen
ansible.builtin.copy:
dest: /etc/resolvconf/resolv.conf.d/head
content: |
# Managed by Ansible
nameserver 1.1.1.1
nameserver 1.0.0.1
mode: "0644"
notify: resolvconf update
- name: /etc/hosts deployen
ansible.builtin.template:
src: hosts.j2
dest: /etc/hosts
mode: "0644"
- name: sysctl.conf inkludiert sysctl.d
ansible.builtin.lineinfile:
path: /etc/sysctl.conf
create: true
mode: "0644"
line: "# Managed by Ansible Drop-ins in /etc/sysctl.d/ werden automatisch geladen"
insertbefore: BOF
notify: sysctl reload
- name: Sysctl Parameter setzen
ansible.posix.sysctl:
name: "{{ item.key }}"
value: "{{ item.value }}"
sysctl_file: /etc/sysctl.d/99-proxmox-tuning.conf
reload: true
state: present
loop:
- { key: vm.overcommit_memory, value: "1" }
- { key: vm.swappiness, value: "1" }
- { key: fs.file-max, value: "9999999" }
- { key: fs.inotify.max_user_watches, value: "524288" }
- { key: fs.inotify.max_user_instances, value: "512" }
- { key: net.ipv4.ip_forward, value: "1" }
- { key: net.ipv6.conf.all.forwarding, value: "1" }
- { key: net.bridge.bridge-nf-call-iptables, value: "0" }
- { key: net.bridge.bridge-nf-call-ip6tables, value: "0" }
- { key: vm.dirty_expire_centisecs, value: "3000" }
- { key: vm.dirty_writeback_centisecs, value: "500" }
- { key: net.ipv4.tcp_mtu_probing, value: "1" }
- { key: net.core.rmem_max, value: "67108864" }
- { key: net.core.wmem_max, value: "67108864" }
- { key: net.ipv4.tcp_rmem, value: "4096 87380 67108864" }
- { key: net.ipv4.tcp_wmem, value: "4096 65536 67108864" }