Initial commit
This commit is contained in:
commit
8cc9710721
20
tasks/ip_authorization.yml
Normal file
20
tasks/ip_authorization.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: get ip authorized-managers
|
||||
community.network.aruba_command:
|
||||
commands: show running-config | include ip authorized-managers
|
||||
register: result
|
||||
- name: Get IP's
|
||||
set_fact:
|
||||
ip_auth_command: "{{ result.stdout_lines[0] | select('match', regex) | map('regex_replace',regex,replace) | unique | map('regex_replace', '^', 'no ip authorized-managers ') | list }}"
|
||||
vars:
|
||||
regex: '^.*managers (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*$'
|
||||
replace: '\1'
|
||||
- name: set ip authorized managers
|
||||
set_fact:
|
||||
ip_auth_command: "{{ip_auth_command + ['ip authorized-managers '+item.network+' access manager access-method '+item.access_method]}}"
|
||||
loop: "{{ip_authorization}}"
|
||||
- name: send command
|
||||
community.network.aruba_config:
|
||||
lines: "{{ip_auth_command}}"
|
||||
match: none
|
||||
save_when: always
|
3
tasks/main.yml
Normal file
3
tasks/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: Set IP authorized_managers
|
||||
import_tasks: ip_authorization.yml
|
3
vars/main.yml
Normal file
3
vars/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
ansible_become: yes
|
||||
ansible_connection: ansible.netcommon.network_cli
|
||||
ansible_network_os: aruba
|
Loading…
Reference in New Issue
Block a user