Skip to content

Commit

Permalink
Refactor eos_designs template structure (aristanetworks#876)
Browse files Browse the repository at this point in the history
* Done with yaml_template_to_var.py
* Refactor l3_edge feature
* Refactor l3_edge feature
* Update CI Artifacts
* refactor mlag
* refactor mlag
* refactor connected_endpoints
* refactor underlay
* folder rename
* minor fixes
* refactor underlay
* refactor underlay
* refactor underlay
* partial CI update
* mlag fixes
* partial CI update
* refactor overlay
* Fix bug in overlay
* refactor inband mgmt for l2leaf
* partial CI update
* refactor tenants
* partial CI update
* base refactor + bugfixes
* CI update
* Remove last parts of legacy templates
* Remove old templates and move new to root
* Fix newlines at EOF
* Fix whitespaces at EOL
* update python with super()
* Upgrade ansible version in CV workflow
* Update CI workflow
* small updates for requirements
* small updates for requirements
* small indentation fix
* Update plugin documentation
* Strip empty keys from facts
* Strip empty keys from facts
* Update template plugin to be more configurable.
* Update template plugin to be more configurable.
* Update module doc
* Fixing old bug with custom_structured_configuration
* feat(yaml_template_to_fact): Move functions to module_utils
* feat(module_utils): Move strip functions + docstring
* remove logic to handle null values, not required
* update documentation with new tasks
* revert change from commit 44bf2fa
* fix syntax error
* update CI artifacts -> bug fix custom structured
* typo fix
* typo fix
* change template var hierarchy
* Rename plugin and small fixes
* Fix nested exception
* update readme and image
* Update docs and tests
* Fix bug

Co-authored-by: Thomas Grimonet <[email protected]>
Co-authored-by: Carl Buchmann <[email protected]>
  • Loading branch information
3 people authored Apr 21, 2021
1 parent 2bcb1e2 commit 007b378
Show file tree
Hide file tree
Showing 416 changed files with 28,388 additions and 35,932 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
matrix:
avd_scenario: ['eos_cli_config_gen']
needs: [ pre_commit ]
if: needs.file-changes.outputs.config_gen == 'true' || startsWith(github.ref, 'refs/heads/release')
if: needs.file-changes.outputs.config_gen == 'true' || needs.file-changes.outputs.eos_design == 'true' || startsWith(github.ref, 'refs/heads/release')
steps:
- name: 'set environment variables'
run: |
Expand All @@ -132,7 +132,7 @@ jobs:
molecule_command: 'test'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/cvp/requirements.txt
ansible: "ansible==2.9.6"
ansible: "ansible==2.10.7"
check_git: true
check_git_enforced: false
- uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
molecule_command: 'test'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/cvp/requirements.txt
ansible: "ansible==2.9.6"
ansible: "ansible==2.10.7"
check_git: true
check_git_enforced: false
- uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/molecule-cvp-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:
molecule_command: 'converge'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/avd/requirements.txt
ansible: "ansible==2.9.6"
ansible: "ansible==2.10.7"
check_git: true
check_git_enforced: true
2 changes: 1 addition & 1 deletion .github/workflows/molecule-dhcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:
molecule_command: 'converge'
molecule_args: '--scenario-name ${{ matrix.avd_scenario }}'
pip_file: ansible_collections/arista/avd/requirements.txt
ansible: "ansible==2.9.6"
ansible: "ansible==2.10.7"
check_git: true
check_git_enforced: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The documentation how to leverage ansible-avd collection is located here:

**Supported Ansible Versions:**

- ansible 2.9.2 or later
- ansible 2.10.7 or later

**Additional Python Libraries required:**

Expand All @@ -81,7 +81,7 @@ The documentation how to leverage ansible-avd collection is located here:
**Ansible + Additional Python Libraries Installation:**

```shell
$ pip3 install ansible==2.9.6
$ pip3 install ansible==2.10.7

$ pip3 install -r ansible_collections/arista/avd/requirements.txt
```
Expand Down
4 changes: 2 additions & 2 deletions ansible_collections/arista/avd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This repository provides custom plugins for Ansible's collection __arista.avd__

**Supported Ansible Versions:**

- ansible 2.9.6 or later
- ansible 2.10.7 or later

**Additional Python Libraries required:**

Expand All @@ -93,7 +93,7 @@ This repository provides custom plugins for Ansible's collection __arista.avd__
**Ansible + Additional Python Libraries Installation:**

```shell
$ pip3 install ansible==2.9.6
$ pip3 install ansible==2.10.7

$ pip3 install -r requirements.txt
```
Expand Down
2 changes: 1 addition & 1 deletion ansible_collections/arista/avd/docs/_build/ansible2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def rst_ify(text):
t = _URL.sub(r'`' + r"\1" + r" <" + r"\1" + r">`_", t)
t = _CONST.sub(r'``' + r"\1" + r"``", t)
except Exception as error_caught:
raise AnsibleError("Could not process (%s) : %s" % (str(text), str(error_caught)))
raise AnsibleError("Could not process (%s) : %s" % (str(text), str(error_caught))) from error_caught
return t

#####################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ If you want to see how to build your inventory and all related variables, it is

## Requirements

To play with this repsoitory, you need:
To play with this repository, you need:

- An AWX setup running on either Docker Compose or Kubernetes. All the commands for Python configuration will be done on docker-compose, but you can adapt for kubernetes.
- Understanding of how to configure AVD in a pure Ansible CLI way.

## Install Python requirements

Ansible CVP collection comes with a needs of [additional libraries](hhttps://github.com/arista-netdevops-community/avd-with-ansible-tower-awx/blob/master/requirements.txt) not part of a standard Python setup:
Ansible CVP collection comes with a needs of [additional libraries](https://github.com/arista-netdevops-community/avd-with-ansible-tower-awx/blob/master/requirements.txt) not part of a standard Python setup:

```shell
ansible==2.9.6
ansible==2.10.7
netaddr==0.7.19
Jinja2==2.10.3
requests==2.22.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If you leverage [Cloudvision](https://www.arista.com/en/products/eos/eos-cloudvi

## Supported Ansible Versions

- ansible __2.9.2__ or later
- ansible __2.10.7__ or later
- previous ansible version not supported as avd is shipped as an [ansible collection](https://docs.ansible.com/ansible/latest/user_guide/collections_using.html)

## Additional Python Libraries required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ $ make <your command>
- `ansible-upgrade`: To upgrade ansible in your runner in conjunction with `ANSIBLE_VERSION`

```shell
$ make ansible-upgrade ANSIBLE_VERSION=2.9.8
docker-compose -f ansible-avd/development/docker-compose.yml exec -u avd ansible pip install --user --upgrade ansible==2.9.8
Collecting ansible==2.9.8
Downloading ansible-2.9.8.tar.gz (14.2 MB)
$ make ansible-upgrade ANSIBLE_VERSION=2.10.7
docker-compose -f ansible-avd/development/docker-compose.yml exec -u avd ansible pip install --user --upgrade ansible==2.10.7
Collecting ansible==2.10.7
Downloading ansible-2.10.7.tar.gz (14.2 MB)
|████████████████████████████████| 14.2 MB 475 kB/s
...
$ make shell
docker-compose -f ansible-avd/development/docker-compose.yml exec -u avd ansible zsh

Agent pid 109
➜ /projects ansible --version
ansible 2.9.8
ansible 2.10.7
```

### Commands for docker only
Expand All @@ -125,18 +125,18 @@ ansible 2.9.8
- `vscode`: start a VScode container available in your browser to edit your local files.

```shell
$ make run ANSIBLE_VERSION=2.9
$ make run ANSIBLE_VERSION=2.10
docker run --rm -it \
-e AVD_REQUIREMENTS= \
-e AVD_ANSIBLE=2.9 \
-e AVD_ANSIBLE=2.10 \
-e AVD_GIT_USER="xxxxx" \
-e AVD_GIT_EMAIL="xxxxx" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /Users/tgrimonet/Projects/arista-ansible/:/projects \
-v /etc/hosts:/etc/hosts avdteam/base:3.6-v1.0
Install ansible with version 2.9
Collecting ansible==2.9
Downloading ansible-2.9.0.tar.gz (14.1 MB)
Install ansible with version 2.10
Collecting ansible==2.10
Downloading ansible-2.10.0.tar.gz (14.1 MB)
...
```

Expand Down Expand Up @@ -210,7 +210,7 @@ You can validate everything is setup correctly:
Python 3.6.12

➜ /projects ansible --version
ansible 2.9.6
ansible 2.10.7
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/.local/lib/python3.6/site-packages/ansible
Expand Down
Binary file modified ansible_collections/arista/avd/media/role_eos_designs.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@ router bfd

| Sequence | Action |
| -------- | ------ |
| 10 | permit 192.168.255.0/24 le 32 |
| 10 | permit 192.168.255.0/24 eq 32 |

### Prefix-lists Device Configuration

```eos
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
```

## Route-maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@ router bfd

| Sequence | Action |
| -------- | ------ |
| 10 | permit 192.168.255.0/24 le 32 |
| 10 | permit 192.168.255.0/24 eq 32 |

### Prefix-lists Device Configuration

```eos
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
```

## Route-maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@ router bfd

| Sequence | Action |
| -------- | ------ |
| 10 | permit 192.168.255.0/24 le 32 |
| 10 | permit 192.168.255.0/24 eq 32 |

### Prefix-lists Device Configuration

```eos
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
```

## Route-maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@ router bfd

| Sequence | Action |
| -------- | ------ |
| 10 | permit 192.168.255.0/24 le 32 |
| 10 | permit 192.168.255.0/24 eq 32 |

### Prefix-lists Device Configuration

```eos
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
```

## Route-maps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ip routing
no ip routing vrf MGMT
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ip routing
no ip routing vrf MGMT
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ip routing
no ip routing vrf MGMT
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ip routing
no ip routing vrf MGMT
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 192.168.255.0/24 le 32
seq 10 permit 192.168.255.0/24 eq 32
!
ip route vrf MGMT 0.0.0.0/0 192.168.200.5
!
Expand Down
Loading

0 comments on commit 007b378

Please sign in to comment.