This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #654 from digitalrebar/v451-pullback
V451 pullback
- Loading branch information
Showing
36 changed files
with
467 additions
and
43 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
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
2 changes: 1 addition & 1 deletion
2
chef-bootstrap/content/templates/chef-bootstrap.etc.encrypted.data.bag.secret.tmpl
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 +1 @@ | ||
{{if .ParamExists "chef-bootstrap/encrypted_data_bag_secret"}}{{.Param "chef-bootstrap/encrypted_data_bag_secret"}}{{end}} | ||
{{ if .ParamExists "chef-bootstrap/encrypted_data_bag_secret" }}{{.Param "chef-bootstrap/encrypted_data_bag_secret"}}{{ end }} |
2 changes: 1 addition & 1 deletion
2
chef-bootstrap/content/templates/chef-bootstrap.etc.first-boot.json.tmpl
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
2 changes: 1 addition & 1 deletion
2
chef-bootstrap/content/templates/chef-bootstrap.etc.user.pem.tmpl
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 +1 @@ | ||
{{.Param "chef-bootstrap/user_key"}} | ||
{{ .Param "chef-bootstrap/user_key" }} |
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,14 @@ | ||
--- | ||
Name: "classify/data-parameter" | ||
Description: "The name of the parameter to use for classification data" | ||
Meta: | ||
color: "blue" | ||
icon: "search" | ||
title: "RackN" | ||
Documentation: | | ||
This defines the name of a parameter that contains the classification data. | ||
The parameter should have the same type as classify/classification-data. | ||
Schema: | ||
type: "string" |
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,15 @@ | ||
--- | ||
Name: "classify/disable-parameter" | ||
Description: "The name of the parameter to use for disabling this classifier" | ||
Meta: | ||
color: "blue" | ||
icon: "search" | ||
title: "RackN" | ||
Documentation: | | ||
This defines the name of a parameter that defines if this classifer should | ||
be skipped. | ||
The parameter should have the same type as classify/disable-classifier, boolean. | ||
Schema: | ||
type: "string" |
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,16 @@ | ||
--- | ||
Name: "classify/function-parameter" | ||
Description: "The name of the parameter to use for classification functions" | ||
Meta: | ||
color: "blue" | ||
icon: "search" | ||
title: "RackN" | ||
Documentation: | | ||
This defines the name of a parameter that contains the list of classification | ||
functions to add. | ||
The parameter should have the same type as classify/custom-functions, | ||
a list of template names. | ||
Schema: | ||
type: "string" |
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,15 @@ | ||
--- | ||
Name: "classify/version" | ||
Description: "Indications what version of the classifier we use." | ||
Documentation: | | ||
This parameter defines the version of classifier to use. | ||
Version 1 uses the normal parameters. Version 2 uses the parameter | ||
name parameters to determine what to do. | ||
Schema: | ||
type: "number" | ||
default: 1 | ||
Meta: | ||
type: "config" | ||
color: "blue" | ||
icon: "fire" | ||
title: "RackN Content" |
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,15 @@ | ||
--- | ||
Name: "classify/stage-list-parameter" | ||
Description: "The name of the parameter to use to define a list of stages to inject" | ||
Meta: | ||
color: "blue" | ||
icon: "search" | ||
title: "RackN" | ||
Documentation: | | ||
This defines the name of a parameter that defines the list of classifaction stages | ||
to add to the machine. | ||
The parameter should have the same type as classify/stage-list, array of strings. | ||
Schema: | ||
type: "string" |
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,17 @@ | ||
--- | ||
Name: "classify/stage-list" | ||
Description: "A list of classify stages to added the machine" | ||
Documentation: | | ||
Use this Param to specify additional classify stages. | ||
In general, this is an example and is used as a different parameter | ||
through indirection. | ||
Meta: | ||
color: "blue" | ||
icon: "hashtag" | ||
title: "RackN Content" | ||
Schema: | ||
type: "array" | ||
default: [] | ||
items: | ||
type: "string" |
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,18 @@ | ||
--- | ||
Name: "classify-stage-list" | ||
Description: "Adds stages to the machines task list to run multiple classifiers" | ||
Documentation: | | ||
This stages uses the ``classify/stage-list`` parameter to add classification stages | ||
to the machine. | ||
To build custom sets of lists, you can extend this by changing the ``classify/stage-list-parameter``. | ||
Meta: | ||
color: "yellow" | ||
icon: "search" | ||
title: "RackN" | ||
Params: | ||
classify/stage-list-parameter: "classify/stage-list" | ||
Tasks: | ||
- "classify-stage-list-start" | ||
- "classify-stage-list-stop" |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
Name: "classify-stage-list-start" | ||
Description: "Start a set of classification stages on a machine" | ||
Documentation: | | ||
Using the parameter specified by the ``classify/stage-list-parameter``, the | ||
stages specified in that list will be added to the system. This assumes that | ||
they are classify stages and have a single task of classify. | ||
No other tasks should preceed it on the stage, and the only other task that | ||
should follow is the ``classify-stage-list-stop`` task. | ||
Tasks will be dynamically injected in to the workflow after this task, if they | ||
have been specified by the appropriate control Params. | ||
Meta: | ||
color: "blue" | ||
icon: "bug" | ||
title: "RackN Content" | ||
feature-flags: "sane-exit-codes" | ||
Templates: | ||
- Name: "classify-stage-list-start.sh" | ||
Contents: | | ||
#!/bin/bash | ||
# Copyright RackN, 2020 | ||
set -e | ||
{{ template "setup.tmpl" . }} | ||
{{ if eq (.ParamExists "classify/stage-list-parameter") false }} | ||
echo "classify/stage-list-parameter is not specified" | ||
exit 1 | ||
{{ end }} | ||
{{ $lp := .Param "classify/stage-list-parameter" -}} | ||
{{ if eq (.ParamExists $lp) false -}} | ||
echo "classify/stage-list-parameter is {{$lp}} and it does not exist." | ||
exit 1 | ||
{{ end -}} | ||
# Build new task list - This is dangerous and not to be done without planning. | ||
{{ $cid := add .Machine.CurrentTask 1 -}} | ||
{{ $first := slice .Machine.Tasks 0 $cid -}} | ||
{{ $seestop := 0 -}} | ||
{{ range $index, $taskname := (slice .Machine.Tasks $cid) -}} | ||
{{ if eq $taskname "classify-stage-list-stop" -}} | ||
{{ $seestop = $index -}} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ $last := slice .Machine.Tasks (add $cid $seestop) -}} | ||
{{ range $index, $stagename := .ComposeParam $lp -}} | ||
{{ $first = append $first (printf "stage:%s" $stagename) -}} | ||
{{ $first = append $first "classify" -}} | ||
{{ end -}} | ||
{{ $full := concat $first $last -}} | ||
# Reset the task list | ||
drpcli machines update --force $RS_UUID - >/dev/null <<EOF | ||
Tasks: {{toJson $full}} | ||
EOF | ||
exit 0 |
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,22 @@ | ||
--- | ||
Name: "classify-stage-list-stop" | ||
Description: "Stop a set of classify stages" | ||
Documentation: | | ||
This task ends a given set of classifcation stages. No other tasks should follow it on | ||
the stage. | ||
Tasks will be dynamically injected in to the workflow if they have been specified | ||
by the appropriate control Params prior to this task. | ||
Meta: | ||
color: "blue" | ||
icon: "bug" | ||
title: "RackN Content" | ||
feature-flags: "sane-exit-codes" | ||
Templates: | ||
- Name: "validation_stop.sh" | ||
Contents: | | ||
#!/bin/bash | ||
# Copyright RackN, 2020 | ||
exit 0 |
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
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
Oops, something went wrong.