Commit f3528ecd authored by Maciej Delmanowski's avatar Maciej Delmanowski

[debops.console] Remove 'sysnews' support

The support for System News management has been moved to a new Ansible
role, 'debops.sysnews'.
parent 06bb45f6
......@@ -133,6 +133,11 @@ Removed
moved to a new role, :ref:`debops.proc_hidepid`. You will need to update the
Ansible inventory variables to reflect the changes.
- [debops.console] Management of the System News using the ``sysnews`` Debian
package has been removed from the role; it's now available as a separate
:ref:`debops.sysnews` Ansible role. You will need to update the Ansible
inventory variables related to System News due to this changes.
debops v0.6.0 - 2017-10-21
--------------------------
......
......@@ -29,11 +29,6 @@ console_conditional_packages:
console_host_mounts_nfs|d())
else [] }}' ]
# Install 'sysnews' when news support is enabled
- [ '{{ "sysnews"
if (console_sysnews|d() and console_sysnews|bool)
else [] }}' ]
# List of preferred text editors. The first one found will be configured as the
# default for the ``editor`` command.
console_preferred_editors:
......@@ -126,28 +121,3 @@ console_host_mounts: []
console_mounts_nfs: []
console_group_mounts_nfs: []
console_host_mounts_nfs: []
# ---- sysnews support ----
# Install ``sysnews`` package to present system-related news to users on log
# in.
console_sysnews: False
# Add ``sysnews`` support in :file:`/etc/profile.d/` so it's executed conditionally
# on user login.
console_sysnews_global: True
# Accounts with UID bigger than this variable's value will be shown the news on
# interactive login.
console_sysnews_min_uid: '500'
# Dict variable with news entries. Each key is name of the news file, and
# a value should be a YAML text block with the message stored in the file.
# Example:
#
# console_sysnews_entries:
# 'WELCOME': |
# Welcome on the {{ ansible_fqdn }} server!
#
console_sysnews_entries: {}
......@@ -98,6 +98,3 @@
)
)
)
- include: sysnews.yml
when: console_sysnews is defined and console_sysnews
---
- name: Enable system news bulletin for all users
template:
src: 'etc/profile.d/sysnews.sh.j2'
dest: '/etc/profile.d/sysnews.sh'
owner: 'root'
group: 'root'
mode: '0644'
when: console_sysnews_global|d() and
console_sysnews_global|bool
- name: Generate persistent news files
template:
src: 'var/lib/sysnews/news.j2'
dest: '/var/lib/sysnews/{{ item.key }}'
owner: 'root'
group: 'root'
mode: '0644'
with_dict: '{{ console_sysnews_entries }}'
when: console_sysnews_entries and item.key is defined and item.key
- name: Update list of persistent files
template:
src: 'var/lib/sysnews/noexpire.j2'
dest: '/var/lib/sysnews/.noexpire'
owner: 'root'
group: 'root'
mode: '0644'
when: console_sysnews_entries is defined and
console_sysnews_entries
# {{ ansible_managed }}
# Print system news when users log in
# Show news only to potential normal users
[ $EUID -ge {{ console_sysnews_min_uid }} ] || return 0
# Check if sysnews is installed
type news > /dev/null 2>&1 || return 0
# Make sure that shell is bash or zsh
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0
# Make sure that it's interactive session
[[ $- == *i* ]] || return 0
# Show system news to users
tty -s && news -n
{% if item.value is defined and item.value %}
{{ item.value }}
{% endif %}
{% for name in console_sysnews_entries.keys() %}
{{ name }}
{% endfor %}
......@@ -81,6 +81,11 @@ Inventory variable changes
creates its own set of Ansible local facts with new variable names, you might
need to update configuration of the roles that relied on them.
- Configuration of the ``sysnews`` package has been removed from the
``debops.console`` role, it's now available in the :ref:`debops.sysnews`
Ansible role. There were extensive changes in the variable names and
parameters, read the documentation of the new role for details.
v0.6.0
------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment