Skip to content

Commit

Permalink
docs/resources/instance: add multiple ordered execs
Browse files Browse the repository at this point in the history
Fixes #486

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jun 27, 2024
1 parent de57494 commit 6161368
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/resources/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ resource "lxd_instance" "instance1" {
## Executing Commands in Instances

The `execs` map defines commands to be executed within an instance. Each element in the map
represents an exec command, uniquely identified by its map key. The commands are executed in
an order determined alphabetically by their map keys.
represents an exec command, uniquely identified by its map key. **The commands
are executed in alphabetical order of their map keys.**

### Commands and Environment Access

Expand All @@ -252,9 +252,19 @@ resource "lxd_instance" "inst" {
image = "ubuntu-daily:22.04"
execs = {
"simple_cmd" = {
"00-run-first" = {
# wait for boot to complete
command = ["systemctl", "is-system-running", "--wait", "--quiet"]
trigger = "on_start"
}
"simple-cmd" = {
command = ["ls", "/"]
}
"zz-run-last" = {
# show how long it took to boot
command = ["systemd-analyze", "--no-pager"]
trigger = "on_start"
}
}
}
```
Expand Down

0 comments on commit 6161368

Please sign in to comment.