-
Notifications
You must be signed in to change notification settings - Fork 62
/
scheduler.yml
47 lines (35 loc) · 1006 Bytes
/
scheduler.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
---
- hosts: spine
vars:
nxos_provider:
username: "{{ un }}"
password: "{{ pwd }}"
transport: nxapi
host: "{{ inventory_hostname }}"
tasks:
- name: ENABLE FEATURE SCHEDULER
nxos_feature:
feature: scheduler
provider: "{{ nxos_provider }}"
state: enabled
- name: COPY SCRIPT TO THE DEVICE
nxos_file_copy:
local_file: "/etc/scp_server/MyMonitorScript.py"
provider: "{{ nxos_provider }}"
- name: CREATE JOB
nxos_config:
lines:
- 'scheduler job name run_monitor_script'
- 'python MyMonitorScript.py'
match: exact
force: true
provider: "{{ nxos_provider }}"
- name: SCHEDULE JOB TO RUN EVERY 5 MINUTES
nxos_config:
lines:
- 'scheduler schedule name daily'
- 'job name run_monitor_script'
- 'time start now repeat 5'
match: exact
force: true
provider: "{{ nxos_provider }}"