Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is ubuntu supported? #17

Open
caleb15 opened this issue Jul 27, 2020 · 1 comment
Open

Is ubuntu supported? #17

caleb15 opened this issue Jul 27, 2020 · 1 comment

Comments

@caleb15
Copy link

caleb15 commented Jul 27, 2020

The readme does not mention ubuntu being supported but the ansible tasks are OS-generic so theoretically ubuntu should work fine. Is there some reason ubuntu doesn't work with this playbook?

@ITChristos
Copy link

I've used the role with Ubuntu 20.04 with some modification. The problem I ran into was that systemd-resolved.service was bound to port 53 natively so when you run this role against an Ubuntu machine you will run into the error that dnsmasq failed to start. Since there is already a DNS server service running on Ubuntu you will have to make the choice to use it or dnsmasq. I was made to use it for an assignment so created my own playbook and also used bertvv's role. Both worked well but bertvv automates a lot of the configuration files nicely so it was very useful.

Some background on my environment:
This applies to Ubuntu 20.04 running on Azure. Azure has it's own DNS intricacies since they handle DNS on their own management plane and you have to work within those constraints. https://docs.microsoft.com/en-us/azure/virtual-machines/linux/azure-dns#name-resolution-using-your-own-dns-server for further reading on that.

The modification I made was to the ~/.ansible/roles/ansible-dnsmasq/tasks/main.yml file. (Where I cloned the ansible-dnsmasq role so that Ansible finds it.)

In the playbook you'll add 3 tasks:

One to make sure that systemd-resolved.service is running before the install of dnsmasq. If not you may get an error that the resolve-file "resolv.conf" is not found.

Then, after dnsmasq is installed by the bertvv version of the playbook you are going to stop the sytemd-resolved.service.

Finally, you are going to restart the dnsmasq service. bertvv provided a task to make sure the service is started and I simply modified it to restart so that it picks up the configuration changes and rewrites the DNS configuration files accordingly.

main.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants