Ansible playbook for adding mDNS to your Untangle box
Sourced from the manual instructions in this post from this thread.
There is some discussion of my repository here.
What this playbook does:
- Installs avahi-daemon with dependencies
- Configures /etc/avahi/avahi-daemon.conf
- Installs libnss-mdns for hostname resolution
- Installs avahi-utils to let you use
avahi-browsefor troubleshooting - Variables in
untangle-mdns.ymlallow you to specify which interfaces can broadcast Bonjour as Ansible variables
Outcome of playbook:
- So far, I have tested this by having my iPhone and my AppleTV on different vlans/subnets, routed through the Untangle box. I can use AirPlay to send the signal from my iPhone to the AppleTV.
Important: You must also allow port 5353 on protocol UDP between the subnets used by the interfaces you specified in the playbook. This information is located on this page.
Enable SSH in Untangle by following instructions here.
First, you'll want to prepare your SSH keys.
Create a key if you don't have one already.
ssh-keygen -t rsa -b 4096 -N '' -f ~/.ssh/id_rsa
Add your Untangle hostname to your SSH config.
cat >> ~/.ssh/config<< EOF
Host untangle
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
IdentitiesOnly yes
ConnectTimeout 0
ServerAliveInterval 30
IdentityFile ~/.ssh/id_rsa
EOFSet up the destination for remote authentication.
ssh-copy-id -i ~/.ssh/id_rsa.pub root@untangle
Install homebrew and then run brew install ansible
sudo zypper in python39
sudo pip3 install setuptools-rust wheel
sudo pip3 install --upgrade pip
sudo python3.9 -m pip install ansible
ansible --version
sudo dnf -y install python39
sudo pip3 install setuptools-rust wheel
sudo pip3 install --upgrade pip
sudo python3.9 -m pip install ansible
ansible --version
Update untangle-mdns.yml with your own variable values.
ansible-playbook untangle-mdns.yml -i hosts
Get Ansible facts for hosts: ansible all -i hosts -m setup > facts.json
Get a list of services and hosts on the network: avahi-browse -art | less
Get a list of all service names known to avahi-daemon: avahi-browse --dump-db
Display service types of services discovered on the network: avahi-browse -kat
Distributed under the MIT License. See LICENSE for more information.