diff --git a/defaults/main.yml b/defaults/main.yml index c52c6f7..f55a6ca 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -50,6 +50,7 @@ droneci_autoscaler_agent_architecture: amd64 droneci_autoscaler_agent_distro: ubuntu droneci_autoscaler_agent_volumes: [] droneci_autoscaler_agent_package_upgrade: False +droneci_autoscaler_agent_resolved_dns: [] # @var droneci_autoscaler_agent_packages:description: > # Install extra required packages during agents bootstrapping. diff --git a/templates/services/userdata.yml.j2 b/templates/services/userdata.yml.j2 index a6b75fb..cdd0e68 100644 --- a/templates/services/userdata.yml.j2 +++ b/templates/services/userdata.yml.j2 @@ -74,3 +74,10 @@ write_files: - path: /etc/docker/server-key.pem encoding: b64 content: {% raw %}{{ .TLSKey | base64 }}{% endraw %} + {% if droneci_autoscaler_agent_resolved_dns | length > 0 %} + + - path: /etc/systemd/resolved.conf + content: | + [Resolve] + DNS={{ droneci_autoscaler_resolved_dns | join(" ") }} + {% endif %}