mirror of
https://github.com/schnidrig/openhab-ansible
synced 2026-01-12 00:48:46 +01:00
openhab1
This commit is contained in:
10
README.md
10
README.md
@@ -15,6 +15,9 @@ e.g on a mac with sdcard reader that would be:
|
|||||||
|
|
||||||
Insert sdcard into rasberry pi and boot.
|
Insert sdcard into rasberry pi and boot.
|
||||||
|
|
||||||
|
### Enable sshd
|
||||||
|
|
||||||
|
sudo systemctl enable ssh
|
||||||
|
|
||||||
### Configure fixed ip address
|
### Configure fixed ip address
|
||||||
|
|
||||||
@@ -38,5 +41,12 @@ Check/change other values in group_vars
|
|||||||
|
|
||||||
ansible-playbook -i inventory raspi.yml
|
ansible-playbook -i inventory raspi.yml
|
||||||
|
|
||||||
|
## performance tweaks
|
||||||
|
|
||||||
|
https://github.com/openhab/openhab/wiki/Hardware-FAQ
|
||||||
|
|
||||||
|
# install docker
|
||||||
|
https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/
|
||||||
|
curl -sSL https://get.docker.com | sh
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
|
[defaults]
|
||||||
|
retry_files_enabled = False
|
||||||
|
|
||||||
|
vault_password_file = vault_password
|
||||||
|
|
||||||
[ssh_connection]
|
[ssh_connection]
|
||||||
|
pipelining=True
|
||||||
|
allow_agent_forwarding_with_sudo=True
|
||||||
ssh_args = -o ForwardAgent=yes
|
ssh_args = -o ForwardAgent=yes
|
||||||
#ssh_args = -A
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
32
roles/openhab/tasks/habmin.yml
Normal file
32
roles/openhab/tasks/habmin.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
- name: download HABmin
|
||||||
|
get_url:
|
||||||
|
url: https://github.com/cdjackson/HABmin/archive/master.zip
|
||||||
|
dest: /root/habmin_master.zip
|
||||||
|
mode: 0444
|
||||||
|
tags:
|
||||||
|
- habmin
|
||||||
|
|
||||||
|
|
||||||
|
- name: unzip
|
||||||
|
unarchive:
|
||||||
|
remote_src: yes
|
||||||
|
src: /root/habmin_master.zip
|
||||||
|
dest: /usr/share/openhab/webapps/
|
||||||
|
creates: "/usr/share/openhab/webapps/habmin"
|
||||||
|
tags:
|
||||||
|
- habmin
|
||||||
|
|
||||||
|
- name: rename
|
||||||
|
command: creates="/usr/share/openhab/webapps/habmin" mv "/usr/share/openhab/webapps/HABmin-master" "/usr/share/openhab/webapps/habmin"
|
||||||
|
tags:
|
||||||
|
- habmin
|
||||||
|
|
||||||
|
- name: install addon
|
||||||
|
command: creates="/usr/share/openhab/addons/org.openhab.io.habmin-1.8.0.jar" mv "/usr/share/openhab/webapps/habmin/addons/org.openhab.io.habmin-1.7.0-SNAPSHOT.jar" "/usr/share/openhab/addons/org.openhab.io.habmin-1.8.0.jar"
|
||||||
|
tags:
|
||||||
|
- habmin
|
||||||
|
|
||||||
|
|
||||||
@@ -3,6 +3,8 @@
|
|||||||
- include: repo.yml
|
- include: repo.yml
|
||||||
- include: packages.yml
|
- include: packages.yml
|
||||||
- include: openhab.yml
|
- include: openhab.yml
|
||||||
|
- include: habmin.yml
|
||||||
- include: nfs.yml
|
- include: nfs.yml
|
||||||
|
- include: mysql.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
roles/openhab/tasks/mysql.yml
Normal file
29
roles/openhab/tasks/mysql.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: install mysql packages
|
||||||
|
apt:
|
||||||
|
pkg: "{{item}}"
|
||||||
|
update_cache: "{{apt_config.update_cache}}"
|
||||||
|
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||||
|
with_items:
|
||||||
|
- mysql-server
|
||||||
|
- python-mysqldb
|
||||||
|
tags:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
- name: Create openhab database
|
||||||
|
mysql_db:
|
||||||
|
name: openhab
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
- mysql_user:
|
||||||
|
name: openhab
|
||||||
|
password: openhab
|
||||||
|
priv: '*.*:ALL'
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- "{{jdk}}"
|
- "{{jdk}}"
|
||||||
- openhab-runtime
|
- openhab-runtime
|
||||||
|
- sysstat
|
||||||
tags:
|
tags:
|
||||||
- packages
|
- packages
|
||||||
- openhab
|
- openhab
|
||||||
|
|||||||
Reference in New Issue
Block a user