Installing Homegenie with ansible from a blank pi

I have knocked up a playbook here: https://github.com/davidwallis3101/HGConfigure/blob/master/ansible/playbook.yml for installing homegenie from a blank rpi image.

steps:

Download the image and write to the sdcard
create an empty ssh file on the boot partition
Insert sd card and boot pi, noting ip address.

on a host machine running linux (I use debian within windows 10 - available from the app store) - Not on your PI… don’t even bother logging in to the pi… there is no need.

# Install ansible etc
sudo apt-get update
sudo apt-get install python-pip git python-dev sshpass -y
sudo pip install ansible

git clone https://github.com/davidwallis3101/HGConfigure.git
cd HGConfigure/ansible/

# execute the playbook against your pi
ansible-playbook playbook.yml -i 192.168.0.81, --ask-pass --become -c paramiko

where 192.168.0.81 is your ip…

alternatively - edit the hosts file to contain all your nodes and execute:

ansible-playbook playbook.yml -i hosts --ask-pass --become -c paramiko

NB: You may want to edit the line that creates a user called davidw :slight_smile:

I know its not the best but I am playing around with ansible for work and this looked like a good test…

This will install mono, dotnet core, powershell core, homegenie, fail2ban other pre-reqs and configure systemd.

My plan is to then automate the restoration of my configuration, but currently that is done with powershell… also in this repo…

I also have a script for getting the latest release which may be of use:

David

This approach requires a second machine running Linux, correct?

yeah, you need something running linux… you could ‘possibly’ do it from the same machine, but the reboot would break it… but could be commented out.

What desktop os are you using?

Win7. I usually Putty into the RPi.

Dont think there is a way of running it from windows unless you are on windows 10 (really should be too, so much better than 7!!) The only MS OS I have actually paid for :open_mouth:

You could try doing it through cygwin… unless you have another pi?

I was just looking at Domoticz since I have a fresh RPi and was curious of their install steps. I haven’t tried it yet, but if it’s correct, we need a better installer!

The “easy” way

After setting up the operating system of your choice, you are now ready to install Domoticz. Assuming your Linux is Debian-based, like Raspbian or Ubuntu, installing Domoticz is extremely easy. Just open a terminal window and execute this command.

curl -L install.domoticz.com | sudo bash

Congratulations, you’re done!

Just point your browser to the IP address of your Raspberry Pi, and use port 8080. From your Pi’s browser you could surf to http://127.0.0.1:8080.

That’s about as ridiculously easy as it gets!

EDIT: I navigated to that link and found the reason it’s so easy is that “install.domoticz.com” is a bash script that installs everything kinda like how we were trying before. It’s got a nice interface on the installer too, so that might be something worth considering including.

Yes, I have already tried this approach for docker based installation (look at this post Running HomeGenie on boot in Linux-we really need a Systemd service), which is almost ready for production.
After that, I’ll do such script for plain installation (without docker, but with all other dependencies like mono and other libraries).

Yes I did it a while back. It was a breeze and I had a full x10 system up and running in no time.

i ran the installer and it truely was amazing. I did not get it running because the service refused to start. Man, services are a pain in Linux.

@bkenobi, to whom are you answering?
If it’s about my post - it’s ok that service didn’t start on Linux if it was x86 machine, because during my experiments I made docker image only for arm platform to run it on RPi. It won’t take a lot of efforts to do the same things for x86 platform.

I wasn’t referring to any post. I was just stating that I find services difficult to work with in general due to how Linux operates. I’m sure it’s just my skill level showing and nothing about the project.