Skip to content

scheleaap/home-infrastructure

Repository files navigation

Home Infrastructure

This is an Ansible Playbook for my home infrastructure (mostly Raspberry Pi's, so far).

Running it

(See below for setup instructions)

  1. Modify hosts and site.yml as appropriate.
  2. Make sure you have defined all secrets: rename all vault.yaml.default files to vault.yaml and fill in the values as appropriate.
  3. pipenv run ansible-galaxy collection install -r requirements.yml
    pipenv run ansible-galaxy install -r requirements.yml -p roles/
    pipenv run ansible-playbook site.yml -i hosts
    pipenv run ansible-playbook site.yml -i hosts -l framboos
    pipenv run ansible-playbook site.yml -i hosts -l media_center --tags raspotify
    # --ask-vault-pass
    # --ask-become-pass

Setup

Main machine

On the machine you would like to run this playbook on, run:

# Install pip3 and pipenv
sudo apt install python3-pip && \
pip3 install --user pipenv

# Create pipenv with installed dependencies
PATH=~/.local/bin:$PATH && \
pipenv && \
pipenv update

# If you use the default system Python
sudo apt install python3-debian
# If you use Pyenv
pip install python-debian

Adding a new target machine

On every target machine you would like to mananage, execute the following steps:

  1. (Raspberry Pi only) Execute sudo raspi-config to setup keyboard, locale, hostname, etc.

  2. (Raspberry Pi only) Force audio through 3.5 mm jack: sudo raspi-config

  3. (Raspberry Pi only) Upgrade the firmware: sudo rpi-update

  4. Install the SSH server:

    sudo apt install openssh-server
  5. (Optional, this might have been done already) Enable and start SSH:

    sudo systemctl enable ssh
    sudo systemctl start ssh
  6. (Optional, this might have been done already) Create SSH directory:

    cd ~
    install -d -m 700 ~/.ssh
  7. Run from the main machine:
    Copy public key to authorized_keys:

    ssh-copy-id <user>@<host>
  8. Run from the main machine:
    (Optional) Copy the public/private key pair:

    scp ~/.ssh/id_rsa* <user>@<host>:~/.ssh

About

Home infrastructure configuration (Raspberry Pi)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages