Create and update containers on CloudVision
1. Review containers vars
# Go to lab05 directory
$ cd ../lab05-cv-containers
$ cat group_vars/CVP.yml
---
CVP_CONTAINERS:
TRAINING:
parent_container: Tenant
TRAINING_DC:
parent_container: TRAINING
TRAINING_LEAFS:
parent_container: TRAINING_DC
TRAINING_SPINES:
parent_container: TRAINING_DC
devices:
- 'spine1'
2. Create containers and move device
# Run playbook to create containers and move device
$ ansible-playbook playbook.container.yml
On cloudvision server, cancel task and move back device to its initial container
3. Optional: Attach 01TRAINING-01 to TRAINING container
Edit CVP.yml file
# Attach 01TRAINING-01 to TRAINING container and remove Spine1 under the container TRAINING_SPINES
$ vi group_vars/CVP.yml
And update content with the following:
---
CVP_CONFIGLETS:
01TRAINING-alias: "alias a{{ 999 | random }} show version"
01TRAINING-01: "alias a{{ 999 | random }} show version"
CVP_CONTAINERS:
TRAINING:
parent_container: Tenant
configlets:
- '01TRAINING-01'
TRAINING_DC:
parent_container: TRAINING
TRAINING_LEAFS:
parent_container: TRAINING_DC
TRAINING_SPINES:
parent_container: TRAINING_DC
# Run playbook to attach the configlet to the container
$ ansible-playbook playbook.container.yml
It will fail. Why does it fail? How can you solve the issue? Hint: is the configlet that you are trying to attach to the container present on CloudVision?
4. Remove Container topology
# Edit playbook and change mode to `delete`
$ vi playbook.container.yml
- name: "Configure containers on {{inventory_hostname}}"
arista.cvp.cv_container:
cvp_facts: "{{CVP_FACTS.ansible_facts}}"
topology: "{{CVP_CONTAINERS}}"
mode: delete
register: CVP_CONTAINERS_RESULT
# Run playbook to delete containers
$ ansible-playbook playbook.container.yml
Then check on CloudVision