Skip to content

Commit

Permalink
Merge branch 'devel' into isis_auth_vlan_int
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausHolbechArista authored Jul 30, 2024
2 parents e4eff82 + b282b6c commit fc72801
Show file tree
Hide file tree
Showing 170 changed files with 646 additions and 391 deletions.
10 changes: 5 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Collapsing generated schemas from PR diff by default
/python_avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml linguist-generated=true -merge -diff
/python_avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json linguist-generated=true -merge -diff
/python_avd/pyavd/_eos_designs/schema/eos_designs.schema.yml linguist-generated=true -merge -diff
/python_avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json linguist-generated=true -merge -diff
/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml linguist-generated=true -merge -diff
/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json linguist-generated=true -merge -diff
/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml linguist-generated=true -merge -diff
/python-avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json linguist-generated=true -merge -diff

# Showing generated tables in PR diff by default by count as generated and automatically use the latest file on merge
/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/* linguist-generated=true -merge diff
Expand All @@ -19,4 +19,4 @@
/ansible_collections/arista/avd/docs/* linguist-documentation

# CV API files are generated from proto files
/python_avd/pyavd/_cv/api linguist-generated=true
/python-avd/pyavd/_cv/api linguist-generated=true
7 changes: 3 additions & 4 deletions .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ jobs:
fail-fast: true
matrix:
python_version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
Expand Down Expand Up @@ -344,8 +343,8 @@ jobs:
name: Run ansible-test sanity validation
runs-on: ubuntu-latest
needs: [ file-changes ]
#needs: [ molecule_eos_designs, molecule_cloudvision ]
#if: needs.cloudvision.status != 'failed' && needs.molecule_eos_designs.status != 'failed' && needs.file-changes.outputs.plugins == 'true'
# needs: [ molecule_eos_designs, molecule_cloudvision ]
# if: needs.cloudvision.status != 'failed' && needs.molecule_eos_designs.status != 'failed' && needs.file-changes.outputs.plugins == 'true'
steps:
- name: 'Set environment variables'
run: |
Expand Down Expand Up @@ -482,7 +481,7 @@ jobs:
needs.file-changes.outputs.pyavd == 'true'
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
python: ["3.10", "3.11", "3.12"]
steps:
- name: 'Set environment variables'
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull-request-rn-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# changed post merge
name: "Label for Release Notes"


on:
pull_request_target:
types:
Expand Down
55 changes: 38 additions & 17 deletions .github/yamllintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# Used by pre-commit. There is a similar file under the Ansible collection used by ansible-lint.
extends: default

yaml-files:
Expand All @@ -8,31 +9,51 @@ yaml-files:

rules:
braces:
level: warning
min-spaces-inside: 0
max-spaces-inside: 1
level: error
brackets:
level: warning
max-spaces-inside: 1
level: error
colons:
level: warning
max-spaces-after: -1
level: error
commas:
level: warning
comments: disable
comments-indentation: disable
max-spaces-after: -1
level: error
comments:
# prettier compatibility
min-spaces-from-content: 1
level: error
comments-indentation: false
document-start: disable
empty-lines:
level: warning
max: 1
level: error
ignore:
- /python-avd/pyavd/**/schema/*.schema.yml
- /python-avd/tests/pyavd/schema/
- /python-avd/tests/schema_tools/artifacts/*.schema.yml
hyphens:
level: warning
level: error
key-duplicates:
forbid-duplicated-merge-keys: true
line-length:
max: 160
ignore:
- /ansible_collections/arista/avd/molecule/**/intended/structured_configs/
- /ansible_collections/arista/avd/molecule/**/intended/structured_configs/cvp/
- /ansible_collections/arista/avd/examples/**/intended/structured_configs/cvp/
- /ansible_collections/arista/avd/changelogs/fragments_backup/
- /ansible_collections/arista/avd/tests/inventory/**/expected_output/
- /python-avd/pyavd/**/schema/
- /.github/workflows/
new-lines:
type: unix
indentation:
level: warning
level: error
indent-sequences: consistent
line-length:
max: 350
level: warning
allow-non-breakable-inline-mappings: true
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
truthy: disable

ignore: |
ansible_collections/arista/avd/molecule/Makefile
ansible_collections/arista/avd/molecule/README.md
20 changes: 15 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,19 @@ repos:

- id: docs-plugin-modules
name: Build documentation for collection modules and action plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/"
entry: >-
ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2
--markdown "ansible_collections/arista/avd/docs/plugins/Modules_and_action_plugins/"
language: python
types: [python]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
files: ansible_collections/arista/avd/plugins/modules/

- id: docs-plugin-filter
name: Build documentation for collection filter plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Filter_plugins/"
entry: >-
ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2
--markdown "ansible_collections/arista/avd/docs/plugins/Filter_plugins/"
language: python
types_or: [python, yaml]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
Expand All @@ -187,23 +191,29 @@ repos:

- id: docs-plugin-lookup
name: Build documentation for collection lookup plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Lookup_plugins/"
entry: >-
ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2
--markdown "ansible_collections/arista/avd/docs/plugins/Lookup_plugins/"
language: python
types: [python]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
files: ansible_collections/arista/avd/plugins/lookup/

- id: docs-plugin-test
name: Build documentation for collection test plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Test_plugins/"
entry: >-
ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2
--markdown "ansible_collections/arista/avd/docs/plugins/Test_plugins/"
language: python
types: [python]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
files: ansible_collections/arista/avd/plugins/test/

- id: docs-plugin-vars
name: Build documentation for collection var plugins.
entry: ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2 --markdown "ansible_collections/arista/avd/docs/plugins/Vars_plugins/"
entry: >-
ansible-doc-extractor --template ansible_collections/arista/avd/docs/templates/plugin-docs.j2
--markdown "ansible_collections/arista/avd/docs/plugins/Vars_plugins/"
language: python
types: [python]
additional_dependencies: ['ansible-doc-extractor>=0.1.10', 'ansible-core>=2.15.0,<2.18.0']
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Python version
sonar.python.version=3.9, 3.10, 3.11, 3.12
sonar.python.version=3.10, 3.11, 3.12
# Exclude tests from source
sonar.exclusions=python-avd/tests/**
# Path to tests
Expand Down
33 changes: 24 additions & 9 deletions ansible_collections/arista/avd/.yamllint
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
# Based on ansible-lint config
# Based on ansible-lint config - https://ansible.readthedocs.io/projects/lint/rules/yaml/#yamllint-configuration
extends: default

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 1
level: error
brackets:
Expand All @@ -15,19 +16,33 @@ rules:
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
comments:
# prettier compatibility
min-spaces-from-content: 1
level: error
comments-indentation: false
document-start: disable
empty-lines:
max: 3
max: 1
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
key-duplicates:
forbid-duplicated-merge-keys: true
line-length:
max: 160
ignore:
- /molecule/**/intended/structured_configs/
- /molecule/**/intended/structured_configs/cvp/
- /examples/**/intended/structured_configs/cvp/
- /changelogs/fragments_backup/
- /tests/inventory/**/expected_output
new-lines:
type: unix
trailing-spaces: disable
indentation:
level: error
indent-sequences: consistent
octal-values:
forbid-implicit-octal: true
forbid-explicit-octal: true
truthy: disable
2 changes: 1 addition & 1 deletion ansible_collections/arista/avd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AVD Documentation:

The AVD collection has the following requirements:

- Python 3.9 or above
- Python 3.10 or above
- Ansible Core 2.15.0 to 2.17.x
- [Additional Python Dependencies](#additional-python-dependencies)
- Modify the `ansible.cfg` file to support additional Jinja2 extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Installation workflow

- Install [Python](https://www.python.org/downloads/) **3.9** or later
- Install [Python](https://www.python.org/downloads/) **3.10** or later
- Install [arista.avd](#install-collection-from-ansible-galaxy) collection including Python requirements.
- Modify `ansible.cfg` file to support additional [jinja2 extensions](#ansible-configuration-file)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tasks:
copy:
content: "{{ lookup('template','documentation/fabric-documentation.j2') | arista.avd.add_md_toc(skip_lines=3) }}"
dest: "{{ fabric_dir }}/{{ fabric_name }}-documentation.md"
mode: 0664
mode: "0o664"
```
## Return Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The `arista.avd.eos_designs_structured_config` module is an Ansible Action Plugi
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list_merge</samp> | str | False | append | | Merge strategy for lists |
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strip_empty_keys</samp> | bool | False | True | | Filter out keys from the generated output if value is null/none/undefined<br>Only applies to templates. |
| <samp>dest</samp> | str | False | None | | Destination path. If set, the output facts will also be written to this path.<br>Autodetects data format based on file suffix. &#39;.yml&#39;, &#39;.yaml&#39; -&gt; YAML, default -&gt; JSON |
| <samp>mode</samp> | str | False | None | | File mode (ex. 0664) for dest file. See &#39;ansible.builtin.copy&#39; module for details. |
| <samp>mode</samp> | str | False | None | | File mode (ex. &#34;0o664&#34;) for dest file. See &#39;ansible.builtin.copy&#39; module for details. |
| <samp>template_output</samp> | bool | False | None | | If true, the output data will be run through another jinja2 rendering before returning.<br>This is to resolve any input values with inline jinja using variables/facts set by the input templates. |
| <samp>conversion_mode</samp> | str | False | debug | Valid values:<br>- <code>error</code><br>- <code>warning</code><br>- <code>info</code><br>- <code>debug</code><br>- <code>quiet</code><br>- <code>disabled</code> | Run data conversion in either &#34;error&#34;, &#34;warning&#34;, &#34;info&#34;, &#34;debug&#34;, &#34;quiet&#34; or &#34;disabled&#34; mode.<br>Conversion will perform type conversion of input variables as defined in the schema.<br>Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.<br>During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.<br>conversion_mode:disabled means that conversion will not run.<br>conversion_mode:error will produce error messages and fail the task.<br>conversion_mode:warning will produce warning messages.<br>conversion_mode:info will produce regular log messages.<br>conversion_mode:debug will produce hidden messages viewable with -v.<br>conversion_mode:quiet will not produce any messages. |
| <samp>validation_mode</samp> | str | False | warning | Valid values:<br>- <code>error</code><br>- <code>warning</code><br>- <code>info</code><br>- <code>debug</code><br>- <code>disabled</code> | Run validation in either &#34;error&#34;, &#34;warning&#34;, &#34;info&#34;, &#34;debug&#34; or &#34;disabled&#34; mode.<br>Validation will validate the input variables according to the schema.<br>During validation, messages will be generated with information about the host(s) and key(s) which failed validation.<br>validation_mode:disabled means that validation will not run.<br>validation_mode:error will produce error messages and fail the task.<br>validation_mode:warning will produce warning messages.<br>validation_mode:info will produce regular log messages.<br>validation_mode:debug will produce hidden messages viewable with -v. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ For Markdown files the plugin can also run md_toc on the output before writing t
arista.avd.validate_and_template:
template: "eos-device-documentation.j2"
dest: "{{ devices_dir }}/{{ inventory_hostname }}.md"
mode: 0664
mode: "0o664"
schema: "{{ lookup('ansible.builtin.file', role_schema_path) | from_yaml }}"
conversion_mode: "{{ avd_data_conversion_mode }}"
validation_mode: "{{ avd_data_validation_mode }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Set facts from YAML produced by Jinja2 templates
| <samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strip_empty_keys</samp> | bool | False | True | | Filter out keys from the generated output if value is null/none/undefined. Only applies to templates. |
| <samp>debug</samp> | bool | False | None | | Output list &#39;avd_yaml_templates_to_facts_debug&#39; with timestamps of each performed action. |
| <samp>dest</samp> | str | False | None | | Destination path. If set, the output facts will also be written to this path.<br>Autodetects data format based on file suffix. &#39;.yml&#39;, &#39;.yaml&#39; -&gt; YAML, default -&gt; JSON |
| <samp>mode</samp> | str | False | None | | File mode (ex. 0664) for dest file. See &#39;ansible.builtin.copy&#39; module for details. |
| <samp>mode</samp> | str | False | None | | File mode (ex. &#34;0o664&#34;) for dest file. See &#39;ansible.builtin.copy&#39; module for details. |
| <samp>template_output</samp> | bool | False | None | | If true, the output data will be run through another jinja2 rendering before returning.<br>This is to resolve any input values with inline jinja using variables/facts set by the input templates. |
| <samp>conversion_mode</samp> | str | False | debug | Valid values:<br>- <code>error</code><br>- <code>warning</code><br>- <code>info</code><br>- <code>debug</code><br>- <code>quiet</code><br>- <code>disabled</code> | Run data conversion in either &#34;error&#34;, &#34;warning&#34;, &#34;info&#34;, &#34;debug&#34;, &#34;quiet&#34; or &#34;disabled&#34; mode.<br>Conversion will perform type conversion of input variables as defined in the schema.<br>Conversion is intended to help the user to identify minor issues with the input data, while still allowing the data to be validated.<br>During conversion, messages will be generated with information about the host(s) and key(s) which required conversion.<br>conversion_mode:disabled means that conversion will not run.<br>conversion_mode:error will produce error messages and fail the task.<br>conversion_mode:warning will produce warning messages.<br>conversion_mode:info will produce regular log messages.<br>conversion_mode:debug will produce hidden messages viewable with -v.<br>conversion_mode:quiet will not produce any messages. |
| <samp>validation_mode</samp> | str | False | warning | Valid values:<br>- <code>error</code><br>- <code>warning</code><br>- <code>info</code><br>- <code>debug</code><br>- <code>disabled</code> | Run validation in either &#34;error&#34;, &#34;warning&#34;, &#34;info&#34;, &#34;debug&#34; or &#34;disabled&#34; mode.<br>Validation will validate the input variables according to the schema.<br>During validation, messages will be generated with information about the host(s) and key(s) which failed validation.<br>validation_mode:disabled means that validation will not run.<br>validation_mode:error will produce error messages and fail the task.<br>validation_mode:warning will produce warning messages.<br>validation_mode:info will produce regular log messages.<br>validation_mode:debug will produce hidden messages viewable with -v. |
Expand Down
59 changes: 59 additions & 0 deletions ansible_collections/arista/avd/docs/porting-guides/5.x.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# This title is used for search results
title: Porting Guide for Ansible AVD 5.x.x
---
<!--
~ Copyright (c) 2024 Arista Networks, Inc.
~ Use of this source code is governed by the Apache License 2.0
~ that can be found in the LICENSE file.
-->

# Porting Guide for Ansible AVD 5.x.x

Major releases of AVD can contain breaking changes. This porting guide addresses how to update your inventory
and playbooks to be compatible with new default behaviors and changed data models when upgrading from AVD 4.x versions.

!!! note
To upgrade from AVD version 3.x, first upgrade to AVD 4.10 using the [Porting Guide for Ansible AVD 4.x.x](https://avd.arista.com/4.10/docs/porting-guides/4.x.x.html)
and then upgrade to 5.x with this guide.

Users of `eos_designs` do not have to consider the changes in `eos_cli_config_gen`, since those adaptions are
built into `eos_designs`.

## Common changes

### Data model changes from "dict-of-dicts" to "list-of-dicts"

TODO: Removed type conversion

## Removal of Ansible plugins

The following ansible plugins have been removed from the `arista.avd` Ansible collection in v5.0.0.

| Plugin type | Plugin name | Replacement |
| ----------- | ----------- | ----------- |
| TODO: list out the removed plugins and replacements (take from deprecation docs) | | |

## Changes to role arista.avd.eos_designs

TODO: Level 3 sections for each change with details on how to migrate

### Removal of deprecated data models

The following data model keys have been removed from `eos_designs` in v5.0.0.

| Removed key | New key |
| ----------- | ------- |
| TODO | |

## Changes to role `arista.avd.eos_cli_config_gen`

TODO: Level 3 sections for each change with details on how to migrate

### Removal of deprecated data models

The following data model keys have been removed from `eos_cli_config_gen` in v5.0.0.

| Removed key | New key |
| ----------- | ------- |
| TODO | |
Loading

0 comments on commit fc72801

Please sign in to comment.