-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathasa_csv_playbook.yml
35 lines (29 loc) · 1.23 KB
/
asa_csv_playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- hosts: asa
gather_facts: false
connection: network_cli
become: yes
become_method: enable
vars:
asa_rule: a
tasks:
- name: Define Values From CSV File
set_fact:
source_group: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=1') }}"
src_1: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=2') }}"
src_2: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=3') }}"
destination_group: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=4') }}"
dst_1: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=5') }}"
dst_2: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=6') }}"
change_number: "{{ lookup('csvfile', asa_rule +' file=csv_files/asa_rules.csv delimiter=, col=7') }}"
delegate_to: localhost
# - name: jinja template
# template:
# src: templates/asa_rules.j2
# dest: configs/asa_config.txt
# mode: '0644'
# delegate_to: localhost
# replace template module with ios_config when ready to write to devie
- name: Push config to Cisco ASA
asa_config:
src: asa_rules.j2