From 4c702bc5a57b55abe8bdcc5096d5aa9a04233bb5 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 26 Nov 2019 02:02:37 +0000 Subject: [PATCH] feat(deprecated.sls): prepare warning state for `ng` promotion (#35) --- docs/README.rst | 24 ++++++++++++++++++++++++ fail2ban/deprecated.sls | 41 +++++++++++++++++++++++++++++++++++++++++ pillar.example | 3 +++ 3 files changed, 68 insertions(+) create mode 100644 fail2ban/deprecated.sls diff --git a/docs/README.rst b/docs/README.rst index ab3678f..3c81ce0 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -16,6 +16,30 @@ fail2ban-formula ``fail2ban`` scans log files for malicious activity and executes actions based on what it finds. +.. list-table:: + :name: banner-breaking-changes-v1.0.0 + :header-rows: 1 + :widths: 1 + + * - WARNING: BREAKING CHANGES IN UPCOMING ``v1.0.0`` + * - This formula currently provides two methods for managing Fail2Ban; the old method + under ``fail2ban`` and the new method under ``fail2ban.ng``. + In upcoming `v1.0.0 `_, + the old method will be removed and ``fail2ban.ng`` will be promoted to ``fail2ban`` in its place. + + If you are not in a position to migrate, you will need to pin your repo to + the final release tag before + `v1.0.0 `_, + which is expected to be + `v0.16.3 `_. + + If you are currently using ``fail2ban.ng``, there is nothing to do until + `v1.0.0 `_ + is released. + + To migrate from the old ``fail2ban``, the first step is to convert to ``fail2ban.ng``, + before `v1.0.0 `_ + is released. .. contents:: **Table of Contents** diff --git a/fail2ban/deprecated.sls b/fail2ban/deprecated.sls new file mode 100644 index 0000000..09a2a0d --- /dev/null +++ b/fail2ban/deprecated.sls @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# vim: ft=sls + +{#- Evaluating as `False` by default, using this method since `defaults.yaml` not available in this repo #} +{%- if not salt['config.get']('fail2ban', {}).get('warning_messages', {}).get('v1.0.0', {}).get('mute_critical', False) %} +fail2ban-deprecated-in-v1.0.0-test-succeed: + test.succeed_without_changes: + - name: | + + ################################################################################ + # # + # WARNING: BREAKING CHANGES IN UPCOMING VERSION `v1.0.0` # + # # + ################################################################################ + # # + # This formula currently provides two methods for managing Fail2Ban; the old # + # method under `fail2ban` and the new method under `fail2ban.ng`. In upcoming # + # `v1.0.0`, the old method will be removed and `fail2ban.ng` will be promoted # + # to `fail2ban` in its place. # + # # + # If you are not in a position to migrate, you will need to pin your repo to # + # the final release tag before `v1.0.0`, which is expected to be `v0.16.3`. # + # # + # If you are currently using `fail2ban.ng`, there is nothing to do until # + # `v1.0.0` is released. # + # # + # To migrate from the old `fail2ban`, the first step is to convert to # + # `fail2ban.ng`, before `v1.0.0` is released. # + # # + # To prevent this message being displayed again, set the pillar/config value: # + # # + # ``` # + # fail2ban: # + # warning_messages: # + # v1.0.0: # + # mute_critical: true # + # ``` # + # # + ################################################################################ + # - failhard: True +{%- endif %} diff --git a/pillar.example b/pillar.example index 98b5880..79fec9d 100644 --- a/pillar.example +++ b/pillar.example @@ -2,6 +2,9 @@ # vim: ft=yaml --- fail2ban: + warning_messages: + v1.0.0: + mute_critical: false lookup: config: loglevel: ERROR