-
Notifications
You must be signed in to change notification settings - Fork 4
/
pushscenario.yml
103 lines (85 loc) · 3.12 KB
/
pushscenario.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
- hosts: all
sudo: True
tasks:
- name: copy over ineterfaces for each ansible_hostname in scenario directory
copy: src=./scenario{{ s }}/{{ ansible_hostname }}/interfaces dest=/etc/network/
ignore_errors: True
- name: check if frr.conf exists
local_action: stat path=./scenario{{ s }}/{{ ansible_hostname }}/frr.conf
register: file1
ignore_errors: True
- name: copy over frr.conf for each ansible_hostname in scenario directory
copy: src=./scenario{{ s }}/{{ ansible_hostname }}/frr.conf dest=/etc/frr/
when: file1.stat.exists
ignore_errors: True
- name: check if daemons exists
local_action: stat path=./scenario{{ s }}/{{ ansible_hostname }}/daemons
register: file2
ignore_errors: True
- name: copy over daemons file for each ansible_hostname in scenario directory
copy: src=./scenario{{ s }}/{{ ansible_hostname }}/daemons dest=/etc/frr/
when: file2.stat.exists
ignore_errors: True
- name: check if topology.dot exists
local_action: stat path=./scenario{{ s }}/{{ ansible_hostname }}/topology.dot
register: file3
ignore_errors: True
- name: copy over topology.dot for each ansible_hostname in scenario directory
copy: src=./scenario{{ s }}/{{ ansible_hostname }}/topology.dot dest=/etc/ptm.d/
when: file3.stat.exists
ignore_errors: True
- name: check if 00control_plane.rules exists
local_action: stat path=./scenario{{ s }}/{{ ansible_hostname }}/00control_plane.rules
register: file4
ignore_errors: True
- name: copy over 00control_plane.rules for each ansible_hostname in scenario directory
copy: src=./scenario{{ s }}/{{ ansible_hostname }}/00control_plane.rules dest=/etc/cumulus/acl/policy.d/
when: file4.stat.exists
ignore_errors: True
- name: reload interfaces on CL VMs
command: ifreload -a
when: '"Cumulus" in ansible_lsb.id'
ignore_errors: True
- name: reload frr
command: systemctl restart frr
when: '"Cumulus" in ansible_lsb.id'
ignore_errors: True
- name: reload ptmd
command: systemctl restart ptmd
when: '"Cumulus" in ansible_lsb.id'
ignore_errors: True
- name: install acl
command: cl-acltool -i
when: '"Cumulus" in ansible_lsb.id'
ignore_errors: True
- name: Force Interfaces Down
command: ifdown {{item}}
with_items:
- lo
- eth1
- eth1.100
- eth1.200
- eth2
when: '"Cumulus" not in ansible_lsb.id'
ignore_errors: True
- name: Force Interfaces Up
async: 1
poll: 0
command: ifup {{item}}
with_items:
- lo
- eth1
- eth1.100
- eth1.200
- eth2
when: '"Cumulus" not in ansible_lsb.id'
ignore_errors: True
- name: Put eth1 in promisc mode
command: sudo ifconfig eth1 promisc
when: '"Cumulus" not in ansible_lsb.id'
ignore_errors: True
- name: Put eth2 in promisc mode
command: sudo ifconfig eth2 promisc
when: '"Cumulus" not in ansible_lsb.id'
ignore_errors: True