routeros: Add script to publish poe power to mqtt
This commit is contained in:
parent
ae59e21a2e
commit
e790276359
4 changed files with 4247 additions and 1 deletions
|
@ -1,4 +1,20 @@
|
|||
---
|
||||
- name: Install packages
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: installed
|
||||
with_items:
|
||||
- mosquitto
|
||||
- net-snmp-utils
|
||||
|
||||
- name: Install routeros mib
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/share/snmp/mibs/MIKROTIK-MIB.txt
|
||||
src: mikrotik.mib
|
||||
mode: "0644"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Create group
|
||||
ansible.builtin.group:
|
||||
name: routeros
|
||||
|
@ -38,10 +54,24 @@
|
|||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Install cron job
|
||||
- name: Install download cron job
|
||||
ansible.builtin.cron:
|
||||
name: download-routeros-firmware
|
||||
job: /usr/local/bin/download-routeros-firmware
|
||||
user: routeros
|
||||
hour: "05"
|
||||
minute: "25"
|
||||
|
||||
- name: Install mqtt publish script
|
||||
ansible.builtin.copy:
|
||||
dest: /usr/local/bin/routeros-poe-mqtt-publish
|
||||
src: routeros-poe-mqtt-publish.sh
|
||||
mode: "0755"
|
||||
owner: root
|
||||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: Install mqtt publish cron job
|
||||
ansible.builtin.cron:
|
||||
name: routeros-poe-mqtt-publish
|
||||
job: /usr/local/bin/routeros-poe-mqtt-publish
|
||||
minute: "*/5"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue