Added a common role

This commit is contained in:
Accendit
2020-05-11 21:36:51 +02:00
parent 2667a53055
commit 7c7eea860e
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,36 @@
- name: configure login banner
ios_banner:
banner: motd
text: "{{ banner }}"
- name: configure system attributes
ios_system:
hostname: "{{ inventory_hostname }}"
name_servers: "{{ dns_servers }}"
state: present
- name: configure local users
ios_user:
users: "{{ users }}"
update_password: always
- name: configure vty lines
ios_config:
before: "line vty 0 4"
lines:
- login local
- transport input ssh
- name: configure http management
ios_config:
lines:
- no ip http server
- no ip http secure-server
# - debug:
# var: hostvars
- name: configure interfaces
ios_interfaces:
config: "{{ hostvars[inventory_hostname]['interfaces'] }}"
state: overridden

View File

@ -0,0 +1,14 @@
banner: |
Welcome to the party switch :)
dns_servers:
- 8.8.8.8
- 8.8.4.4
users:
- name: martijn
configured_password: martijn
privilege: 15
- name: ansible
configured_password: ansible
privilege: 15