diff --git a/ansible/playbook.yaml b/ansible/playbook.yaml index e88e88b..5083cd4 100644 --- a/ansible/playbook.yaml +++ b/ansible/playbook.yaml @@ -33,6 +33,8 @@ tags: [init-server, otelcol] - role: ethpandaops.general.vector tags: [init-server, vector] + - role: disable_rpcbind + tags: [init-server, disable_rpcbind] - hosts: hive become: true diff --git a/ansible/roles/disable_rpcbind/tasks/main.yaml b/ansible/roles/disable_rpcbind/tasks/main.yaml new file mode 100644 index 0000000..dab83d7 --- /dev/null +++ b/ansible/roles/disable_rpcbind/tasks/main.yaml @@ -0,0 +1,15 @@ +# rpcbind (portmapper, port 111) ships enabled on Debian via nfs-common and listens on all +# interfaces. Nothing on these hosts uses NFS/RPC, so stop and mask it. +- name: Gather service facts + ansible.builtin.service_facts: + +- name: Stop and mask rpcbind + ansible.builtin.systemd: + name: "{{ item }}" + state: stopped + enabled: false + masked: true + loop: + - rpcbind.socket + - rpcbind.service + when: "'rpcbind.service' in ansible_facts.services"