jimeh.adguardhome

Ansible Role: AdGuard Home

GitHub Workflow Status GitHub Ansible Galaxy Ansible Quality Score

This Ansible role installs AdGuard Home, a DNS server that protects your privacy and blocks ads.

Requirements

  • Ansible version 2.9 or later (it may work with earlier versions).

Supported Operating Systems

This role has been tested on:

  • Ubuntu 16.04 and 18.04
  • Debian Stretch and Buster
  • EL7 and EL8 based distributions

It should work on other versions of Debian and RHEL derived systems as well.

Role Variables

You can configure the following variables in defaults/main.yml:

# Version of AdGuard Home to install. Use "latest" to get the most recent version.
adguardhome_version: "latest"

# Set to true to use a GitHub token for getting the latest version. Required if facing rate limit errors.
adguardhome_use_github_token: false

# The user who will run AdGuard Home. Initially, it must be "root" if there’s no existing config file.
adguardhome_user: root
adguardhome_group: "{{ adguardhome_user }}"

# Specify if the user should be a system user or not.
adguardhome_system_user: true

# Default directories for AdGuard Home.
adguardhome_bin_dir: "/opt/{{ adguardhome_service_name }}/bin"
adguardhome_config_dir: "/opt/{{ adguardhome_service_name }}/config"
adguardhome_config_name: AdGuardHome.yml
adguardhome_data_dir: "/opt/{{ adguardhome_service_name }}"
adguardhome_tmp_dir: /tmp

# Should the systemd service for AdGuard Home be enabled and started?
adguardhome_service_name: "adguardhome"
adguardhome_service_enable: true
adguardhome_service_start: true

# Disable DNSStubResolver if systemd-resolved is active.
adguardhome_disable_systemd_dnsstubresolver: true

Example Playbook

To install the latest version of AdGuard Home, use the following playbook:

- hosts: all
  roles:
    - { role: jimeh.adguardhome }

If you don't have a configuration file already, AdGuard Home will start with a setup wizard on port 3000. After completing the setup, the admin interface will be available on ports 80 and 443.

Non-root User

You can run AdGuard Home as a non-root user once you have a configuration file. Without it, AdGuard Home won’t start unless run as root.

If you don’t have a config file from another AdGuard Home installation, follow these steps:

  1. Run the role with adguardhome_user set to root.
  2. Complete the setup wizard on port 3000.
  3. Run the role again with adguardhome_user set to a non-root user. If the user doesn’t exist, it will be created.

I personally run AdGuard Home under a user named adguard.

License

This project is licensed under the MIT License.

Author Information

Jim Myhrberg

Informazioni sul progetto

Install AdGuard Home

Installa
ansible-galaxy install jimeh.adguardhome
Licenza
mit
Download
255
Proprietario
I'm a software engineering mercenary, who plays with code, video games, and on occasion, design.