mirror of
https://github.com/schnidrig/openhab-ansible
synced 2026-01-12 00:48:46 +01:00
updates to openhab installation, new repo etc
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
|
||||
- name: Add Openhab Repo Key
|
||||
ansible.builtin.apt_key:
|
||||
url: https://bintray.com/user/downloadSubjectPublicKey?username=openhab
|
||||
url: https://openhab.jfrog.io/artifactory/api/gpg/key/public
|
||||
state: present
|
||||
|
||||
- name: Add Openhab Repo
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb https://dl.bintray.com/openhab/apt-repo2 stable main"
|
||||
repo: "deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main"
|
||||
state: present
|
||||
filename: openhab
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
apt:
|
||||
pkg:
|
||||
- openhab
|
||||
#- openhab-addons
|
||||
update_cache: "{{apt_config.update_cache}}"
|
||||
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||
|
||||
@@ -31,9 +32,9 @@
|
||||
- {"src": "/etc/openhab", "dest": "/home/pi/conf"}
|
||||
- {"src": "/var/log/openhab", "dest": "/home/pi/logs"}
|
||||
- {"src": "/var/lib/openhab", "dest": "/home/pi/userdata"}
|
||||
- {"src": "/var/lib/openhab/backups", "dest": "/home/pi/backups"}
|
||||
- {"src": "/usr/share/openhab/runtime/bin/client", "dest": "/home/pi/bin/client"}
|
||||
- {"src": "/usr/share/openhab/runtime/bin/restore", "dest": "/home/pi/bin/restore"}
|
||||
#- {"src": "/var/lib/openhab/backups", "dest": "/home/pi/backups"}
|
||||
#- {"src": "/usr/share/openhab/runtime/bin/client", "dest": "/home/pi/bin/client"}
|
||||
#- {"src": "/usr/share/openhab/runtime/bin/restore", "dest": "/home/pi/bin/restore"}
|
||||
|
||||
- name: add directories
|
||||
file:
|
||||
|
||||
38
roles/openhab/tasks/openhab_old.yml
Normal file
38
roles/openhab/tasks/openhab_old.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
|
||||
- name: cron job
|
||||
cron:
|
||||
name: "restart openhab"
|
||||
minute: "10"
|
||||
hour: "5"
|
||||
weekday: "0"
|
||||
job: 'systemctl restart nginx.service'
|
||||
cron_file: openhab2
|
||||
user: root
|
||||
|
||||
- name: cron job
|
||||
cron:
|
||||
name: "touch shutters"
|
||||
minute: "20"
|
||||
hour: "5"
|
||||
weekday: "0"
|
||||
job: 'touch /etc/openhab2/automation/jsr223/shutters.py'
|
||||
cron_file: openhab2
|
||||
user: root
|
||||
|
||||
# gardena needs jsonmerge
|
||||
- name: install python modules for jython
|
||||
pip:
|
||||
virtualenv: "/etc/openhab2/automation/lib/python"
|
||||
virtualenv_command: "/usr/bin/virtualenv"
|
||||
virtualenv_python: "/usr/bin/python2.7"
|
||||
name: jsonmerge
|
||||
|
||||
- name: set EXTRA_JAVA_OPTS
|
||||
lineinfile:
|
||||
path: "/etc/default/openhab2"
|
||||
regexp: '^EXTRA_JAVA_OPTS='
|
||||
line: 'EXTRA_JAVA_OPTS="-Dpython.path=/etc/openhab2/automation/lib/python/lib/python2.7/site-packages/ -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0:/dev/ttyACM1:/dev/ttyUSB0:/dev/ttyUSB1:/dev/ttyS0:/dev/ttyS2:/dev/ttyAMA0"'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user