From 2a422ca1e6440121ca8d418d8cd65e4168b64873 Mon Sep 17 00:00:00 2001 From: Buba Date: Fri, 24 Jan 2025 20:19:07 +0000 Subject: [PATCH 1/2] Setup a new host, extend setup documentation --- ansible/README.md | 2 ++ ansible/inventory/inventory.yaml | 2 ++ ansible/playbooks/homelab.yaml | 3 +-- docs/setup.md | 1 + proxmox/ubuntu.md | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index f5ae9560..45c616c9 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -27,6 +27,8 @@ https://www.ansible.com/ 3. Add hosts to `inventory/inventory.yaml` 4. Assign roles to hosts in `playbooks/` 5. Run `apply-.sh` to execute a playbook + - If you use a non-root user and `sudo` requires a password (indicated by the "Missing sudo password" error message), use `apply-.sh --ask-become-pass` and specify the password when requested ("BECOME password" message) + - The playbook will set up passwordless `sudo`, so next time the `--ask-become-pass` parameter will not be required 6. When the administrative user is already created, use that user in the inventory instead of `root` (`ansible_user: `). This is more secure and also required by Homebrew. ## Bootstrapping hosts with authentication diff --git a/ansible/inventory/inventory.yaml b/ansible/inventory/inventory.yaml index 370977b8..8e30bd89 100644 --- a/ansible/inventory/inventory.yaml +++ b/ansible/inventory/inventory.yaml @@ -8,6 +8,8 @@ debian: proxmox: ansible_host: 192.168.1.50 nas: {} + hive: + ansible_host: 192.168.1.243 nest: install_storage_packages: true diff --git a/ansible/playbooks/homelab.yaml b/ansible/playbooks/homelab.yaml index 01e85298..26029b12 100755 --- a/ansible/playbooks/homelab.yaml +++ b/ansible/playbooks/homelab.yaml @@ -10,14 +10,13 @@ hosts: - nas - nest - - nest2 + - hive roles: - role: debian_docker_host - name: Setup Samba client + developer tools hosts: - nest - - nest2 roles: - role: debian_samba_client - role: markosamuli.linuxbrew diff --git a/docs/setup.md b/docs/setup.md index 088c3305..9e823311 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -122,6 +122,7 @@ After setting up the VM, configure the following on the router: - HTTPS - Port 443 TCP & UDP - WireGuard - Port 51820 UDP - Configure the local DNS service to resolve your domain name to the main Docker host. This is to provide uninterrupted DNS name resolution of the local services in case of the internet access fails. + - In AdGuard Home: Filters -> DNS Rewrites -> Add AND *. Note: Query and refresh IP configuration on Windows: ```sh diff --git a/proxmox/ubuntu.md b/proxmox/ubuntu.md index e082ad42..422ecaab 100644 --- a/proxmox/ubuntu.md +++ b/proxmox/ubuntu.md @@ -30,7 +30,7 @@ In addition to the previous, this script also configures the installer for unatt ``` ssh root@proxmox "bash -s" -- < create-ubuntu-server-vm.sh ``` -- Start the VM and confirm the installation +- Start the VM and confirm the installation ("Continue with autoinstall?" prompt) **Details:** From 865a370a406485faec85dd9378e5f70466646690 Mon Sep 17 00:00:00 2001 From: Buba Date: Sat, 25 Jan 2025 10:54:03 +0000 Subject: [PATCH 2/2] Fix Ansible installation on Ubuntu --- ansible/bootstrap-ansible.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/bootstrap-ansible.sh b/ansible/bootstrap-ansible.sh index f707ba7a..a47bee5c 100755 --- a/ansible/bootstrap-ansible.sh +++ b/ansible/bootstrap-ansible.sh @@ -20,7 +20,8 @@ install_ansible_on_ubuntu() { add-apt-repository --yes --update ppa:ansible/ansible apt-get install --yes --no-install-recommends ansible python3-pip - pip install passlib ansible-lint --break-system-packages + # "--ignore-installed" is added to fix error "Cannot uninstall PyYAML 6.0.1 ... The package was installed by debian." + pip install passlib ansible-lint --ignore-installed --break-system-packages ansible-galaxy install -r "${ANSIBLE_DIR}/requirements.yml" }