diff --git a/all/common/tasks/main.yml b/all/common/tasks/main.yml index 6a1b3ce54361e3f7fafa89a4e58d55ac4810b07c..aa5bfdf79bb174316c9a2022a0c03bd8af5aa83e 100644 --- a/all/common/tasks/main.yml +++ b/all/common/tasks/main.yml @@ -4,8 +4,22 @@ - name: create motd file template: src=motd.j2 dest=/etc/motd +- name: install apt-transport-https packages before adding sources + apt: + pkg: "{{ item }}" + update_cache: yes + state: installed + with_items: + - apt-transport-https + +- name: add debian repo keys + apt_key: + url: "{{ item }}" + state: present + with_items: "{{ debian_keys }}" + - name: set debian repos - template: src=sources.list.j2 dest=/etc/apt/sources.list + template: src=sources.list.j2 dest=/etc/apt/sources.list - name: install common packages apt: @@ -13,10 +27,10 @@ update_cache: yes state: installed with_items: - - psmisc - - tmux - vim - wget + - psmisc + - tree - name: deploy sshd config template: src=sshd_config.j2 dest=/etc/ssh/sshd_config diff --git a/group_vars/raspbianjessie b/group_vars/raspbianjessie index 277da01c36a22c340d19de115c23700f9e26ef39..0ecba595c8b83207fb5281a4f6e0ad2f98976826 100644 --- a/group_vars/raspbianjessie +++ b/group_vars/raspbianjessie @@ -1,7 +1,4 @@ # Gruppen-Spezifishe Variablen -debian_sources: - - "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" - \ No newline at end of file diff --git a/host_vars/vorstandspi b/host_vars/vorstandspi index cf0f2489ee2ae9613735ead541287a5f40d30f3f..a6b97011bcde8ced2829961cb7348ace19c42c63 100644 --- a/host_vars/vorstandspi +++ b/host_vars/vorstandspi @@ -1,6 +1,9 @@ # Host spezifische Variablen +debian_sources: + - "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" + administratorenteam: - "da1l6" - "larsm" diff --git a/host_vars/warphab b/host_vars/warphab new file mode 100644 index 0000000000000000000000000000000000000000..fdf150443115d6431687b95cf1ca45ea2ea2e611 --- /dev/null +++ b/host_vars/warphab @@ -0,0 +1,15 @@ + +# Host spezifische Variablen + +debian_sources: + - "deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi" + - "deb https://homegear.eu/packages/Raspbian/ jessie/" + - "deb http://dl.bintray.com/openhab/apt-repo2 testing main" + +debian_keys: + - "https://homegear.eu/packages/Release.key" + - "https://bintray.com/user/downloadSubjectPublicKey?username=openhab" + +administratorenteam: + - "user51" + - "void" diff --git a/hosts b/hosts index dd6a45f5de1ac8796c0d83930488992cb6ec2545..641be610cf0c7e003fd85ac72910098ad58adb94 100644 --- a/hosts +++ b/hosts @@ -20,3 +20,6 @@ webserver ansible_ssh_host=89.163.231.226 # Vorstands-PI # Auch erreichbar unter vorstand.warpzone.ms vorstandspi ansible_ssh_host=10.0.0.206 + +# OpenHAB Server +warphab ansible_ssh_host=10.0.3.238 diff --git a/keyfiles/user51.pub b/keyfiles/user51.pub new file mode 100644 index 0000000000000000000000000000000000000000..1a22b1115c6b71fed89176e70d2f3390684112b1 --- /dev/null +++ b/keyfiles/user51.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCm7uTtTym/xEWwjvN1TCsvHMBAL82ml6+L7ju7eH3S0fkQ+lXUXJIhX6AQJhITqP7qUsBlM73bCDo0GcB/b8qlg1YaqkWaN8llJ9BwExvXqZ6IXfZj7F2eRwVknmgIY39H3NQt2pgZmX1VS0uK6dK7SGao43EUiZR6YqDg/rUIz8LMHDhiRyGaa5CFG3gUe5k4aXHiyYPmNhb5Q67PK8U2Shd2EW7C97eQBE0olGHYL0S2m4Z9dZ3S6q1wp/b1aFR7/LDzlGaHZYhrSuRQeBcVQcQFyy7gjFlXWJ3mAQHzdz/ldGuobPOSzG0h49J94sLET/Q2HodTD/QDzFmqLvgZ martin@W500.lan \ No newline at end of file diff --git a/site.yml b/site.yml index fc69ae823aa802a839c1445a58933488581945c8..148ba4e9320aa6e27f7cd8d143d9080060593ca1 100644 --- a/site.yml +++ b/site.yml @@ -3,6 +3,7 @@ - include: all/main.yml - include: vorstandspi/main.yml +- include: warphab/main.yml - include: webserver/main.yml diff --git a/warphab/homegear/files/main.conf b/warphab/homegear/files/main.conf new file mode 100644 index 0000000000000000000000000000000000000000..9cc38432c52930589378f42277631a269b1e50eb --- /dev/null +++ b/warphab/homegear/files/main.conf @@ -0,0 +1,259 @@ +# Homegear configuration file + +# Default: runAsUser = root +# runAsUser = homegear + +# Default: runAsGroup = root +# runAsGroup = homegear + +# Default: debugLevel = 3 +debugLevel = 4 + +# Default: memoryDebugging = false +memoryDebugging = true + +# Prints log information helping in fixing errors +# Default: devLog = false +devLog = false + +# Set to false to disable core dumps. Currently to make fixing errors easier, core dumps are enabled by default. +# Default: enableCoreDumps = true +enableCoreDumps = true + +# The working directory of Homegear. E. g. core dumps are written here. If workingDirectory is empty, the +# executable path is used. +# Default: workingDirectory = +workingDirectory = /var/lib/homegear + +# The socket files are placed into this directory. If socketPath is empty, the executable path is used. +# Default: socketPath = +socketPath = /var/run/homegear + +# If databasePath is empty, the executable path is used. +# Default: dataPath = +dataPath = /var/lib/homegear + +# Default: dataPathPermissions = 770 +# dataPathPermissions = 770 + +# Default: dataPathUser = +# dataPathUser = homegear + +# Default: dataPathGroup = +# dataPathGroup = homegear + +# If databaseMemoryJournal is set to true, database write operations are faster but if your system +# suffers a power loss the database might get corrupted. +# Default: databaseMemoryJournal = false +databaseMemoryJournal = false + +# If databaseWALJournal is set to true database write operations are faster. This is more secure than +# settings databaseMemoryJournal. databaseWALJournal and databaseMemoryJournal cannot be used together. +# Default: databaseWALJournal = true +databaseWALJournal = true + +# If databaseSynchronous is set to false database write operations are faster but if your system +# suffers a power loss the database might get corrupted. +# Default: databaseSynchronous = true +databaseSynchronous = true + +# databaseMaxBackups defines the maximum number of database backups to create. When this number is reached, +# old backups are deleted. +# Default: databaseMaxBackups = 10 +databaseMaxBackups = 10 + +# Default: logfilePath = /var/log/homegear +logfilePath = /var/log/homegear + +# Enable +# Default: enableUPnP = true +enableUPnP = true + +# Sets the IP address, the UPnP server listens on. By default auto discovery is used, but this might not work, +# if multiple interfaces exist. Only set specific IP addresses not "0.0.0.0". +# Default: uPnPIpAddress = +# uPnPIpAddress = + +# Sets the IP address, the SSDP server listens on. By default auto discovery is used, but this might not work, +# if multiple interfaces exist. Only set specific IP addresses not "0.0.0.0". +# Default: ssdpIpAddress = +# ssdpIpAddress = + +# Sets the port number, the SSDP server listens on. By default Homegear listens on port 1900, but this might not work, +# if other processes listen in this port as well. +# Default: ssdpPort = 1900 +# ssdpPort = + +#### SSL options #### +# You can create a new certificate pair with: +# openssl genrsa -out /etc/homegear/homegear.key 2048 +# openssl req -new -key /etc/homegear/homegear.key -out /etc/homegear/homegear.csr +# openssl x509 -req -in /etc/homegear/homegear.csr -signkey /etc/homegear/homegear.key -out /etc/homegear/homegear.crt + +# Default: certPath = /etc/homegear/homegear.crt +certPath = /etc/homegear/homegear.crt + +# Default: keyPath = /etc/homegear/homegear.key +keyPath = /etc/homegear/homegear.key + +# When "loadDHParamsFromFile" is set to "false", Diffie-Hellman parameters will be generated when Homegear starts. +# That actually is more secure, but the generation takes a long time on slow computers. +# Default: loadDHParamsFromFile = true +loadDHParamsFromFile = true + +# Default: dhParamPath = /etc/homegear/dh1024.pem +dhParamPath = /etc/homegear/dh1024.pem + +# Path to device description files +# Default: /etc/homegear/devices +deviceDescriptionPath = /etc/homegear/devices + +# Path to the RPC clients event server settings file. +# Default: clientSettingsPath = /etc/homegear/rpcclients.conf +clientSettingsPath = /etc/homegear/rpcclients.conf + +# Path to the RPC server settings file. +# Default: serverSettingsPath = /etc/homegear/rpcservers.conf +serverSettingsPath = /etc/homegear/rpcservers.conf + +# Path to the MQTT settings file. +# Default: mqttSettingsPath = /etc/homegear/mqtt.conf +mqttSettingsPath = /etc/homegear/mqtt.conf + +# Path to the device family config files. +# Default: familyConfigPath = /etc/homegear/families +familyConfigPath = /etc/homegear/families + +# Path to php.ini. +# Default: phpIniPath = /etc/homegear/php.ini +phpIniPath = /etc/homegear/php.ini + +# Path to the GPIO root directory. Only relevant if one of the physical devices needs GPIO access. +# Default: gpioPath = /sys/class/gpio +gpioPath = /sys/class/gpio + +# Export these GPIOs and set permissions when running Homegear with "-s". +# exportGpios = 5, 6, 7 + +# Path to scripts which can be executed by calling "runScript" +# Default: scriptPath = /var/lib/homegear/scripts +scriptPath = /var/lib/homegear/scripts + +# Default: scriptPathPermissions = 770 +# scriptPathPermissions = 770 + +# Default: scriptPathUser = +# scriptPathUser = homegear + +# Default: scriptPathGroup = +# scriptPathGroup = homegear + +# Path to the family modules. +# Default: modulePath = /var/lib/homegear/modules +modulePath = /var/lib/homegear/modules + +# Path to the directory with firmware updates +# Default: firmwarePath = /usr/share/homegear/firmware +firmwarePath = /usr/share/homegear/firmware + +# Path to a directory where Homegear can store temporary data +# Default: tempPath = /var/lib/homegear/tmp +tempPath = /var/lib/homegear/tmp + +# Some clients don't provide the option to set their hostname to +# "localhost" or "127.0.0.1" so a SSH tunnel normally wouldn't work. +# To redirect communication to a client's XML RPC event server through a +# SSH tunnel in this case, specify the client's XML RPC server address +# here. Homegear replaces the provided address (or hostname) with +# 127.0.0.1 (or ::1 when IPv6 is used). Multiple entries are allowed. +# redirectToSSHTunnel = 192.168.0.1 +# redirectToSSHTunnel = fdef:abcd:bcda::1234 +# redirectToSSHTunnel = 192.168.0.10 +# redirectToSSHTunnel = MyHostname + +# Some clients (like the CCU2) send localhost as address to a remote Homegear +# installation. Homegear then tries to connect to localhost which of course +# fails. As a workaround Homegear can replace the address sent from the client +# with a working address. $REMOTEIP is replaced automatically with the remote ip +# address. +# Address to search for Address to use +# | | +# V V +replaceClientServerAddress = xmlrpc_bin://127.0.0.1:1999 xmlrpc_bin://$REMOTEIP:1999 +replaceClientServerAddress = http://127.0.0.1:9292/bidcos http://$REMOTEIP:9292/bidcos + +#### !!!Don't change settings below unless you know exactly what you're doing!!! #### +#### !!!Don't change settings below unless you know exactly what you're doing!!! #### +#### !!!Don't change settings below unless you know exactly what you're doing!!! #### + +# Default: prioritizeThreads = true +prioritizeThreads = true + +# Default: workerThreadWindow = 3000 +workerThreadWindow = 3000 + +# Default scriptEngineMaxThreadsPerScript = 4 +scriptEngineMaxThreadsPerScript = 4 + +# Default scriptEngineMaxScriptsPerProcess = -1 +scriptEngineMaxScriptsPerProcess = 50 + +# Default scriptEngineThreadCount = 10 +scriptEngineThreadCount = 10 + +# Default: scriptEngineServerMaxConnections = 10 +scriptEngineServerMaxConnections = 10 + +# Default: cliServerMaxConnections = 50 +cliServerMaxConnections = 50 + +# Default: rpcServerMaxConnections = 50 +rpcServerMaxConnections = 50 + +# Default: rpcServerThreadPriority = 0 +rpcServerThreadPriority = 0 + +# Default: rpcServerThreadPolicy = SCHED_OTHER +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +rpcServerThreadPolicy = SCHED_OTHER + +# Default: rpcClientMaxServers = 50 +rpcClientMaxServers = 50 + +# Default: rpcClientThreadPriority = 0 +rpcClientThreadPriority = 0 + +# Default: rpcClientThreadPolicy = SCHED_OTHER +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +rpcClientThreadPolicy = SCHED_OTHER + +# Default: workerThreadPriority = 0 +workerThreadPriority = 0 + +# Default: workerThreadPolicy = SCHED_OTHER +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +workerThreadPolicy = SCHED_OTHER + +# Default: packetQueueThreadPriority = 45 +packetQueueThreadPriority = 45 + +# Default: packetQueueThreadPolicy = SCHED_FIFO +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +packetQueueThreadPolicy = SCHED_FIFO + +# Default: packetReceivedThreadPriority = 0 +packetReceivedThreadPriority = 0 + +# Default: packetReceivedThreadPolicy = SCHED_OTHER +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +packetReceivedThreadPolicy = SCHED_OTHER + +# Default: eventMaxThreads = 20 +eventThreadCount = 5 + +# Default: eventThreadPriority = 0 +eventThreadPriority = 0 + +# Default: eventThreadPolicy = SCHED_OTHER +# Valid policies: SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, SCHED_FIFO, SCHED_RR +eventThreadPolicy = SCHED_OTHER diff --git a/warphab/homegear/files/max.conf b/warphab/homegear/files/max.conf new file mode 100644 index 0000000000000000000000000000000000000000..2061d053c86d2e02cb33dfc136a7360f11f8b96a --- /dev/null +++ b/warphab/homegear/files/max.conf @@ -0,0 +1,96 @@ +___________________________________________________________________________ + +---------------------------------- MAX! ---------------------------------- +___________________________________________________________________________ + +####################################### +################# CUL ################# +####################################### + +## The device family this interface is for +#[CUL] + +## Specify an unique id here to identify this device in Homegear +#id = My-MAX-CUL + +## When default is set to "true" Homegear will assign this device +## to new peers. +#default = true + +## Options: cul, coc, cc1100 +#deviceType = cul + +#device = /dev/ttyACM0 + +## Should be "40" for MAX! +#responseDelay = 40 + +####################################### +########## TI CC1101 Module ########## +####################################### + +## The device family this interface is for +#[TI CC1101 Module] + +## Specify an unique id here to identify this device in Homegear +#id = My-MAX-CC1101 + +## When default is set to "true" Homegear will assign this device +## to new peers. +#default = true + +## Options: cul, coc, cc1100 +#deviceType = cc1100 + +#device = /dev/spidev0.0 + +## Default: responseDelay = 95 +## Should be "40" for CUL or COC and "45" for TI CC1101. +#responseDelay = 45 + +## The interrupt pin to use. "0" for GDO0 or "2" for GDO2. +## You only need to connect one of them. Specify the GPIO +## you connected the interrupt pin to below. +#interruptPin = 2 + +## The GPIO GDO0 or GDO2 is connected to. Specify which GDO to use above. +#gpio1 = 23 + +### Additional TI CC1190 Config ### + +## The GPIO high gain mode of the CC1190 is connected to. +## Default: -1 (disabled) +#gpio2 = 5 + +## The hexadecimal value for the PATABLE of the TI CC1101. +## Default: +## - Without high gain mode: 0xC2 +## - With high gain mode: 0x27 (maximum legally allowed setting) +#txPowerSetting = 0x27 + +####################################### +################ CUNX ################ +####################################### + +## The device family this interface is for +#[CUNX] + +## Specify an unique id here to identify this device in Homegear +#id = My-CUNX + +## When default is set to "true" Homegear will assign this device +## to new peers. +#default = true + +## Options: cul, cc1100, coc, cunx, hmcfglan, hmlgw +#deviceType = cunx + +## IP address of your CUNO +#host = 192.168.178.100 + +## Port number your CUNX listens on. Normally 2323. +#port = 2323 + +## Default: responseDelay = 95 +## Should be "40" for CUNX +#responseDelay = 40 diff --git a/warphab/homegear/handlers/main.yml b/warphab/homegear/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..d93b7339775ad98cda52d86d4ecc4490613ba51f --- /dev/null +++ b/warphab/homegear/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: restart homegear + service: name=homegear state=restarted diff --git a/warphab/homegear/tasks/main.yml b/warphab/homegear/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e142a0ceadbe9fa7de0f685d08bced29d37a73e7 --- /dev/null +++ b/warphab/homegear/tasks/main.yml @@ -0,0 +1,19 @@ +--- + +- name: install packages + apt: + pkg: "{{ item }}" + update_cache: yes + state: installed + with_items: + - homegear + - homegear-max + notify: restart homegear + +- name: main.conf + copy: src=main.conf dest=/etc/homegear/main.conf + notify: restart homegear + +- name: max.conf + copy: src=max.conf dest=/etc/homegear/families/max.conf + notify: restart homegear diff --git a/warphab/main.yml b/warphab/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..e9a132e24a615f0417483b674dc40a6567ba8730 --- /dev/null +++ b/warphab/main.yml @@ -0,0 +1,8 @@ +--- +# Rollen, die nur auf dem WarpHAB-Server verwendet werden + +- hosts: warphab + remote_user: root + roles: + - { role: homegear, tags: homegear } + - { role: openhab, tags: openhab } diff --git a/warphab/openhab/handlers/main.yml b/warphab/openhab/handlers/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..398ba4ca03806acf8e4a1a9cfe4d3974a94436ed --- /dev/null +++ b/warphab/openhab/handlers/main.yml @@ -0,0 +1,3 @@ +--- +- name: restart openhab + service: name=openhab2 state=restarted diff --git a/warphab/openhab/tasks/main.yml b/warphab/openhab/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..a06ab4cd840ff6db04047f0cbd4042649669c2a9 --- /dev/null +++ b/warphab/openhab/tasks/main.yml @@ -0,0 +1,19 @@ +--- + +- name: install packages + apt: + pkg: "{{ item }}" + update_cache: yes + state: installed + with_items: + - oracle-java8-jdk + - openhab2-offline + notify: restart openhab + +#- name: main.conf +# copy: src=main.conf dest=/etc/homegear/main.conf +# notify: restart openhab + +#- name: homematicbidcos.conf +# copy: src=homematicbidcos.conf dest=/etc/homegear/families/homematicbidcos.conf +# notify: restart openhab