=======
Ansible modules for configuring your home environment
Ansible modules to configure components of your home network. When I was setting up my home networking, I wanted to ensure that my home system was categorized as infrastructure as code. These components are some of the modules I developed that could help people during their setup and management of their home network setup.
Variables are currently set with Raspberry Pis in mind for home automation and IOT.
-
golden_image: This module allows a user to create a blanket automation to set the standard for all home servers. This one includes setting the SSH key, updating, and configuring the servers.
-
unifi_controller: This module allows the creation of a Unifi Controller similar to a Unifi CloudKey on a Raspberry Pi.
-
bind_9: This module allows the creation of an authoritative Bind 9 DNS for private network resolution. Configuration of the individual forward and reverse zones are required.
-
Installation of Python 3.6+ and PIP.
-
Installation of Ansible on your local computer. This can be completed if the machine
pip install ansible
-
SSH private/public key uploaded to the target servers using this command:
ssh-copy-id -i ~/.ssh/<SSH-KEY.pub> pi@<IP_ADDRESS_OF_TARGET>
-
Enter raspberry password. Default is
raspberry
.
Example:
ssh-copy-id -i ~/.ssh/id_rsa.pub pi@192.168.200.2
- Clone into your directory of choice using the following command:
git clone https://github.com/hunttom/home_network_configuration.git
This playbook updates ensure that Raspberry Pis following standard security practices. Configurations inclue: only accessable via ssh; updates all critical packages via unattended-upgrades
, installs vim
, and updates the Raspberry Pi.
- Update
hosts
file with IP addresses of servers you want to target. - Update of all variables
- Run the command when in the git repository
ansible-playbook baseline_config.yml -i hosts
This playbook install the Unifi controller software on a Raspberry Pi.
- Update
hosts
file with IP addresses of servers you want to target.Note: You can install this on a Raspberry Pi 2 or 3 running Pi Hole.
- Update of all variables
- Run the command when in the git repository
ansible-playbook unifi_config.yml -i hosts
This playbook creates a Bind9 Server on a Raspberry Pi.
- Update
hosts
file with IP addresses of servers you want to target. - Update of all variables within the
files
directory. I have labeled the variables using the domainexample.com
please update emails and domains as you require. - Run the command when in the git repository
ansible-playbook bind_9.yml -i hosts
This playbook runs the following commands sudo apt update
and sudo apt upgrade
Add the following to the playbook to run the following:
- name: Updating Raspberry Pis
hosts: raspberrypi
roles:
- 04_update_debian
This playbook runs the following commands pihole -up
Add the following to the playbook to run the following:
- name: Updating Pihole
hosts: pi_hole
roles:
- 05_update_pihole
This playbook runs the following commands sudo apt update
and sudo apt upgrade unifi
Add the following to the playbook to run the following:
- name: Updating Unifi Controller
hosts: unifi
roles:
- 06_updating_unifi_controller