2
0
mirror of https://github.com/schnidrig/openhab-ansible synced 2026-01-12 00:48:46 +01:00

upgrade to openhab 2.4; debian stretch

This commit is contained in:
Christian Schnidrig
2019-01-03 15:42:07 +01:00
parent 9231e75be7
commit d4dcdc7c0d
15 changed files with 119 additions and 36 deletions

View File

@@ -9,3 +9,13 @@
mode: "u=rwx,g=r,o=r"
tags:
- dynv6
- name: Cron file for dynv6
cron:
name: dynv6 update
user: root
job: "/root/dynv6.sh"
cron_file: dynv6
tags:
- dynv6

View File

@@ -22,6 +22,8 @@
hour: "5"
day: "11"
job: '/root/certbot-auto -n certonly --nginx --agree-tos --email {{letsencrypt_email}} -d {{fqdn}}'
cron_file: letsencrypt
user: root
tags:
- letsencrypt
- letsencrypt_cron

View File

@@ -10,6 +10,7 @@
- include: nginx.yml
- include: dynv6.yml
- include: letsencrypt.yml
- include: scripts.yml

View File

@@ -10,6 +10,7 @@
- python-mysqldb
tags:
- mysql
- packages
- name: Create openhab database
mysql_db:

View File

@@ -18,3 +18,40 @@
tags:
- openhab2
- name: Download Rollershutters dependencies
get_url:
url: "{{ item.src }}"
dest: "/usr/share/openhab2/runtime/lib/boot/{{ item.name }}"
loop:
- { name: "jython-standalone-2.7.0.jar", src: "http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7.0/jython-standalone-2.7.0.jar" }
- { name: "snakeyaml-1.18.jar", src: "http://central.maven.org/maven2/org/yaml/snakeyaml/1.18/snakeyaml-1.18.jar" }
tags:
- openhab2
- jython
- name: cron job
cron:
name: "restart openhab"
minute: "10"
hour: "5"
weekday: "0"
job: 'systemctl restart nginx.service'
cron_file: openhab
user: root
tags:
- openhab2
- openhab_cron
- name: cron job
cron:
name: "touch shutters"
minute: "20"
hour: "5"
weekday: "0"
job: 'touch /etc/openhab2/automation/jsr223/shutters.py'
cron_file: openhab
user: root
tags:
- openhab2
- openhab_cron

View File

@@ -13,8 +13,8 @@
- sysstat
- nginx
- python-passlib
- jython
- jython-doc
#- jython
#- jython-doc
tags:
- packages
- openhab2

View File

@@ -0,0 +1,20 @@
---
- name: create scripts dir
file:
dest: /root/bin
state: directory
tags:
- scripts
- name: create scripts
template:
src: "{{ item }}"
dest: "/root/bin/{{ item }}"
owner: root
group: root
mode: "u=rwx,g=r,o=r"
loop:
- karaf.sh
tags:
- scripts

View File

@@ -1,11 +1,11 @@
# stop openhab instance (here: systemd service)
sudo systemctl stop openhab2.service
#sudo systemctl stop openhab2.service
# backup current installation with settings
TIMESTAMP=`date +%Y%m%d_%H%M%S`;
mkdir ~/openhab2-backup-$TIMESTAMP
cp -arv /etc/openhab2 ~/openhab2-backup-$TIMESTAMP/conf
cp -arv /var/lib/openhab2 ~/openhab2-backup-$TIMESTAMP/userdata
TIMESTAMP=`date +%Y%m%d`;
tar -C / -czf /tmp/openhab2-backup-$TIMESTAMP.tgz etc/openhab2 var/lib/openhab2
# restart openhab instance
sudo systemctl start openhab2.service
echo "Now save the file /tmp/openhab2-backup-$TIMESTAMP.tgz"
# start openhab instance
#sudo systemctl start openhab2.service

View File

@@ -0,0 +1 @@
ssh -p 8101 openhab@localhost

View File

@@ -1,5 +1,9 @@
server {
listen 80;
listen [::]:80;
server_name {{fqdn}};
return 301 https://$server_name$request_uri;
}
server {
listen [::]:443 ssl;
server_name {{fqdn}};