| 1 |
# Dynvariables entry |
| 2 |
|
| 3 |
The **dynvariables** entry (optional) contains an interpreted variables mapping. |
| 4 |
|
| 5 |
```yaml |
| 6 |
dynvariables: |
| 7 |
<variable-name>: <shell-oneliner> |
| 8 |
``` |
| 9 |
|
| 10 |
You can also use multi-line (see [yaml related doc](https://yaml-multiline.info/)). |
| 11 |
For example: |
| 12 |
```yaml |
| 13 |
dynvariables: |
| 14 |
<variable-name>: >- |
| 15 |
<line1> |
| 16 |
<line2> |
| 17 |
<line3> |
| 18 |
``` |
| 19 |
|
| 20 |
For example: |
| 21 |
```yaml |
| 22 |
dynvariables: |
| 23 |
dvar1: head -1 /proc/meminfo |
| 24 |
dvar2: "echo 'this is some test' | rev | tr ' ' ','" |
| 25 |
dvar3: /tmp/my_shell_script.sh |
| 26 |
user: "echo $USER" |
| 27 |
config_file: >- |
| 28 |
test -f "{{@@ base_config @@}}" && |
| 29 |
echo "{{@@ base_config @@}}" || |
| 30 |
echo "{{@@ dfl_config @@}}" |
| 31 |
variables: |
| 32 |
base_config: "profile_base.yaml" |
| 33 |
dfl_config: "profile_default.yaml" |
| 34 |
``` |
| 35 |
|
| 36 |
They have the same properties as [Variables](config-variables.md). |