Skip to content

Commit

Permalink
Merge pull request #1 from Skorfulose/develop
Browse files Browse the repository at this point in the history
First version
  • Loading branch information
Skorfulose authored Feb 6, 2017
2 parents e0370a7 + 5f936d8 commit 2025e3d
Show file tree
Hide file tree
Showing 16 changed files with 804 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.retry
.DS_Store
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# ansible-raspberrypi-playbooks
Ansible playbooks for my Raspberry Pis
# Ansible Playbooks for my Raspberry Pis

* Install requirements from Ansible Galaxy:
`sudo ansible-galaxy install -r requirements.yml`
* Check/set your preferred username in `vars/main.yml`
* First run only: Run base playbook as default user `pi`:
`ansible-playbook base.yml -i hosts -u pi --ask-pass`
* Subsequent runs:
`ansible-playbook main.yml -i hosts`
* Or run specific playbooks only:
`ansible-playbook ozwcp.yml -i hosts`

## Playbooks

### Base (base.yml)

* Runs a full apt package upgrade/update
* Extends the root filesystem to the actual SD Card size
* Configures time zone, locale

### OZWCP (ozwcp.yml)

* Installs [OpenZWave Control Panel](https://github.com/OpenZWave/open-zwave-control-panel)

### Mosquitto (mosquitto.yml)

* Installs the [Mosquitto](http://mosquitto.org) MQTT broker

### Home Assistant (home-assistant.yml)

* Installs [Home Assistant](https://home-assistant.io/)
* Installs [OpenZWave](http://www.openzwave.net)
* Clones [my config from GitHub](https://github.com/Skorfulose/home-assistant-config)

### Hyperion (hyperion.yml)

* Installs [Hyperion](https://hyperion-project.org)
* Applies my configuration

### Misc (misc.yml)

This playbook performs some basic configurations I prefer to have available on my Linux machines.

* Create an `ll` alias for `ls -alF`
* Install `htop`
15 changes: 15 additions & 0 deletions base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- hosts: raspberrypi*
become: true
roles:
- role: mikolak.raspi-config
raspi_config_update_packages: yes
raspi_config_expanded_filesystem: yes
raspi_config_ensure_optimal_cpu_params: false
raspi_config_locale: de_DE.UTF8
raspi_config_timezone: Europe/Berlin
raspi_config_fail_on_auth_test: false
raspi_config_replace_user:
name: "{{ main_user }}"
path_to_ssh_key: "~/.ssh/id_rsa.pub"
vars_files:
- vars/main.yml
8 changes: 8 additions & 0 deletions home-assistant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- hosts: raspberrypi
roles:
- role: mechaxl.homeassistant
enable_zwave: yes
hass_configuration: |
homeassistant:
name: Home
- role: home-assistant-config
2 changes: 2 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[raspberrypi]
pi
3 changes: 3 additions & 0 deletions hyperion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: raspberrypi
roles:
- hyperion
5 changes: 5 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- include: misc.yml
- include: home-assistant.yml
- include: ozwcp.yml
- include: mosquitto.yml
- include: hyperion.yml
3 changes: 3 additions & 0 deletions misc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: all
roles:
- misc
3 changes: 3 additions & 0 deletions mosquitto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- hosts: raspberrypi
roles:
- pbonrad.mosquitto
4 changes: 4 additions & 0 deletions ozwcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- hosts: raspberrypi
roles:
- role: mechaxl.ozwcp
ozwcp_user: ozwcp
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- src: mikolak.raspi-config
- src: pbonrad.mosquitto
- src: mechaxl.homeassistant
- src: mechaxl.ozwcp
16 changes: 16 additions & 0 deletions roles/home-assistant-config/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: delete existing config folder (git clone will fail in a non-empty dir)
file:
path: /home/hass/.homeassistant
state: absent
become: true
- name: clone my config from GitHub
git:
repo: https://github.com/Skorfulose/home-assistant-config.git
dest: /home/hass/.homeassistant
become: true
become_user: hass
- name: restart home assistant to apply config
service:
name: home-assistant
state: restarted
become: true
Loading

0 comments on commit 2025e3d

Please # to comment.