mirror of
https://github.com/schnidrig/openhab-ansible
synced 2026-01-12 00:48:46 +01:00
initial commit
This commit is contained in:
8
roles/openhab/tasks/main.yml
Normal file
8
roles/openhab/tasks/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- include: repo.yml
|
||||
- include: packages.yml
|
||||
- include: openhab.yml
|
||||
- include: nfs.yml
|
||||
|
||||
|
||||
30
roles/openhab/tasks/nfs.yml
Normal file
30
roles/openhab/tasks/nfs.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
|
||||
- name: ensure packages are installed
|
||||
apt:
|
||||
pkg: "{{item}}"
|
||||
update_cache: "{{apt_config.update_cache}}"
|
||||
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||
with_items:
|
||||
- nfs-common
|
||||
- nfs-kernel-server
|
||||
tags:
|
||||
- packages
|
||||
- nfs
|
||||
- openhab
|
||||
|
||||
- name: update /etc/exports
|
||||
lineinfile:
|
||||
dest=/etc/exports
|
||||
regexp="^{{item.mount_point}}\s.*"
|
||||
line="{{item.mount_point}} {{item.options}}"
|
||||
notify: update exportfs
|
||||
with_items:
|
||||
- { mount_point: "/etc/openhab", options: "*(rw,sync,no_subtree_check,all_squash)" }
|
||||
tags:
|
||||
- nfs
|
||||
- nfsconfig
|
||||
- openhab
|
||||
|
||||
|
||||
|
||||
20
roles/openhab/tasks/openhab.yml
Normal file
20
roles/openhab/tasks/openhab.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
|
||||
- name:
|
||||
user:
|
||||
name: openhab
|
||||
groups: "dialout"
|
||||
append: yes
|
||||
tags:
|
||||
- openhab
|
||||
- user
|
||||
|
||||
- name: "configure systemd"
|
||||
systemd:
|
||||
name: openhab
|
||||
daemon_reload: yes
|
||||
enabled: true
|
||||
state: started
|
||||
tags:
|
||||
- openhab
|
||||
|
||||
38
roles/openhab/tasks/packages.yml
Normal file
38
roles/openhab/tasks/packages.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
|
||||
- name: install main packages
|
||||
apt:
|
||||
pkg: "{{item}}"
|
||||
update_cache: "{{apt_config.update_cache}}"
|
||||
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||
with_items:
|
||||
- "{{jdk}}"
|
||||
- openhab-runtime
|
||||
tags:
|
||||
- packages
|
||||
- openhab
|
||||
|
||||
- name: install bindings
|
||||
apt:
|
||||
pkg: "openhab-addon-binding-{{item}}"
|
||||
update_cache: "{{apt_config.update_cache}}"
|
||||
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||
with_items: "{{bindings}}"
|
||||
tags:
|
||||
- packages
|
||||
- bindings
|
||||
- openhab
|
||||
|
||||
- name: install persistence add ons
|
||||
apt:
|
||||
pkg: "openhab-addon-persistence-{{item}}"
|
||||
update_cache: "{{apt_config.update_cache}}"
|
||||
cache_valid_time: "{{apt_config.cache_valid_time}}"
|
||||
with_items: "{{persistence}}"
|
||||
tags:
|
||||
- packages
|
||||
- persistence
|
||||
- openhab
|
||||
|
||||
|
||||
|
||||
18
roles/openhab/tasks/repo.yml
Normal file
18
roles/openhab/tasks/repo.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
- name: install ppa key
|
||||
apt_key: url=https://bintray.com/user/downloadSubjectPublicKey?username=openhab state=present
|
||||
tags:
|
||||
- repo
|
||||
- openhab
|
||||
|
||||
- name: install openhab repo
|
||||
apt_repository:
|
||||
repo='deb http://dl.bintray.com/openhab/apt-repo stable main'
|
||||
state=present
|
||||
update_cache=yes
|
||||
filename=openhab
|
||||
tags:
|
||||
- repo
|
||||
- openhab
|
||||
|
||||
Reference in New Issue
Block a user