Skip to content

Commit

Permalink
feat(deprecated.sls): prepare warning state for ng promotion (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Nov 26, 2019
1 parent 5112d76 commit 4c702bc
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/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 <https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/v1.0.0>`_,
which is expected to be
`v0.16.3 <https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/v0.16.3>`_.

If you are currently using ``fail2ban.ng``, there is nothing to do until
`v1.0.0 <https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/v1.0.0>`_
is released.

To migrate from the old ``fail2ban``, the first step is to convert to ``fail2ban.ng``,
before `v1.0.0 <https://github.com/saltstack-formulas/fail2ban-formula/releases/tag/v1.0.0>`_
is released.

.. contents:: **Table of Contents**

Expand Down
41 changes: 41 additions & 0 deletions fail2ban/deprecated.sls
Original file line number Diff line number Diff line change
@@ -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 %}
3 changes: 3 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# vim: ft=yaml
---
fail2ban:
warning_messages:
v1.0.0:
mute_critical: false
lookup:
config:
loglevel: ERROR
Expand Down

0 comments on commit 4c702bc

Please sign in to comment.