diff --git a/docs/rolereference.rst b/docs/rolereference.rst index d3bc181f1b2378876f96a893fd8a667304e13834..e815d7a9dec28fdcb7ec59f8af61f149433621e0 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -242,6 +242,8 @@ The role implements the following: * Sets-up uniform bash prompt for all accounts (optionally coloured and with identifier). This is useful for distinguishing machines and/or environments. * Installs additional base packages, as configured. +* Disables ``electric-indent-mode`` in Emacs globally if either the ``emacs24`` + or ``emacs24-nox`` are installed through the role. * Creates additional operating system groups, as configured. * Creates additional operating system users, as configured. * Hardens the SSH server by disabling remote ``root`` logins and password-based diff --git a/roles/common/files/01disable-electric-indent-mode.el b/roles/common/files/01disable-electric-indent-mode.el new file mode 100644 index 0000000000000000000000000000000000000000..e55072bb0322a558df96146728dc0b6f29b25e37 --- /dev/null +++ b/roles/common/files/01disable-electric-indent-mode.el @@ -0,0 +1,2 @@ +; Disable the electric-indent-mode by default for all users. +(electric-indent-mode -1) diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 4dcc7bcb3e9e04f977e1cc3d7fd9b3073e9e7303..5d5f00eef9128f27c629177d4daa79aebef4903b 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -43,6 +43,11 @@ apt: name="{{ item }}" state="present" with_items: "{{ common_packages }}" +- name: Disable electric-indent-mode for Emacs by default for all users + copy: src="01disable-electric-indent-mode.el" dest="/etc/emacs/site-start.d/01disable-electric-indent-mode.el" + owner=root group=root mode=644 + when: "'emacs24' in common_packages or 'emacs24-nox' in common_packages" + - name: Set-up operating system groups group: name="{{ item.name }}" gid="{{ item.gid | default(omit) }}" state=present with_items: "{{ os_groups }}"