Skip to content

Commit

Permalink
Merge branch 'ypid-remove/sysctl'
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed Sep 4, 2016
2 parents 4bdb7de + 6c2ec22 commit c37567b
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 93 deletions.
69 changes: 45 additions & 24 deletions CHANGES.rst
@@ -1,83 +1,104 @@
Changelog
=========

.. include:: includes/all.rst

**debops.console**

This project adheres to `Semantic Versioning <http://semver.org/spec/v2.0.0.html>`__
and `human-readable changelog <http://keepachangelog.com/en/0.3.0/>`__.

The current role maintainer_ is drybjed_.


`debops.console master`_ - unreleased
-------------------------------------

.. _debops.console master: https://github.com/debops/ansible-console/compare/v0.1.2...master

Changed
~~~~~~~

- Moved sysctl parts from debops.console_ to a separate debops.sysctl_
role. [ypid_]


v0.1.2
------

*Released: 2016-05-26*

- Remove list of additional APT packages to install. This functionality has
been moved to the ``debops.apt_install`` Ansible role. [drybjed]
been moved to the debops.apt_install_ Ansible role. [drybjed_]

- Change how the preferred text editor is selected. Instead of specifying
a preferred editor, role contains a list of preferred editors and checks it
against a list of installed editors. The first found editor is selected as
the preferred one. [drybjed]
the preferred one. [drybjed_]

v0.1.1
------

*Released: 2016-02-18*

- Fix a bug with wrong ``ansible_local.proc.hidepid_group`` value when hidepid
was not enabled in ``/proc``. [prahal]
was not enabled in :file:`/proc`. [prahal]

- Be more strict in parsing ``/proc/mounts`` when looking for a ``/proc`` entry
with enabled ``hidepid=`` parameter. [drybjed]
- Be more strict in parsing :file:`/proc/mounts` when looking for a :file:`/proc` entry
with enabled ``hidepid=`` parameter. [drybjed_]

v0.1.0
------

*Released: 2016-02-07*

- Add Changelog. [drybjed]
- Add Changelog. [drybjed_]

- Change default NFS filesystem type from ``nfs4`` to ``nfs``, system
automatically picks the correct type. [drybjed]
automatically picks the correct type. [drybjed_]

- Add a way to manage entries in ``/etc/hosts``. [drybjed]
- Add a way to manage entries in :file:`/etc/hosts`. [drybjed_]

- Add a task that allows to copy custom files from Ansible Controller, list of
files is configurable using Ansible inventory. [drybjed]
files is configurable using Ansible inventory. [drybjed_]

- Add support for setting default system-wide locale. [drybjed]
- Add support for setting default system-wide locale. [drybjed_]

- Add option to configure system-wide ``editor`` alternative. [drybjed]
- Add option to configure system-wide ``editor`` alternative. [drybjed_]

- Tag various tasks for convenient use. [drybjed]
- Tag various tasks for convenient use. [drybjed_]

- Ensure mount directories exist when manually mounted. [ypid]
- Ensure mount directories exist when manually mounted. [ypid_]

- Add kernel parameter configuration and shared memory configuration.

Amount of shared memory limits starting with Linux kernel 3.16 is ridiculusly
high by default. This configuration limits the shared memory size to
reasonable amounts depending on available system RAM. More information:
https://git.kernel.org/cgit/linux/kernel/git/mhocko/mm.git/commit/include/uapi/linux/shm.h?id=060028bac94bf60a65415d1d55a359c3a17d5c31
[drybjed]
[drybjed_]

- Install additional packages by default: ``mtr-tiny``, ``tree``, ``at``.
Install ``nfs-common`` if NFS mounts are configured. [drybjed]
Install ``nfs-common`` if NFS mounts are configured. [drybjed_]

- Protect the Tab characters in ``lineinfile`` module. [drybjed]
- Protect the Tab characters in ``lineinfile`` module. [drybjed_]

- Remove the ``at`` package from list of installed packages, it's now managed
by separate ``debops.atd`` role. [drybjed]
by separate debops.atd_ role. [drybjed_]

- Create list of conditionally installed packages. [drybjed]
- Create list of conditionally installed packages. [drybjed_]

- Install ``libpam-systemd`` on hosts managed by ``systemd`` init. This
provides better support for user sessions which will be moved to their own
separate cgroups. Users are also able to create their own ``systemd``
services, timers, and other units. [drybjed]
services, timers, and other units. [drybjed_]

- Add support for ``sysnews`` package, useful on multiuser systems. [drybjed]
- Add support for ``sysnews`` package, useful on multiuser systems. [drybjed_]

- Fix deprecation warnings on Ansible 2.1.0. [drybjed]
- Fix deprecation warnings on Ansible 2.1.0. [drybjed_]

- Make sure that ``systemd-logind`` service is included in the ``procadmins``
system group when ``/proc`` ``hidepid`` option is enabled. [drybjed]
system group when :file:`/proc` ``hidepid`` option is enabled. [drybjed_]

- Add ``proc.fact`` fact script which contains information about ``hidepid``
options for other Ansible roles to use. [drybjed]

options for other Ansible roles to use. [drybjed_]
40 changes: 1 addition & 39 deletions defaults/main.yml
Expand Up @@ -93,43 +93,6 @@ console_proc_hidepid_level: '2'
console_proc_hidepid_group: 'procadmins'


# ---- Kernel runtime parameters ----

# Configuration file which holds the kernel parameters managed by the role
console_sysctl_file: '/etc/sysctl.d/10-debops.console.conf'

# Base amount of memory used for shared memory calculations
console_sysctl_shm_base: '{{ ((ansible_memtotal_mb | int * 1024 * 1024) - 8192) }}'

# How much of the total memory is reserved for shared memory.
console_sysctl_shmall_limiter: '{{ "0.8"
if (ansible_memtotal_mb | int >= 4096)
else "0.5" }}'

# Number of memory pages that can be used for shared memory
console_sysctl_kernel_shmall: '{{ ((console_sysctl_shm_base | int *
console_sysctl_shmall_limiter | float) / 4096)
| round | int }}'

# Maximum size of shared memory segment as % of available memory
console_sysctl_shmmax_limiter: '{{ "0.5"
if (ansible_memtotal_mb | int >= 4096)
else "0.2" }}'

# Maximum amount of shared memory a process can reserve for itself
console_sysctl_kernel_shmmax: '{{ (console_sysctl_shm_base | int *
console_sysctl_shmmax_limiter | float)
| round | int }}'

# Shared memory parameters set using sysctl
console_sysctl_kernel_shm_values:
'kernel.shmmax': '{{ console_sysctl_kernel_shmmax }}'
'kernel.shmall': '{{ console_sysctl_kernel_shmall }}'

# Dict with kernel parameters that require 'cap_sys_admin' capability to be set
console_sysctl_sys_admin_values: {}


# ---- root account ----

# Manage root account
Expand Down Expand Up @@ -224,7 +187,7 @@ console_host_mounts_nfs: []
# in.
console_sysnews: False

# Add ``sysnews`` support in ``/etc/profile.d/`` so it's executed conditionally
# Add ``sysnews`` support in :file:`/etc/profile.d/` so it's executed conditionally
# on user login.
console_sysnews_global: True

Expand All @@ -241,4 +204,3 @@ console_sysnews_min_uid: '500'
# Welcome on the {{ ansible_fqdn }} server!
#
console_sysnews_entries: {}

4 changes: 2 additions & 2 deletions meta/main.yml
Expand Up @@ -8,7 +8,7 @@ galaxy_info:
author: 'Maciej Delmanowski'
description: 'Configure system console and terminal-related options'
company: 'DebOps'
license: 'GNU General Public License v3'
license: 'GPL-3.0'
min_ansible_version: '1.7.0'
platforms:
- name: Ubuntu
Expand All @@ -22,6 +22,6 @@ galaxy_info:
versions:
- wheezy
- jessie
categories:
galaxy_tags:
- system

25 changes: 0 additions & 25 deletions tasks/configure_sysctl.yml

This file was deleted.

7 changes: 4 additions & 3 deletions tasks/main.yml
Expand Up @@ -123,8 +123,10 @@
group: 'root'
mode: '0755'

- name: Configure kernel parameters in /proc
include: configure_sysctl.yml
- name: Remove obsolet sysctl configuration file
file:
path: '/etc/sysctl.d/10-debops.console.conf'
state: 'absent'

- include: root_account.yml
when: console_root is defined and console_root
Expand Down Expand Up @@ -168,4 +170,3 @@

- include: sysnews.yml
when: console_sysnews is defined and console_sysnews

0 comments on commit c37567b

Please sign in to comment.