Skip to content

Commit

Permalink
edits to ansible inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jul 20, 2023
1 parent b044587 commit 262cc83
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/blog/posts/2023/ansible-srlinux-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,31 +101,31 @@ sudo containerlab inspect -t 4l2s.clab.yml
### The Ansible Inventory
In this project, we use the native file-based Ansible inventory. It lists the hosts that are part of the fabric and groups them in a way that reflects the fabric topology. The inventory file is located in the `inv` directory and contains next to the inventory file `ansible-inventory.yml` also `host_vars` and `group_vars` directories that contain host- and group-specific variables.
In this project, we use the native file-based Ansible inventory. It lists the hosts that are part of the fabric and groups them in a way that reflects the fabric topology. The inventory file - [`ansible-inventory.yml`](https://github.com/srl-labs/intent-based-ansible-lab/blob/main/inv/ansible-inventory.yml) - is located in the [`inv`](https://github.com/srl-labs/intent-based-ansible-lab/tree/main/inv) directory; `host_vars` and `group_vars` directories next to it contain host- and group-specific variables.
```bash
inv
├── ansible-inventory.yml # => the inventory file
├── ansible-inventory.yml # the inventory file
├── group_vars
│   └── srl.yml # => group-specific variables for the srl group
│   └── srl.yml # group-specific variables for the srl group
└── host_vars
├── clab-4l2s-l1.yml # => host-specific variables for the clab-4l2s-l1 host
├── clab-4l2s-l1.yml # host-specific variables for the clab-4l2s-l1 host
├── clab-4l2s-l2.yml
├── clab-4l2s-l3.yml
├── clab-4l2s-l4.yml
├── clab-4l2s-s1.yaml
└── clab-4l2s-s2.yml
```
Ansible is instructed to use this inventory file by setting `inventory = inv` in the `ansible.cfg` configuration file.
Ansible is instructed to use this inventory file by setting `inventory = inv` in the [`ansible.cfg`](https://github.com/srl-labs/intent-based-ansible-lab/blob/main/ansible.cfg#L4) configuration file.
The `ansible-inventory.yml` defines 3 groups:
- 'srl' for all SR Linux nodes
- 'spine' for the spine nodes
- 'leaf' for the leaf nodes.
The `host_vars` directory contains a file for each host that defines host-specific variables. The `group_vars` directory contains a single file for the `srl` group to define Ansible-specific variables that are required for the JSON-RPC connection-plugin as well as some system-level configuration data.
- `srl` - for all SR Linux nodes
- `spine` - for the spine nodes
- `leaf` - for the leaf nodes.
The [`host_vars`](https://github.com/srl-labs/intent-based-ansible-lab/tree/main/inv/host_vars) directory contains a file for each host that defines host-specific variables. The [`group_vars`](https://github.com/srl-labs/intent-based-ansible-lab/tree/main/inv/group_vars) directory contains a single file for the `srl` group to define Ansible-specific variables that are required for the JSON-RPC connection-plugin as well as some system-level configuration data.
### The Ansible Playbook
Expand Down

0 comments on commit 262cc83

Please sign in to comment.