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

AAP Demo #37

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,8 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/

# Ansible Builder
context

43 changes: 43 additions & 0 deletions AAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AVD with Ansible Automation Platform

This guide leverages the [AVD with Ansible Automation Platform (AAP) guide](https://avd.arista.com/stable/docs/getting-started/avd-aap.html) on avd.arista.com as a base to get AVD running with AAP. You may leverage this repository as your base configuration but modify it to fit your needs.

## Fork the repository

If you would like to use this repository, please [fork](https://github.com/arista-netdevops-community/atd-avd/fork) it and make the required changes.

## Update links and credentials

In the `inventory.yml` file, update the `user_pass` credential for the unique credential assigned to your lab topology. Make sure also to uncomment the `user_pass` variable.

```yaml
vars:
ansible_user: arista
ansible_password: "{{ user_pass | arista.avd.default(lookup('env', 'LABPASSPHRASE')) }}"
# user_pass: <Enter lab password here>
```

In the `aap-cv-deploy.yml` file, update the `cv_server` variable to the URL for your lab instance.

```yaml
- name: Provision CV with AVD configuration
import_role:
name: cv_deploy
vars:
cv_server: # Update lab CV URL ex, example1.topo.testdrive.arista.com
cv_token: "{{ lab_token }}"
cv_run_change_control: true
```

> Please note that the `lab_token` variable will be inherited by our survey secret defined within AAP.


## Enable end-to-end provisioning

Click on settings on the lower left of the main pane and enable "Studios - End-to-End Provisioning."

![Studions settings](./docs/imgs/avd-studios-provisioning.png)

## Build and deploy

Now, everything is ready to provision your network with AAP and AVD. Feel free to follow the AAP guide on [avd.arista.com](https://avd.arista.com/stable/docs/getting-started/avd-aap.html) and explore any day two actions on the [AVD with ATD guide](./DEMO.md#5-update-underlay-routing-protocol).
2 changes: 1 addition & 1 deletion DEMO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Step-by-step demo
# AVD with Arista Test Drive

## 1. Connect to GUI VM

Expand Down
73 changes: 3 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,77 +35,10 @@ The diagram below shows that the ATD lab topology has two data centers. We will

> Current repository is built with cEOS management interface (`Management0`). If you run a vEOS topology, please update `mgmt_interface` field to `Management1` in the [ATD_LAB](./atd-inventory/group_vars/ATD_LAB.yml) `group_vars`.

## Getting Started
## Step-by-step walkthroughs

### Connect to your ATD lab environment

- Don't hesitate to contact your local account team if you need an ATD Lab instance.
- Once connected to the ATD lab instance, select the Programmability IDE.
- This container is built with all the requirements and Python modules to run AVD playbooks.

1. Next (optional), set up a Git user and email for the ATD lab environment

- Open a terminal window in VS Code View -> Terminal from the menu, and run the following commands:

```shell
# Setup your git global config (optional)
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
```

2. Set credentials and install any required tools

> :warning: __Warning:__ Specific for the ATD environment. the `pip config` lines disable PIP safety checks and should not be used outside of ATD without understanding them.

```shell
cd /home/coder/project/labfiles
export LABPASSPHRASE=`cat /home/coder/.config/code-server/config.yaml| grep "password:" | awk '{print $2}'`
ansible-galaxy collection install arista.avd:==4.10.0
pip3 config set global.break-system-packages true
pip3 config set global.disable-pip-version-check true
pip install "pyavd[ansible]==4.10.0"
git clone https://github.com/arista-netdevops-community/atd-avd.git
cd atd-avd
```

3. Run the playbook to prepare CloudVision for AVD

- Execute the following command:

```shell
ansible-playbook playbooks/atd-prepare-lab.yml
```

- Check that tasks in CloudVision have been automatically completed

4. Run playbook to deploy AVD setup

- Run the following commands:

```shell
ansible-playbook playbooks/atd-fabric-build.yml
ansible-playbook playbooks/atd-fabric-provision.yml
```

- Run pending tasks in CloudVision Portal manually.

5. Run validation and snapshot playbooks

- Run the following commands:

```shell
# Run audit playbook to validate the fabric state
ansible-playbook playbooks/atd-validate-states.yml

# Run the atd-snapshot playbook to collect show commands
ansible-playbook playbooks/atd-snapshot.yml
```

- Review generated output.

## Step-by-step walkthrough

A complete [step-by-step guide](./DEMO.md) is available.
- [AVD with Arista Test Drive (ATD)](./DEMO.md)
- [AVD and Ansible Automation Platform (AAP)](./AAP.md)

## Resources

Expand Down
34 changes: 34 additions & 0 deletions atd-inventory/group_vars/ATD_LAB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,37 @@ name_servers:
- 8.8.8.8

dns_domain: atd.lab

local_users:

- name: arista
privilege: 15
role: network-admin
sha512_password: "{{ user_pass | password_hash('sha512', salt='arista') }}"

cvp_instance_ips:
- 192.168.0.5
terminattr_disable_aaa: True
terminattr_ingestexclude: /Sysdb/cell/1/agent,/Sysdb/cell/2/agent
terminattr_ingestgrpcurl_port: 9910
terminattr_smashexcludes: ale,flexCounter,hardware,kni,pulse,strata

ntp:
servers:
- name: 192.168.0.1
iburst: True
local_interface: Management0

aaa_authentication:
login:
default: group atds local
aaa_authorization:
exec:
default: group atds local
commands:
all_default: local
aaa_server_groups:
- name: atds
type: radius
servers:
- server: 192.168.0.1
3 changes: 2 additions & 1 deletion atd-inventory/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ all:

vars:
ansible_user: arista
ansible_password: "{{ lookup('env', 'LABPASSPHRASE') }}"
ansible_password: "{{ user_pass | arista.avd.default(lookup('env', 'LABPASSPHRASE')) }}"
# user_pass: <Enter lab password here>
ansible_network_os: arista.eos.eos
# Configure privilege escalation
ansible_become: true
Expand Down
Binary file added docs/imgs/avd-studios-provisioning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions execution-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: 3

images:
base_image:
name: registry.fedoraproject.org/fedora:40

dependencies:
python_interpreter:
package_system: python311
python_path: /usr/bin/python3.11

ansible_core:
package_pip: ansible-core<2.17.0

ansible_runner:
package_pip: ansible-runner

galaxy: requirements.yml

python: requirements.txt
26 changes: 26 additions & 0 deletions playbooks/aap-cv-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Manage Arista EOS EVPN/VXLAN Configuration
hosts: ATD_FABRIC
connection: local
gather_facts: false
collections:
- arista.avd
vars:
fabric_dir_name: "{{ fabric_name }}"
tasks:

- name: Generate intended variables
import_role:
name: eos_designs

- name: Generate device intended config and documentation
import_role:
name: eos_cli_config_gen

- name: Provision CV with AVD configuration
import_role:
name: cv_deploy
vars:
cv_server: # Update the lab CV URL ex, example1.topo.testdrive.arista.com
cv_token: "{{ lab_token }}"
cv_run_change_control: true
12 changes: 1 addition & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
netaddr>=0.7.19
Jinja2>=2.11.3
treelib>=1.5.5
cvprac>=1.3.1
paramiko>=2.7.1
jsonschema>=4.5.1,<4.18
requests>=2.25.1
PyYAML>=5.4.1
md-toc>=7.1.0
deepmerge>=1.1.0
cryptography>=38.0.4
pyavd[ansible-collection]==4.10.0
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
collections:
- name: arista.avd
version: 4.10.0