-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.j2
184 lines (158 loc) · 5.04 KB
/
template.j2
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
{
{% if meta_information is defined -%}
"meta_information": {
"probe_stats": {
{% for i,j in meta_information.items() -%}
"{{i}}": "{{j}}"{{ "," if not loop.last else "" }}
{% endfor -%}
}
},
{% endif %}
{% if archives is defined -%}
"archives": {
{% for i in archives %}
"{{i.name}}": {
"archiver": "{{i.archiver}}",
"data": {
{% for j,k in i.data.items() -%}
"{{j}}": "{{k}}"{{ "," if not loop.last else "" }}
{% endfor -%}
}
}{{ "," if not loop.last else ""}}
{% endfor %}
},
{% endif %}
{% if tests is defined -%}
"tests": {
{% for i in tests %}
"{{i.name}}": {
"type": "{{i.type}}",
"spec": {
{% for j,k in i.spec.items() -%}
"{{j}}": "{{k}}"{{ "," if not loop.last else "" }}
{% endfor -%}
}
}{{ "," if not loop.last else ""}}
{% endfor %}
},
{% endif %}
{% if schedules is defined -%}
"schedules": {
{% for i in schedules %}
"{{i.name}}": {
"repeat": "{{i.repeat}}"
}{{ "," if not loop.last else ""}}
{% endfor %}
},
{% endif %}
{% if BSSID_channels is defined -%}
"BSSID_channels": {
{% for i in BSSID_channels %}
"{{i.name}}": {{i.channels}}{{ "," if not loop.last else ""}}
{% endfor %}
},
{% endif %}
{% if SSID_profiles is defined -%}
"SSID_profiles" : {
{% for i in SSID %}
"{{i.name}}": {
"SSID": "{{i.SSID}}",
"channels": "{{i.channels}}",
"channel_mismatch_warning": {{i.channel_mismatch_warning}},
"channel_mismatch_connect": {{i.channel_mismatch_connect}},
"min_signal": {{i.min_signal}},
"min_qualifying": {{i.min_qualifying}},
"AuthMethod": {
"type": "{{i.type}}",
"UID": "{{i.UID}}",
"Password": "{{i.Password}}",
"connection_flags": {
"paranoid": {{i.paranoid}},
"pscheduler_restart": {{i.pscheduler_restart}},
"apache_restart": {{i.apache_restart}},
"postgres_restart": {{i.postgres_restart}},
"wait_time": {{i.wait_time}}
}
}
}{{ "," if not loop.last else ""}}
{% endfor %}
},
{% endif %}
{% if SSID_groups is defined -%}
"SSID_groups": {
{% for i in SSID_groups %}
"{{i.name}}": [
{%- for j in i.group -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
]{{ "," if not loop.last else "" }}
{% endfor %}
},
{% endif %}
{% if network_interfaces is defined -%}
"network_interfaces": {
{% for i in network_interfaces %}
"{{i.name}}": "{{i.interface}}"{{ "," if not loop.last else "" }}
{% endfor %}
},
{% endif %}
{% if BSSID_scans is defined -%}
"BSSID_scans" : {
{% for i in BSSID_scans %}
"{{i.name}}": {
"interface":"{{i.interface}}",
"profiles": "{{i.profiles}}",
"unknown_SSID_warning": {{i.unknown_SSID_warning}},
"schedule": [
{%- for j in i.schedule -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
],
"priority": {{i.priority}},
"meta_information": "{{i.meta_information}}"
}{{ "," if not loop.last else "" }}
{% endfor %}
},
{% endif %}
{% if pssid_tasks is defined -%}
"tasks": {
{% for i in pssid_tasks %}
"{{i.name}}": {
"profiles":
{%- if i.profiles is string -%}
"{{i.profiles}}",
{%- else -%}
[
{%- for j in i.profiles -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
],
{%- endif %}
"BSSIDs": "{{i.BSSIDs}}",
"test": [
{%- for j in i.test -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
],
"archives": [
{%- for j in i.archives -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
],
"schedule": [
{%- for j in i.schedule -%}
"{{j}}"{{ "," if not loop.last else "" }}
{%- endfor -%}
],
"priority": {{i.priority}},
"ttl": {{i.ttl}},
"meta_information": "{{i.meta_information}}"
{%- if 'throughput_threshold' in i -%}
,
"throughput_threshold": {{i.throughput_threshold}}
{% endif %}
}{{ "," if not loop.last else "" }}
{% endfor %}
}
{% endif %}
}