Skip to content

Commit

Permalink
Adding min-max range for vlan and updating template to fix incomplete…
Browse files Browse the repository at this point in the history
… config generation
  • Loading branch information
Shivani-gslab committed Apr 8, 2024
1 parent 53bc1a7 commit 3baa5a5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time_duration_unit</samp>](## "dot1x.aaa.unresponsive.action.cached_results_timeout.time_duration_unit") | String | Required | | Valid Values:<br>- <code>days</code><br>- <code>hours</code><br>- <code>minutes</code><br>- <code>seconds</code> | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apply_alternate</samp>](## "dot1x.aaa.unresponsive.action.apply_alternate") | Boolean | | | | Apply alternate action if primary action fails. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;traffic_allow</samp>](## "dot1x.aaa.unresponsive.action.traffic_allow") | Boolean | | | | Set action for supplicant traffic when AAA times out. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;traffic_allow_vlan</samp>](## "dot1x.aaa.unresponsive.action.traffic_allow_vlan") | Integer | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;traffic_allow_vlan</samp>](## "dot1x.aaa.unresponsive.action.traffic_allow_vlan") | Integer | | | Min: 1<br>Max: 4094 | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;phone_action</samp>](## "dot1x.aaa.unresponsive.phone_action") | Dictionary | | | | Set action for supplicant when AAA times out. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apply_cached_results</samp>](## "dot1x.aaa.unresponsive.phone_action.apply_cached_results") | Boolean | | | | Use results from a previous AAA response. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cached_results_timeout</samp>](## "dot1x.aaa.unresponsive.phone_action.cached_results_timeout") | Dictionary | | | | |
Expand Down Expand Up @@ -82,7 +82,7 @@

# Set action for supplicant traffic when AAA times out.
traffic_allow: <bool>
traffic_allow_vlan: <int>
traffic_allow_vlan: <int; 1-4094>

# Set action for supplicant when AAA times out.
phone_action:
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ keys:
type: int
convert_types:
- str
min: 1
max: 4094
phone_action:
type: dict
description: Set action for supplicant when AAA times out.
Expand Down Expand Up @@ -128,7 +130,9 @@ keys:
- "seconds"
apply_alternate:
type: bool
description: Apply alternate action if primary action fails.
description: |
Apply alternate action if primary action fails.
eg. aaa unresponsive phone action apply cached-results else traffic allow
traffic_allow:
description: Set action for supplicant traffic when AAA times out.
type: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,29 @@ dot1x
{% for action in actions %}
{% if dot1x.aaa.unresponsive[action.name] is arista.avd.defined %}
{% set aaa_action_config = action.config %}
{% if dot1x.aaa.unresponsive[action.name].apply_cached_results is arista.avd.defined(true) %}
{% set action_apply_config = "apply cached-results" %}
{% if dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration is arista.avd.defined and dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration_unit is arista.avd.defined %}
{% set action_apply_config = action_apply_config ~ " timeout " ~ dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration ~ " " ~ dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration_unit %}
{% if dot1x.aaa.unresponsive[action.name].apply_cached_results is arista.avd.defined(true) or
dot1x.aaa.unresponsive[action.name].traffic_allow is arista.avd.defined(true) or
dot1x.aaa.unresponsive[action.name].traffic_allow_vlan is arista.avd.defined %}
{% if dot1x.aaa.unresponsive[action.name].apply_cached_results is arista.avd.defined(true) %}
{% set action_apply_config = "apply cached-results" %}
{% if dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration is arista.avd.defined and dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration_unit is arista.avd.defined %}
{% set action_apply_config = action_apply_config ~ " timeout " ~ dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration ~ " " ~ dot1x.aaa.unresponsive[action.name].cached_results_timeout.time_duration_unit %}
{% endif %}
{% endif %}
{% if dot1x.aaa.unresponsive[action.name].traffic_allow is arista.avd.defined(true) %}
{% set traffic = "traffic allow" %}
{% elif dot1x.aaa.unresponsive[action.name].traffic_allow_vlan is arista.avd.defined %}
{% set traffic = "traffic allow vlan " ~ dot1x.aaa.unresponsive[action.name].traffic_allow_vlan %}
{% endif %}
{% if dot1x.aaa.unresponsive[action.name].apply_alternate is arista.avd.defined(true) and action_apply_config is arista.avd.defined and traffic is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ action_apply_config ~ " else " ~ traffic %}
{% elif action_apply_config is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ action_apply_config %}
{% elif traffic is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ traffic %}
{% endif %}
{% endif %}
{% if dot1x.aaa.unresponsive[action.name].traffic_allow is arista.avd.defined(true) %}
{% set traffic = "traffic allow" %}
{% elif dot1x.aaa.unresponsive[action.name].traffic_allow_vlan is arista.avd.defined %}
{% set traffic = "traffic allow vlan " ~ dot1x.aaa.unresponsive[action.name].traffic_allow_vlan %}
{% endif %}
{% if dot1x.aaa.unresponsive[action.name].apply_alternate is arista.avd.defined(true) and action_apply_config is arista.avd.defined and traffic is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ action_apply_config ~ " else " ~ traffic %}
{% elif action_apply_config is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ action_apply_config %}
{% elif traffic is arista.avd.defined %}
{% set aaa_action_config = aaa_action_config ~ " " ~ traffic %}
{% endif %}
{{ aaa_action_config }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
Expand Down

0 comments on commit 3baa5a5

Please sign in to comment.