{"id":43876719,"url":"https://github.com/solairen/pihole","last_synced_at":"2026-02-06T14:45:11.068Z","repository":{"id":39639108,"uuid":"276167647","full_name":"solairen/pihole","owner":"solairen","description":"Install docker Pi-Hole or standalone on Ubuntu OS and Raspberry PI","archived":false,"fork":false,"pushed_at":"2026-01-14T20:04:50.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T23:36:19.722Z","etag":null,"topics":["ansible","docker","pihole","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solairen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":"https://www.paypal.com/paypalme/solairen32"}},"created_at":"2020-06-30T17:35:28.000Z","updated_at":"2026-01-14T20:04:54.000Z","dependencies_parsed_at":"2024-06-06T17:17:09.126Z","dependency_job_id":"42aea438-aa14-44fd-a434-0c1319cc4ead","html_url":"https://github.com/solairen/pihole","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/solairen/pihole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solairen%2Fpihole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solairen%2Fpihole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solairen%2Fpihole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solairen%2Fpihole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solairen","download_url":"https://codeload.github.com/solairen/pihole/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solairen%2Fpihole/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29165089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T14:37:12.680Z","status":"ssl_error","status_checked_at":"2026-02-06T14:36:22.973Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","docker","pihole","raspberry-pi"],"created_at":"2026-02-06T14:45:10.201Z","updated_at":"2026-02-06T14:45:11.057Z","avatar_url":"https://github.com/solairen.png","language":"Shell","funding_links":["https://www.paypal.com/paypalme/solairen32"],"categories":[],"sub_categories":[],"readme":"### About:\nThis ansible script installs PiHole container or PiHole standalone on Ubuntu or Raspberry Pi in version 4 or 5.\u003cbr/\u003e\nAccording to [PiHole](https://github.com/pi-hole/docker-pi-hole) documentation, Ubuntu contains its DNS that will be disabled during the installation process.\u003cbr/\u003e\nThe last step of the installation process is to set DNS to PiHole (host) IP address.\n\n### Supported OS:\n* Ubuntu 20.04\n* Ubuntu 22.04\n* Raspberry Pi 4/5\n\n### Prerequisites\n* [Ansible](https://docs.ansible.com/ansible/latest/index.html)\n* [jmespath plugin](https://pypi.org/project/jmespath/)\n* [Azure blob](https://docs.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az_storage_blob_upload)\n* [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/)\n* [s3cmd](https://www.linode.com/docs/guides/how-to-use-object-storage/#s3cmd)\n* [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html)\n\n### Configuration\n\n#### Azure Blob Storage\n[Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) should be installed on the host where PiHole is installed and Azure Blob Storage should be created on Azure.\n\nIt is a possibility to upload backup to all cloud providers at one time, to do that those programs: **azure CLI**, **s3cmd**, **boto3** must be installed on the host where PiHole is installed.\n\n\u003e **_NOTE:_** S3CMD and boto3 are installed during installation process.\n\n#### Firewall\nOn host where PiHole will be installed, **UFW** should be enabled and a port that has been configured to ssh connection should be temporary added to the rule.\n\n#### Inventory.ini\nIn `inventory.ini`, set **IP**, **user**, **password**, **ssh port** or **ssh_key** on where PiHole should be installed.\u003c/br\u003e\nIf **ssh_key** is used, comment **password**.\u003c/br\u003e\nIf **password** is used, comment **ssh_key**.\u003c/br\u003e\n```ini\n[pihole]\n127.0.0.1\n\n[pihole:vars]\nansible_ssh_user=user\nansible_ssh_pass=password\nansible_ssh_private_key_file=\u003cpath_to_key\u003e\nansible_port=22\n```\n\n#### Group_vars/all/common.yml\nIn `group_vars/all/common.yml`, set:\n\n```txt\n_ph_version: latest               =\u003e PiHole version. Used only when PiHole is installed using Docker.\n_ph_restore_version:              =\u003e Set PiHole version to restore if installation failed during brownfield. Used only when PiHole is installed using Docker.\n_pihole_webpassword:              =\u003e Set PiHole Web password. Used only when PiHole is installed as standalone.\n_dns_server_1: 1.1.1.1            =\u003e Set PiHole DNS server. Used only when PiHole is installed as standalone.\n_dns_server_2: 1.0.0.1            =\u003e Set PiHole DNS server. Used only when PiHole is installed as standalone.\n_time_zone: Europe/Warsaw         =\u003e Set Time Zone.\n_docker_compose_version: 1.27.4   =\u003e Docker-compose version.\n_restore_from_backup:             =\u003e Restore PiHole from backup during greenfield installation.\n  azure: 0                        =\u003e Restore from Azure. 1 - yes, 0 - no.\n  linode: 0                       =\u003e Restore from Linode. 1 - yes, 0 - no.\n  aws: 0                          =\u003e Restore from AWS S3. 1 - yes, 0 - no.\n_azure_upload: 0                  =\u003e Upload to Azure Blob Storage. 1 - yes, 0 - no.\n_container_name: {containerName}  =\u003e Set Azure Blob Storage container name.\n_account_name: {accountName}      =\u003e Set Azure Blob Storage account name.\n_account_key: {accountKey}        =\u003e Set Azure Blob Storage account key.\n_linode_upload: 0                 =\u003e Upload to Linode Ojbect Storage. 1 - yes, 0 - no.\n_linode_bucket: {bucketName}      =\u003e Linode Object Storage name.\n_linode_access_key: {accessKey}   =\u003e Linode Object Storage access key.\n_linode_secret_key: {secretKey}   =\u003e Linode Object Storage secret key.\n_host: {regionName}               =\u003e Linode Object Storage region.\n_aws_upload: 0                    =\u003e Upload to AWS S3. 1 - yes, 0 - no.\n_aws_bucket: {bucketName}         =\u003e AWS S3 Bucket name.\n_aws_access_key: {accessKey}      =\u003e AWS access key.\n_aws_secret_key: {secretKey}      =\u003e AWS secret key.\n```\n\n#### Restore from backup\nTo restore from backup, set 1 in variable `azure`, `linode` or `aws` to choose from where the backup should be downloaded.\u003c/br\u003e\nIf `azure` is set, enter proper values to the `_container_name`, `_account_name` and `_account_key`.\u003c/br\u003e\nIf `linode` is set, enter proper values to the `_linode_bucket`.\u003c/br\u003e\nIf `aws` is set, enter proper values to the `_aws_bucket`, `_aws_access_key` and `_aws_secret_key`.\u003c/br\u003e\nSetting 1 into variables: `azure`, `linode` and `aws` at the same time will fail the process of installation.\n\n### How to run:\n\n```bash\nANSIBLE_CONFIG=ansible.cfg ansible-playbook -i inventory.ini install_pihole.yml -e deployment=greenfield/brownfield -e installation_type=standalone/docker --ask-become-pass -vv\n```\n\n### Additional information\nInside folder ``/scripts`` there is a script file ``change_variable.sh`` that will replace ``common.yml`` and ``inventory.ini`` files with proper values based on environment variables.\n\n#### How to run\n\nSet environment variables on host from where the ansible script will be run or inside the docker container ([moleszek/pihole:latest](https://hub.docker.com/r/moleszek/pihole)) e.g:\n\n```bash\nexport USER=testuser\nexport PASSWORD=testpassword\nexport AWSUPLOAD=1\nexport AWSBUCKET=testbucket\nexport AWSACCESSKEY=1234\nexport AWSSECRETKEY=56789\n```\n\nRun script:\n\n```bash\nsh scripts/change_variable.sh\n```\n\nOld ``common.yml`` and ``inventory.ini`` file will be replace with new one and with values that has been taken from environment variable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolairen%2Fpihole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolairen%2Fpihole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolairen%2Fpihole/lists"}