From a9567bd31dd6de780168b3ec2cc7b2fb30ee7dce Mon Sep 17 00:00:00 2001 From: David Kilias Date: Thu, 13 Jul 2023 23:44:00 +0200 Subject: [PATCH] feat: add initial work to configure cisco router --- .../cisco-catalyst-2960s.n39.eu/vars.yml | 31 +++++++++++++++++++ inventory.yml | 4 +++ switch-cisco-2960s.yml | 26 ++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 host_vars/cisco-catalyst-2960s.n39.eu/vars.yml create mode 100644 switch-cisco-2960s.yml diff --git a/host_vars/cisco-catalyst-2960s.n39.eu/vars.yml b/host_vars/cisco-catalyst-2960s.n39.eu/vars.yml new file mode 100644 index 0000000..2573bab --- /dev/null +++ b/host_vars/cisco-catalyst-2960s.n39.eu/vars.yml @@ -0,0 +1,31 @@ +--- +ansible_host: 172.23.63.31 +ansible_user: admin +ansible_password: {{ vault_ansible_password }} +ansible_connection: network_cli +ansible_network_os: ios +vlans: + - id: 2 + name: voip + - id: 3 + name: av + - id: 4 + name: lan + - id: 5 + name: wan + - id: 6 + name: tor + - id: 7 + name: service + - id: 8 + name: legacy + - id: 9 + name: dmz + - id: 10 + name: ffmd-wan + - id: 11 + name: ffmd-client + - id: 12 + name: ffmd-mesh + - id: 4000 + name: internet diff --git a/inventory.yml b/inventory.yml index ef482de..e564117 100644 --- a/inventory.yml +++ b/inventory.yml @@ -17,6 +17,7 @@ all: k3s-w1.n39.eu: k3s-w2.n39.eu: k3s-w3.n39.eu: + cisco-catalyst-2960s.n39.eu: children: docker_host: @@ -69,3 +70,6 @@ all: k3s-w1.n39.eu: k3s-w2.n39.eu: k3s-w3.n39.eu: + network: + hosts: + cisco-catalyst-2960s.n39.eu: diff --git a/switch-cisco-2960s.yml b/switch-cisco-2960s.yml new file mode 100644 index 0000000..a78cee3 --- /dev/null +++ b/switch-cisco-2960s.yml @@ -0,0 +1,26 @@ +--- +- hosts: cisco-catalyst-2960s.n39.eu + + tasks: + - name: configure login banner + cisco.ios.ios_banner: + banner: login + text: welcome to cisco-catalyst-2960s + state: present + + - name: set hostname + cisco.ios.ios_hostname: + config: + hostname: cisco-catalyst-2960s + state: override + + - name: configure vlans + cisco.ios.ios_vlans: + config: + - name: {{ item.name }} + vlan_id: {{ item.id }} + state: active + shutdown: disabled + remote_span: true + state: merged + loop: "{{ vlans | dict2items }}" \ No newline at end of file