Skip to content

Commit

Permalink
fixing formatting of nornir inventory template
Browse files Browse the repository at this point in the history
  • Loading branch information
danlindow committed Feb 28, 2025
1 parent 39d373a commit f34fe40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions clab/inventory_nornir_simple.go.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- range $kind, $nodes := .Nodes }}
{{- $kindProps := index $.Kinds $kind }}
---
{{- range $kind, $nodes := .Nodes -}}
{{- $kindProps := index $.Kinds $kind -}}
{{- range $node := $nodes }}
{{ $node.ShortName }}:
username: {{ $kindProps.Username }}
Expand Down
2 changes: 1 addition & 1 deletion clab/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestGeneratNornirSimpleInventory(t *testing.T) {
}{
"case1": {
got: "test_data/topo1.yml",
want: `
want: `---
node1:
username: admin
password: NokiaSrl1!
Expand Down
1 change: 1 addition & 0 deletions docs/manual/inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ topology:
///tab | generated Nornir Simple inventory

```yaml
---
spine1:
username: admin
password: admin
Expand Down

0 comments on commit f34fe40

Please sign in to comment.