Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create inventory layout example with both DC and campus fabrics #4750

Open
ClausHolbechArista opened this issue Nov 21, 2024 · 0 comments
Open

Comments

@ClausHolbechArista
Copy link
Contributor

ClausHolbechArista commented Nov 21, 2024

From discussion #4706

It is a common pattern to build different fabrics as separate Ansible inventories.

An example could be:

avd
├── global_vars
│   ├── management             # Our 'global_vars' plugin will parse one layer of folders for YAML files.
│   │   ├── snmp_settings.yml
│   │   ├── local_users.yml
│   │   └── <...>
│   ├── network_services
│   │   ├── network_services_keys.yml  # Contains only the 'network_services_keys' key
│   │   └── <...>
│   └── <...>
├── playbooks
│   ├── build.yml
│   ├── deploy.yml
│   └── <...>
├── DATA_CENTER
│   ├── group_vars
│   │   ├── DATA_CENTER           # Ansible will parse one layer of folders for YAML files.
│   │   │   ├── misc.yml          # Contains 'fabric_name' and other common settings
│   │   │   └── <...>
│   │   ├── NETWORK_SERVICES
│   │   │   ├── tenant_a.yml      # Contains only the 'tenant_a' key (defined under 'network_services_keys')
│   │   │   └── <...>
│   │   ├── DC1
│   │   │   ├── misc.yml          # Contains 'dc_name' and other common settings
│   │   │   └── <...>
│   │   ├── DC1_SUPER_SPINES
│   │   │   ├── super_spine.yml   # Contains only the 'super_spine' and 'type' keys
│   │   │   ├── l3_edge.yml       # Contains only the 'l3_edge' key
│   │   │   └── <...>
│   │   ├── DC1_POD1
│   │   │   ├── misc.yml          # Contains 'pod_name' and other common settings
│   │   │   └── <...>
│   │   ├── DC1_POD1_SPINES
│   │   │   ├── spines.yml        # Contains only the 'spines' and 'type' keys
│   │   │   └── <...>
│   │   ├── DC1_POD1_L3LEAFS
│   │   │   ├── l3leaf.yml        # Contains only the 'l3leaf' and 'type' keys
│   │   │   └── <...>
│   │   ├── DC1_POD1_RACK1
│   │   │   ├── servers.yml       # Contains only connected endpoints for this rack
│   │   │   └── <...>
│   │   └── <...>
│   ├── host_vars
│   │   ├── dc1-pod1-spine1       # Ansible will parse one layer of folders for YAML files.
│   │   │   └── <...>             
│   │   └── <...>             
│   └── inventory.yml
├── CAMPUS
│   ├── group_vars
│   │   ├── CAMPUS                # Ansible will parse one layer of folders for YAML files.
│   │   │   ├── misc.yml          # Contains 'fabric_name' and other common settings
│   │   │   └── <...>
│   │   ├── NETWORK_SERVICES
│   │   │   ├── tenant_a.yml      # Contains only the 'tenant_a' key (defined under 'network_services_keys')
│   │   │   └── <...>
│   │   ├── CAMPUS_CORE
│   │   │   ├── spine.yml         # Contains only the 'spine' and 'type' keys
│   │   │   └── <...>
│   │   ├── BUILDING1
│   │   │   ├── misc.yml          # Contains 'dc_name' and other common settings
│   │   │   └── <...>
│   │   ├── BUILDING1_CORE
│   │   │   ├── l3spine.yml       # Contains only the 'l3spine' and 'type' keys
│   │   │   └── <...>
│   │   ├── BUILDING1_FLOOR1
│   │   │   ├── l2leaf.yml         # Contains only the 'l2leaf' and 'type' keys
│   │   │   ├── network_ports.yml  # Contains only the 'network_ports' key
│   │   │   ├── misc.yml           # Contains 'pod_name' and other common settings
│   │   │   └── <...>
│   │   └── <...>
│   ├── host_vars
│   │   ├── bld1-fl1-sw1           # Ansible will parse one layer of folders for YAML files.
│   │   │   └── <...>             
│   │   └── <...>             
│   └── inventory.yml
├── ansible.cfg
└── Makefile

Your Makefile could contain make targets like:

.PHONY: build-dc
build-dc: ## Build DC inventory
<tab>ansible-playbook playbooks/build.yml -i DATA_CENTER/inventory.yml

All this is just some example I made up for this answer, but we will work on an example for all this as time allows.

Originally posted by @ClausHolbechArista in #4706 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant