diff --git a/README.md b/README.md deleted file mode 100644 index bfe757c..0000000 --- a/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# ansible-homelab - -I use(d) these roles to automate the setup of my LXC homelab. They are highly tailored to my use-case and would require substantial review and editing for anyone else to use them. - -## Example - -``` bash -lxc init images:debian/12/cloud debian-archive --storage lxd-pool -``` - -Configure the instance for cloud-init: - -``` bash -lxc config set debian-archive cloud-init.user-data - <<- EOF -#cloud-config -users: - - name: debian - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOmibToJQ8JZpSFLH3482oxvpD56QAfu4ndoofbew5t jas@si.local - sudo: 'ALL=(ALL) NOPASSWD: ALL' - shell: /bin/bash - lock_passwd: true -apt: - sources_list: | - deb http://deb.debian.org/debian $RELEASE main - deb http://deb.debian.org/debian $RELEASE-updates main - deb http://deb.debian.org/debian-security/ $RELEASE-security main - deb http://deb.debian.org/debian $RELEASE-backports -package_update: true -package_upgrade: true -packages: - - curl - - debian-keyring - - debsig-verify - - git - - nodejs - - npm - - notmuch - - offlineimap3 - - pass - - python3-dev - - python3-pip - - ripgrep - - ssh - - wget - - xauth - - youtube-dl -rsyslog: - configs: - - content: "*.* @10.0.0.41:514" - filename: 99-forward.conf - remotes: - moonshadow: 10.0.0.41 -timezone: America/Chicago -EOF -``` - -Start the instance, then check the cloud-init status: - -``` bash -lxc start debian-archive -lxc exec debian-archive -- cloud-init status --wait -``` - -SSH into the new instance to accept the host key: - -``` bash -ssh debian@10.227.115.42 -``` - -Once that's done, you should be able to SSH directly to the debian user, and Ansible will be ready to run. - -Add the instance's IP address to hosts.ini: - -``` yaml -[homelab] -10.227.115.42 -``` - -Run the setup.yml playbook for all roles, or choose specific roles with --tags: - -``` bash -ansible-playbook -i hosts.ini setup.yml -u debian -b -ansible-playbook -i hosts.ini setup.yml --tags debian-archive -u debian -b -``` diff --git a/cloud-init/debian-archive.yml b/cloud-init/debian-archive.yml deleted file mode 100644 index 131e64b..0000000 --- a/cloud-init/debian-archive.yml +++ /dev/null @@ -1,40 +0,0 @@ -#cloud-config -users: - - name: debian - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOmibToJQ8JZpSFLH3482oxvpD56QAfu4ndoofbew5t jas@si.local - sudo: 'ALL=(ALL) NOPASSWD: ALL' - shell: /bin/bash - lock_passwd: true -apt: - sources_list: | - deb http://deb.debian.org/debian $RELEASE main - deb http://deb.debian.org/debian $RELEASE-updates main - deb http://deb.debian.org/debian-security/ $RELEASE-security main - deb http://deb.debian.org/debian $RELEASE-backports -package_update: true -package_upgrade: true -packages: - - curl - - debian-keyring - - debsig-verify - - git - - nodejs - - npm - - notmuch - - offlineimap3 - - pass - - python3-dev - - python3-pip - - ripgrep - - ssh - - wget - - xauth - - youtube-dl -rsyslog: - configs: - - content: "*.* @10.0.0.27:514" - filename: 99-forward.conf - remotes: - logs: 10.0.0.27 -timezone: America/Chicago diff --git a/cloud-init/debian-serv.yml b/cloud-init/debian-serv.yml deleted file mode 100644 index 702e604..0000000 --- a/cloud-init/debian-serv.yml +++ /dev/null @@ -1,41 +0,0 @@ -#cloud-config -apt: - sources_list: | - deb http://deb.debian.org/debian $RELEASE main - deb http://deb.debian.org/debian $RELEASE-updates main - deb http://deb.debian.org/debian-security/ $RELEASE-security main - deb http://deb.debian.org/debian $RELEASE-backports main -package_update: true -package_upgrade: true -packages: - - acl - - apt-transport-https - - apt-utils - - build-essential - - certbot - - curl - - debian-keyring - - debian-archive-keyring - - git - - golang - - man-db - - manpages - - ssh - - python3-dev - - python3-pip - - rsync - - wget -users: - - name: debian - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOmibToJQ8JZpSFLH3482oxvpD56QAfu4ndoofbew5t jas@si.local - sudo: 'ALL=(ALL) NOPASSWD: ALL' - shell: /bin/bash - lock_passwd: true -rsyslog: - configs: - - content: "*.* @10.0.0.27:514" - filename: 99-forward.conf - remotes: - logs: 10.0.0.27 -timezone: America/Chicago diff --git a/cloud-init/fedora-mastodon.yml b/cloud-init/fedora-mastodon.yml deleted file mode 100644 index 560c911..0000000 --- a/cloud-init/fedora-mastodon.yml +++ /dev/null @@ -1,54 +0,0 @@ -#cloud-config -yum_repos: - tailscale-stable: - name: Tailscale stable - baseurl: https://pkgs.tailscale.com/stable/fedora/x86_64 - enabled: true - type: rpm - repo_gpgcheck: true - gpgcheck: false - gpgkey: https://pkgs.tailscale.com/stable/fedora/repo.gpg - caddy: - name: Copr repo for caddy owned by @caddy - baseurl: https://download.copr.fedorainfracloud.org/results/@caddy/caddy/fedora-38-x86_64/ - type: rpm-md - skip_if_unavailable: true - gpgcheck: true - gpgkey: https://download.copr.fedorainfracloud.org/results/@caddy/caddy/pubkey.gpg - repo_gpgcheck: 0 - enabled: true - enabled_metadata: 1 -package_update: true -package_upgrade: true -packages: - - '@c-development' - - '@development-tools' - - curl - - dnf-automatic - - git - - golang - - python3-devel - - python3-pip - - rsync - - openssh - - wget - - caddy - - vim - - tailscale -users: - - name: fedora - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOmibToJQ8JZpSFLH3482oxvpD56QAfu4ndoofbew5t jas@nexus.local - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPnZBvorp/NDi5MNmrBqeSTnY3sNiZVNPF91dORH94Y jas@evergloam - sudo: 'ALL=(ALL) NOPASSWD: ALL' - shell: /bin/bash - lock_passwd: true -rsyslog: - configs: - - content: "*.* @10.0.0.27:514" - filename: 99-forward.conf - remotes: - logs: 10.0.0.27 -timezone: America/Chicago -runcmd: - - printf "fastestmirror=True\ndeltarpm=True\nmax_parallel_downloads=10\n" | tee -a /etc/dnf/dnf.conf diff --git a/cloud-init/fedora-serv.yml b/cloud-init/fedora-serv.yml deleted file mode 100644 index c285f7d..0000000 --- a/cloud-init/fedora-serv.yml +++ /dev/null @@ -1,63 +0,0 @@ -#cloud-config -yum_repos: - tailscale-stable: - name: Tailscale stable - baseurl: https://pkgs.tailscale.com/stable/fedora/x86_64 - enabled: true - type: rpm - repo_gpgcheck: true - gpgcheck: false - gpgkey: https://pkgs.tailscale.com/stable/fedora/repo.gpg - charm: - name: Charm - baseurl: https://repo.charm.sh/yum/ - enabled: true - gpgcheck: true - gpgkey: https://repo.charm.sh/yum/gpg.key - caddy: - name: Copr repo for caddy owned by @caddy - baseurl: https://download.copr.fedorainfracloud.org/results/@caddy/caddy/fedora-38-x86_64/ - type: rpm-md - skip_if_unavailable: true - gpgcheck: true - gpgkey: https://download.copr.fedorainfracloud.org/results/@caddy/caddy/pubkey.gpg - repo_gpgcheck: 0 - enabled: true - enabled_metadata: 1 -package_update: true -package_upgrade: true -packages: - - '@c-development' - - '@development-tools' - - certbot - - curl - - dnf-automatic - - git - - golang - - python3-devel - - python3-pip - - rsync - - openssh - - wget - - caddy - - soft-serve - - vim - - tailscale -users: - - name: fedora - ssh_authorized_keys: - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOmibToJQ8JZpSFLH3482oxvpD56QAfu4ndoofbew5t jas@nexus.local - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIItZX/e12RMbdTov8HYLTLTiY0U08X8z73LXdlRMNkTZ jas@moonshadow - - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPnZBvorp/NDi5MNmrBqeSTnY3sNiZVNPF91dORH94Y jas@evergloam - sudo: 'ALL=(ALL) NOPASSWD: ALL' - shell: /bin/bash - lock_passwd: true -rsyslog: - configs: - - content: "*.* @10.0.0.27:514" - filename: 99-forward.conf - remotes: - logs: 10.0.0.27 -timezone: America/Chicago -runcmd: - - printf "fastestmirror=True\ndeltarpm=True\nmax_parallel_downloads=10\n" | tee -a /etc/dnf/dnf.conf diff --git a/hosts.ini b/hosts.ini deleted file mode 100644 index d492d34..0000000 --- a/hosts.ini +++ /dev/null @@ -1,5 +0,0 @@ -[homelab] -debian-archive -debian-serv -fedora-transmission -ubuntu-mastodon diff --git a/inventory.yml b/inventory.yml new file mode 100644 index 0000000..cae5f72 --- /dev/null +++ b/inventory.yml @@ -0,0 +1,15 @@ +--- +homelab: + hosts: + pi0: + ansible_user: dietpi + ansible_host: 10.0.0.10 + ansible_python_interpreter: /usr/bin/python3 + pi1: + ansible_user: dietpi + ansible_host: 10.0.0.11 + ansible_python_interpreter: /usr/bin/python3 + pi2: + ansible_user: dietpi + ansible_host: 10.0.0.12 + ansible_python_interpreter: /usr/bin/python3 diff --git a/roles/debian-archive/files/offlineimaprc b/roles/debian-archive/files/offlineimaprc deleted file mode 100644 index ef9259c..0000000 --- a/roles/debian-archive/files/offlineimaprc +++ /dev/null @@ -1,25 +0,0 @@ -[general] -accounts = protonmail -metadata = /home/debian/.offlineimap-metadata - -[Account protonmail] -localrepository = protonmail-local -remoterepository = protonmail-remote -autorefresh = 1 -postsynchook = notmuch new - -[Repository protonmail-local] -type = Maildir -localfolders = /home/debian/mail -sync_deletes = no - -[Repository protonmail-remote] -type = IMAP -remoteuser = hyperreal64@pm.me -remotepass = -remotehost = 127.0.0.1 -remoteport = 1143 -ssl = no -starttls = no -expunge = yes -readonly = True diff --git a/roles/debian-archive/files/pm-bridge-tty b/roles/debian-archive/files/pm-bridge-tty deleted file mode 100644 index e79c211..0000000 --- a/roles/debian-archive/files/pm-bridge-tty +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -# -# This script must be run as the same user running offlineimap, which is -# preferably a non-privileged user. -# -# This script should be daemonized (forked to bg) or used as the value of -# the ExecStart= directive in a systemd service file. -set -exo pipefail - -# If "init" is supplied as arg $1, initialize the bridge. -if [[ "$1" == "init" ]]; then - - # Initialize pass - gpg --generate-key --batch <