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
58ecd312
Unverified
Commit
58ecd312
authored
6 years ago
by
k8s-ci-robot
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3186 from mirwan/fix_etchosts_localhost_handling
Fix localhost handling when /etc/hosts contains parenthesis
parents
7efe287c
b395bb95
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
+2
-2
2 additions, 2 deletions
roles/kubernetes/preinstall/tasks/etchosts.yml
with
2 additions
and
2 deletions
roles/kubernetes/preinstall/tasks/etchosts.yml
+
2
−
2
View file @
58ecd312
...
...
@@ -30,12 +30,12 @@
-
name
:
Hosts | Extract existing entries for localhost from hosts file
set_fact
:
etc_hosts_localhosts_dict
:
>-
{%- set splitted = (item | regex_replace('[ ]+', ' ')|regex_replace('#.
+
$')|trim).split( ' ') -%}
{%- set splitted = (item | regex_replace('[
\t
]+', ' ')|regex_replace('#.
*
$')|trim).split( ' ') -%}
{{ etc_hosts_localhosts_dict|default({}) | combine({splitted[0]: splitted[1::] }) }}
with_items
:
"
{{
(etc_hosts_content['content']
|
b64decode).split('
\n
')
}}"
when
:
-
etc_hosts_content.content is defined
-
etc_hosts_localhost_entries.keys()|map('regex_replace', '(.*)', '^\\1 .*') | map('match', item) | list | length >
0
-
(item|match('^::1 .*') or item|match('^127.0.0.1 .*'))
-
name
:
Hosts | Update target hosts file entries dict with required entries
set_fact
:
...
...
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