{% set act = {'shutdown': 'shutdown', 'restrict': 'drop-and-log', 'protect': 'drop'}[violation] %}
{% for p in ports|ports %}
set switch-options interface {{ p }} interface-mac-limit {{ max_mac }} packet-action {{ act }}
{% if sticky %}
set switch-options interface {{ p }} persistent-learning
{% endif %}
{% endfor %}
