55 lines
1.5 KiB
Markdown
55 lines
1.5 KiB
Markdown
|
|
---
|
||
|
|
title: Configuration
|
||
|
|
description: infctl configuration
|
||
|
|
---
|
||
|
|
|
||
|
|
`infctl` uses `json` files for configuration.
|
||
|
|
|
||
|
|
It is designed around the idea of pipelines where each pipeline performs a series of steps.
|
||
|
|
|
||
|
|
A short, 2 step pipeline configuration can look like :
|
||
|
|
|
||
|
|
```json
|
||
|
|
[
|
||
|
|
{
|
||
|
|
"name": "ensure inf namespace exists",
|
||
|
|
"function": "k8sNamespaceExists",
|
||
|
|
"params": ["infctl"],
|
||
|
|
"retryCount": 0,
|
||
|
|
"shouldAbort": true
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"name": "run inf redis secret",
|
||
|
|
"function": "RunScriptCommand",
|
||
|
|
"params": ["./scripts/create_php_configmap_ctl.sh"],
|
||
|
|
"retryCount": 0,
|
||
|
|
"shouldAbort": true
|
||
|
|
}
|
||
|
|
]
|
||
|
|
```
|
||
|
|
|
||
|
|
Each Object is a task.
|
||
|
|
|
||
|
|
Object task records are executed in a `[]` list and in sequence.
|
||
|
|
|
||
|
|
Each task has a `name` to be displayed in logs.
|
||
|
|
|
||
|
|
Each task calls a `Function` that is registered within `infctl` and that accepts `params` string, which are any parameters to be passed to that function, script or executable. The simplest example being `RunScriptCommand` which accepts the path to a script or executable as its `params`. This can be anything but can be as simple as :
|
||
|
|
|
||
|
|
```bash
|
||
|
|
echo "hello world"
|
||
|
|
|
||
|
|
exit 0
|
||
|
|
```
|
||
|
|
|
||
|
|
So `infctl` is unlimited as to what it can use in its pipeline files to achieve any kind of automation.
|
||
|
|
|
||
|
|
If a task fails ( the script or program that is run returns a non zero value ) it may be re-tried up to `retryCount` times.
|
||
|
|
|
||
|
|
If a task fails the pipeline will stop running unless `shouldAbort` is set to false, in which case, the pipeline will continue to run with the next step item in the list.
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|