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

Doc(eos_cli_config_gen): Improve snmp server documention #4806

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

carlbuchmann
Copy link
Member

Change Summary

When configuring snmp_server.hosts, the community is required to be defined when a version is 1 or 2c but not version 3.
Improving the documentation to make this more clear.

See template:

{%     if snmp_server.hosts is arista.avd.defined %}
{%         for host in snmp_server.hosts | arista.avd.natural_sort('host') %}
{%             if host.host is arista.avd.defined %}
{%                 set host_cli = "snmp-server host " ~ host.host %}
{%                 if host.vrf is arista.avd.defined %}
{%                     set host_cli = host_cli ~ " vrf " ~ host.vrf %}
{%                 endif %}
{%                 if host.users is arista.avd.defined
                      and host.version | arista.avd.default('3') | string == '3' %}
{%                     for user in host.users %}
{%                         if user.username is arista.avd.defined
                              and user.authentication_level is arista.avd.defined %}
{{ host_cli }} version 3 {{ user.authentication_level }} {{ user.username }}
{%                         endif %}
{%                     endfor %}
{%                 elif host.community is arista.avd.defined
                        and host.version | arista.avd.default('2c') | string in ['1', '2c'] %}
{{ host_cli }} version {{ host.version | arista.avd.default('2c') }} {{ host.community | arista.avd.hide_passwords(hide_passwords) }}
{%                 endif %}

Related Issue(s)

Fixes #4802

Component(s) name

arista.avd.eos_cli_config_gen

@carlbuchmann carlbuchmann requested review from a team as code owners December 11, 2024 14:53
Copy link

Review docs on Read the Docs

To test this pull request:

# Create virtual environment for this testing below the current directory
python -m venv test-avd-pr-4806
# Activate the virtual environment
source test-avd-pr-4806/bin/activate
# Install all requirements including PyAVD
pip install "pyavd[ansible] @ git+https://github.com/carlbuchmann/avd.git@fix-doc-4802#subdirectory=python-avd" --force
# Point Ansible collections path to the Python virtual environment
export ANSIBLE_COLLECTIONS_PATH=$VIRTUAL_ENV/ansible_collections
# Install Ansible collection
ansible-galaxy collection install git+https://github.com/carlbuchmann/avd.git#/ansible_collections/arista/avd/,fix-doc-4802 --force
# Optional: Install AVD examples
cd test-avd-pr-4806
ansible-playbook arista.avd.install_examples

@github-actions github-actions bot added role: eos_cli_config_gen issue related to eos_cli_config_gen role state: Documentation role Updated role: eos_designs issue related to eos_designs role labels Dec 11, 2024
@gmuloc gmuloc added the one approval This PR has one approval and is only missing one more. label Dec 11, 2024
@gmuloc gmuloc requested a review from a team December 11, 2024 16:54
@gmuloc gmuloc merged commit bf03626 into aristanetworks:devel Dec 12, 2024
46 checks passed
emilarista pushed a commit to emilarista/ansible-avd that referenced this pull request Dec 17, 2024
…rks#4806)

Co-authored-by: Guillaume Mulocher <[email protected]>
Co-authored-by: Claus Holbech <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one approval This PR has one approval and is only missing one more. rn: Doc(eos_cli_config_gen) role: eos_cli_config_gen issue related to eos_cli_config_gen role role: eos_designs issue related to eos_designs role state: Documentation role Updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AVD structured config not generating EOS CLI for snmp-server commands
4 participants