Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
b23b8aa3
Commit
b23b8aa3
authored
9 years ago
by
Smaine Kahlouch
Browse files
Options
Downloads
Patches
Plain Diff
dnsmasq with multi master arch
parent
3981b739
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/dnsmasq/tasks/main.yml
+7
-4
7 additions, 4 deletions
roles/dnsmasq/tasks/main.yml
roles/dnsmasq/templates/resolv.conf.j2
+4
-0
4 additions, 0 deletions
roles/dnsmasq/templates/resolv.conf.j2
with
11 additions
and
4 deletions
roles/dnsmasq/tasks/main.yml
+
7
−
4
View file @
b23b8aa3
...
...
@@ -21,16 +21,17 @@
apt
:
name
:
"
{{
item
}}"
state
:
present
update_cache
:
yes
with_items
:
-
dnsmasq
-
bind9utils
when
:
inventory_hostname in groups['kube-master']
[0]
when
:
inventory_hostname in groups['kube-master']
-
name
:
ensure dnsmasq.d directory exists
file
:
path
:
/etc/dnsmasq.d
state
:
directory
when
:
inventory_hostname in groups['kube-master']
[0]
when
:
inventory_hostname in groups['kube-master']
-
name
:
configure dnsmasq
template
:
...
...
@@ -39,14 +40,14 @@
mode
:
755
notify
:
-
restart dnsmasq
when
:
inventory_hostname in groups['kube-master']
[0]
when
:
inventory_hostname in groups['kube-master']
-
name
:
enable dnsmasq
service
:
name
:
dnsmasq
state
:
started
enabled
:
yes
when
:
inventory_hostname in groups['kube-master']
[0]
when
:
inventory_hostname in groups['kube-master']
-
name
:
update resolv.conf with new DNS setup
template
:
...
...
@@ -56,3 +57,5 @@
-
name
:
disable resolv.conf modification by dhclient
copy
:
src=dhclient_nodnsupdate dest=/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate mode=u+x
-
meta
:
flush_handlers
This diff is collapsed.
Click to expand it.
roles/dnsmasq/templates/resolv.conf.j2
+
4
−
0
View file @
b23b8aa3
; generated by ansible
search {{ [ 'default.svc.' + dns_domain, 'svc.' + dns_domain, dns_domain ] | join(' ') }}
{% if inventory_hostname in groups['kube-master'] %}
nameserver {{ ansible_default_ipv4.address }}
{% else %}
{% for host in groups['kube-master'] %}
nameserver {{ hostvars[host]['ansible_default_ipv4']['address'] }}
{% endfor %}
{% endif %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment