Changeset - a717a6ccd782
[Not reviewed]
0 2 1
Branko Majic (branko) - 7 years ago 2016-11-21 21:58:52
branko@majic.rs
MAR-65: Disable Emacs electric-indent-mode by default via common role (if Emacs is installed via common_packages).
3 files changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -233,24 +233,26 @@ Common
 

	
 
The ``common`` role can be used for applying a common configuration and
 
hardening across all servers, no matter what services they provide.
 

	
 
The role implements the following:
 

	
 
* Configures apt to use caching proxy (if any was specified).
 
* Sets-up umask for all logins to ``0027``.
 
* Installs sudo.
 
* 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
 
  authentication.
 
* Allows traversing of directory ``/etc/ssl/private/`` to everyone. This lets
 
  you put TLS private keys in central location where any operating system user
 
  can reach them provided they have appropriate read/write rights on the file
 
  itself, and provided they know the exact path of the file.
 
* Deploys CA certificate files, normally used for truststore purposes, to
 
  ``/usr/local/share/ca-certificates/``.
 
* Installs ``ferm`` (for iptables management), configuring a basic firewall
 
  which allows ICMP echo requests (PING), incoming connection on TCP port 22
roles/common/files/01disable-electric-indent-mode.el
Show inline comments
 
new file 100644
 
; Disable the electric-indent-mode by default for all users.
 
(electric-indent-mode -1)
roles/common/tasks/main.yml
Show inline comments
 
@@ -34,24 +34,29 @@
 
  apt: name=sudo state=present
 

	
 
- name: Install ssl-cert package
 
  apt: name=ssl-cert state=present
 

	
 
- name: Install rcconf (workaround for systemctl broken handling of SysV)
 
  apt: name=rcconf state=present
 

	
 
- name: Install common packages
 
  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 }}"
 

	
 
- name: Set-up operating system user groups
 
  group: name="{{ item.name }}" gid="{{ item.uid | default(omit) }}" state=present
 
  with_items: "{{ os_users }}"
 

	
 
- name: Set-up operating system users
 
  user: name="{{ item.name }}" uid="{{ item.uid | default(omit) }}" group="{{ item.name }}"
 
        groups="{{ ",".join(item.additional_groups | default([])) }}" append=yes shell=/bin/bash state=present
 
        password="{{ item.password | default('!') }}" update_password=on_create
0 comments (0 inline, 0 general)