Skip to content

Commit

Permalink
Updated sram-monitor to test both chrome and firefox (closes: SURFscz…
Browse files Browse the repository at this point in the history
  • Loading branch information
baszoetekouw committed Jun 11, 2024
1 parent b12ff08 commit c251d0b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
5 changes: 4 additions & 1 deletion roles/sram_monitor/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
---
- name: "enable monitor job"
systemd:
name: "sram-monitor.timer"
name: "sram-monitor@{{item}}.timer"
enabled: true
state: "started"
daemon_reload: true
loop:
- "chrome"
- "firefox"

- name: "restart zabbix-agent"
systemd:
Expand Down
18 changes: 13 additions & 5 deletions roles/sram_monitor/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@

- name: Copy monitor service files
template:
src: "{{item}}.j2"
dest: "/etc/systemd/system/{{item}}"
with_items:
- "sram-monitor.service"
- "sram-monitor.timer"
src: "[email protected]"
dest: "/etc/systemd/system/[email protected]"
owner: "root"
group: "root"
mode: "0644"

- name: Copy monitor timer files
template:
src: "[email protected]"
dest: "/etc/systemd/system/sram-monitor@{{ item.browser }}.timer"
loop:
- { browser: "chrome", timer: "*:00/20"}
- { browser: "firefox", timer: "*:10/20"}
notify:
- "enable monitor job"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Description=SRAM Monitor
Description=SRAM Monitor (%I)

[Service]
User={{sram_monitor_user}}
Expand All @@ -9,5 +9,5 @@ Environment="PATH={{sram_monitor_dir}}/venv/bin/:/usr/bin:/bin"
PassEnvironment=PATH
WorkingDirectory={{sram_monitor_dir}}

ExecStart={{sram_monitor_dir}}/run_sram_monitoring.sh prd
ExecStart={{sram_monitor_dir}}/run_sram_monitoring.sh acc
ExecStart={{sram_monitor_dir}}/run_sram_monitoring.sh prd %i
ExecStart={{sram_monitor_dir}}/run_sram_monitoring.sh acc %i
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=SRAM Monitor

[Timer]
OnCalendar=*:0/15
OnCalendar={{item.timer}}

[Install]
WantedBy=multi-user.target

0 comments on commit c251d0b

Please sign in to comment.