Skip to content

Commit

Permalink
feat(os): graceful fail for unsupported os
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Mar 28, 2020
1 parent 443d992 commit be66570
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sysstat-formula
:scale: 100%
:target: https://github.com/semantic-release/semantic-release

Formula to install sysstat/sar and configure it.
Formula to install sysstat/sar and configure it on GNU/Linux.

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

Expand Down
11 changes: 11 additions & 0 deletions sysstat/clean.sls
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{%- if grains.os_family not in ('FreeBSD', 'Windows', 'MacOS',) %}

include:
- .service.clean
- .config.clean
- .package.clean
- .source.clean

{%- else %}

sysstat-not-available-to-clean:
test.show_notification:
- text: |
The sysstat package is unavailable on {{ salt['grains.get']('osfinger', grains.os_family) }}
{%- endif %}
11 changes: 11 additions & 0 deletions sysstat/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import sysstat with context %}
{%- if grains.os_family not in ('FreeBSD', 'Windows', 'MacOS',) %}
include:
- {{ '.source' if sysstat.pkg.use_upstream_source else '.package' }}
- .config
- .service
{%- else %}
sysstat-not-available-to-install:
test.show_notification:
- text: |
The sysstat package is unavailable on {{ salt['grains.get']('osfinger', grains.os_family) }}
{%- endif %}

0 comments on commit be66570

Please # to comment.