Files
server/proxmox/pihole/README.md

1.4 KiB

Pi-hole instalation

These files allow you to install Pi-hole in an idempotent way. Terraform creates the VM on Proxmox, and Ansible installs Pi-hole unattended, using the configuration defined in pihole.toml.

Terraform execution

To create the VM with Terraform, the configuration must be defined in the terraform.tfvars file. You can use terraform.tfvars.example as a base.

Then to execute the following commands:

  1. Intialize terraform

    terraform init
    
  2. Review the plan

    terraform plan
    
  3. Apply the plan.

This step might take a few minutes but if it takes significantly longer, there may be an issue with cloud-init.

terraform apply

After execution, the ansible folder should contain a new inventory.yaml file.

Ansible execution

To install Pi-hole with Ansible, make sure the inventory.yaml file exists, and adjust pihole.toml if needed.

Then run:

ansible-playbook install.yaml

Reinstallation

If you need to reinstall everything in the same environment, destroy and recreate the Terraform resources using:

terraform destroy

Reference

Unattended Pi-hole v6 Setup with Ansible

Configure a VM with Cloud-Init