enable logging on switches

This commit is contained in:
Daniel Poelzleithner 2019-08-15 23:39:45 +02:00
parent 8681e47fb3
commit 070e685350
3 changed files with 22 additions and 0 deletions

View File

@ -30,6 +30,15 @@ expect -- "-luser-admin]"
send "quit\r"
expect "{{ hostname }}]"
{# Enable logging #}
send "info-center enable\r"
expect "]"
send "info-center loghost {{logging}} channel loghost facility local6\r"
expect "]"
send "info-center source default channel loghost log level informational\r"
expect "]"
{%- for name, vlan in pillar['vlans'].items() %}
send "vlan {{ vlan }}\r"
expect -- "-vlan{{ vlan }}]"

View File

@ -26,6 +26,16 @@ expect "(config)# "
# TODO: ssh, password
{# Enable Logging #}
send "logging {{logging}}\r"
expect "(config)# "
send "logging facility local6\r"
expect "(config)# "
# todo ntp
# timesync sntp
# ip timep manual {{ntp}} interval 10
{%- for name, vlan in pillar['vlans'].items() %}
send "vlan {{ vlan }}\r"
expect "(vlan-{{ vlan }})#"

View File

@ -31,6 +31,9 @@ expect "(config)#"
send "location \"{{ switch['location'] }}\"\r"
expect "(config)#"
send "logging host index 1 {{logging}} 6\r"
expect "(config)#"
{%- set mgmt_vlan = pillar['vlans']['mgmt'] %}
send "ip management-vlan {{ mgmt_vlan }}\r"
expect "(config)#"