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
a2f8f172
Commit
a2f8f172
authored
8 years ago
by
Antoine Legrand
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #757 from kubernetes-incubator/issue754
Add dns_domain for each host to /etc/hosts
parents
0e2329b5
68ad4ff4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/kubernetes/preinstall/tasks/etchosts.yml
+1
-2
1 addition, 2 deletions
roles/kubernetes/preinstall/tasks/etchosts.yml
with
1 addition
and
2 deletions
roles/kubernetes/preinstall/tasks/etchosts.yml
+
1
−
2
View file @
a2f8f172
...
@@ -3,8 +3,7 @@
...
@@ -3,8 +3,7 @@
blockinfile
:
blockinfile
:
dest
:
/etc/hosts
dest
:
/etc/hosts
block
:
|-
block
:
|-
{% for item in groups['all'] -%}
{% for item in groups['all'] -%}{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }}{% endif %} {{ item }} {{ item }}.{{ dns_domain }}
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}{% endif %} {{ item }}
{% endfor %}
{% endfor %}
state
:
present
state
:
present
create
:
yes
create
:
yes
...
...
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