-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unsupported): prevent formula running on unsupported minions
* https://freenode.logbot.info/saltstack-formulas/20190421#c2129159 * Use `failhard` to prevent execution if `unsupported` has been set * Show reason why minion is `unsupported` * Allow `unsupported` to be overridden at each level within the map
- Loading branch information
Showing
8 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- set sls_fail_if_unsupported = tplroot ~ '.unsupported' %} | ||
|
||
include: | ||
- {{ sls_fail_if_unsupported }} | ||
- .file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- set sls_fail_if_unsupported = tplroot ~ '.unsupported' %} | ||
|
||
include: | ||
- {{ sls_fail_if_unsupported }} | ||
- .package | ||
- .config | ||
- .service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- set sls_fail_if_unsupported = tplroot ~ '.unsupported' %} | ||
|
||
include: | ||
- {{ sls_fail_if_unsupported }} | ||
- .install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- set sls_fail_if_unsupported = tplroot ~ '.unsupported' %} | ||
|
||
include: | ||
- {{ sls_fail_if_unsupported }} | ||
- .running |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import template with context %} | ||
{%- if template.unsupported is defined and template.unsupported %} | ||
template-unsupported-test-fail: | ||
test.fail_without_changes: | ||
- name: | | ||
####################################### | ||
# Unsupported minion for this formula # | ||
####################################### | ||
{{ template.unsupported }} | ||
- failhard: True | ||
{%- endif %} |