From ee3ae01371df4aedf26c1132d817cc2e0825eb5c Mon Sep 17 00:00:00 2001 From: Christian Schnidrig Date: Thu, 24 Feb 2022 08:48:08 +0100 Subject: [PATCH] updates to openhab installation, new repo etc --- roles/openhab/tasks/openhab.yml | 11 +++++---- roles/openhab/tasks/openhab_old.yml | 38 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 roles/openhab/tasks/openhab_old.yml diff --git a/roles/openhab/tasks/openhab.yml b/roles/openhab/tasks/openhab.yml index 6e0ae8c..9da0959 100644 --- a/roles/openhab/tasks/openhab.yml +++ b/roles/openhab/tasks/openhab.yml @@ -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: diff --git a/roles/openhab/tasks/openhab_old.yml b/roles/openhab/tasks/openhab_old.yml new file mode 100644 index 0000000..95f052b --- /dev/null +++ b/roles/openhab/tasks/openhab_old.yml @@ -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"' + + +