-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnf.yml
58 lines (49 loc) · 1.25 KB
/
nf.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Date: 02 04 2021
# Alex Diker
---
- name: Gathering Facts Networking
maximum_fail_percentage: 50
#ignore_errors: no
ignore_errors: yes
connecton: network_cli
gather_facts: false
hosts: all
tasks: all
- name: Gathering facts via ios_facts module
ios_facts:
when: ansible_network_os == 'ios'
- name: Display certain facts
debug:
msg: "The hostname is {{ ansible_net_hostname }} running {{ ansible_net_version }}"
- name: Display all facts for a host
debug:
var: hostvars['ios-1']
- tasks:
name: eli
command: echo {{ item }}
with_items: ['r1', 'r2', 'r3', 'r4' , 'r5', 'r6', 'r7']
- tasks:
name: adding v lan networks
eos_config:
lines:
- vlan {{ item }}
provider: {{ cli }}
with_items: {{ vlan_numbers }}
- 200
- 300
- tasks:
name: add vln
nxos_config:
lines:
- vlan {{ item.key }}
provider: {{ cli }}
with_dict: "{{ vlans }}"
- name: configure vlans
nxos_config:
lines:
- description {{ item.values.name }}
- ip address {{ item.value.ip }} / 24
provider: "{{ cli }}"
parents: interface vlan {{ items.key }}
with_dict: "{{ vlans }}"
# ansible-playbook -i hosts nf.yml