Disable annoying Linux bell sound

Basic

sudo echo 'blacklist pcspkr' > /etc/modprobe.d/nobeep.conf

And restart your machine!

Automated

Add this to an ansible role roles/os/configure/nobeep.yml:

# -------------------------------------------------------------------------------
# Bell Sound
# -------------------------------------------------------------------------------

- name: Blacklist the pcspkr module to silence horrendous beeps
  copy:
    dest: /etc/modprobe.d/nobeep.conf
    content: |
            blacklist pcspkr
  become: true

Reference it in a playbook playbooks/os/configure.yml:

---

- hosts: localhost
  roles:
    - { role: ../../roles/os/configure/nobeep }

And invoke that playbook:

.PHONY: os/configure
os/configure:
	@ansible-playbook playbooks/os/configure.yml --ask-become-pass

Using make:

make os/configure