Added a common role
This commit is contained in:
36
roles/common/tasks/main.yml
Normal file
36
roles/common/tasks/main.yml
Normal 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
|
||||
14
roles/common/vars/main.yml
Normal file
14
roles/common/vars/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user