Skip to content
Snippets Groups Projects
Commit 73162c89 authored by Simone Spinelli's avatar Simone Spinelli
Browse files

Base config for switches role and play

parent 2efe44a7
No related branches found
No related tags found
No related merge requests found
Pipeline #90080 failed
system {
replace: syslog {
user * {
any emergency;
}
{% if system_syslog_time_format_options is defined %}
time-format {% for syslog_time_format_option in system_syslog_time_format_options %}{{ syslog_time_format_option }} {% endfor %};
{% endif %}
{% if system_syslog_servers is defined %}
{% for syslog_server in system_syslog_servers %}
host {{ syslog_server.address }} {
{% for facility in syslog_server.facilities %}
{{ facility.name }} {{ facility.level }};
{% endfor %}
{% if syslog_server.match is defined %}
match "{{ syslog_server.match }}";
{% endif %}
{% if syslog_server.port is defined %}
port {{ syslog_server.port }}
{% endif %}
{% if syslog_server.source_address is defined %}
source-address {{ syslog_server.source_address }} ;
{% endif %}
{% if syslog_server.structured_data is defined %}
{% if syslog_server.structured_data == "default" %}
structured-data;
{% elif syslog_server.structured_data == "brief" %}
structured-data brief;
{% endif %}
{% endif %}
{% if syslog_server.allow_duplicates is defined %}
{% if syslog_server.allow_duplicates == True %}
allow-duplicates ;
{% endif %}
{% endif %}
}
{% endfor %}
{# {%- else %} #}
{# {{ raise('ERROR: No syslog servers configured') }}#}
{% endif %}
{% if system_syslog_source_address is defined %}
source-address {{ system_syslog_source_address }} ;
{% endif %}
{% if system_syslog_files is defined %}
{% for syslog_file in system_syslog_files %}
file {{ syslog_file.filename }} {
{% for facility in syslog_file.facilities %}
{{ facility.name }} {{ facility.level }};
{% endfor %}
{% if syslog_file.match is defined %}
match "{{ syslog_file.match }}";
{% endif %}
{% if syslog_file.authorization is defined %}
authorization {{ syslog_file.authorization }};
{% endif %}
{% if syslog_file.archive_options is defined %}
archive {% if syslog_file.archive_options.files is defined %} files {{ syslog_file.archive_options.files }} {% endif %} {% if syslog_file.archive_options.size is defined %} size {{ syslog_file.archive_options.size }} {% endif %}
{% endif %}
{% if syslog_file.structured_data is defined %}
{% if syslog_file.structured_data == "default" %}
structured-data ;
{% elif syslog_file.structured_data == "brief" %}
structured-data brief;
{% endif %}
{% endif %}
{% if syslog_file.allow_duplicates is defined %}
{% if syslog_file.allow_duplicates == True %}
allow-duplicates ;
{% endif %}
{% endif %}
}
{% endfor %}
{% endif %}
}
}
{% include 'system/general.j2' %}
{% include 'system/ntp.j2' %}
{% include 'system/radius-server.j2' %}
{% include 'system/services.j2' %}
{% include 'system/syslog.j2' %}
{% include 'system/login.j2' %}
\ No newline at end of file
localhost
---
- hosts: localhost
remote_user: root
roles:
- switch
---
# vars file for switch
dry_run: True
verbs:
- deploy
- verify
snmp_location: "{{ subscription.switch.switch_site.site_city }},{{ subscription.switch.switch_site.site_country }},[{{ subscription.switch.switch_site.site_latitude }},{{ subscription.switch.switch_site.site_longitude }}]"
switch_model_map:
EX3400_24p:
ports: 24
client_ports_prefix: "ge-0/0"
EX3400_48p:
ports: 48
client_ports_prefix: "ge-0/0"
EX3400_32p:
ports: 32
client_ports_prefix: "ge-0/0"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment