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
0ff883af
Unverified
Commit
0ff883af
authored
2 years ago
by
R. P. Taylor
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
streamline ansible_default_ipv4 gathering loop (#9281)
parent
0d5bcd3e
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/kubespray-defaults/tasks/fallback_ips.yml
+8
-6
8 additions, 6 deletions
roles/kubespray-defaults/tasks/fallback_ips.yml
roles/kubespray-defaults/tasks/fallback_ips_gather.yml
+0
-11
0 additions, 11 deletions
roles/kubespray-defaults/tasks/fallback_ips_gather.yml
with
8 additions
and
17 deletions
roles/kubespray-defaults/tasks/fallback_ips.yml
+
8
−
6
View file @
0ff883af
...
...
@@ -4,13 +4,15 @@
# Thanks https://medium.com/opsops/ansible-default-ipv4-is-not-what-you-think-edb8ab154b10
-
name
:
Gather ansible_default_ipv4 from all hosts
tags
:
always
include_tasks
:
fallback_ips_gather.yml
when
:
hostvars[delegate_host_to_gather_facts].ansible_default_ipv4 is not defined
loop
:
"
{{
groups['k8s_cluster']|default([])
+
groups['etcd']|default([])
+
groups['calico_rr']|default([])
}}"
loop_control
:
loop_var
:
delegate_host_to_gather_facts
setup
:
gather_subset
:
'
!all,network'
filter
:
"
ansible_default_ipv4"
delegate_to
:
"
{{
item
}}"
delegate_facts
:
yes
when
:
hostvars[item].ansible_default_ipv4 is not defined
loop
:
"
{{
(groups['k8s_cluster']|default([])
+
groups['etcd']|default([])
+
groups['calico_rr']|default([]))
|
unique
}}"
run_once
:
yes
tags
:
always
-
name
:
create fallback_ips_base
set_fact
:
...
...
This diff is collapsed.
Click to expand it.
roles/kubespray-defaults/tasks/fallback_ips_gather.yml
deleted
100644 → 0
+
0
−
11
View file @
0d5bcd3e
---
# include to workaround mitogen issue
# https://github.com/dw/mitogen/issues/663
-
name
:
"
Gather
ansible_default_ipv4
from
{{
delegate_host_to_gather_facts
}}"
setup
:
gather_subset
:
'
!all,network'
filter
:
"
ansible_default_ipv4"
delegate_to
:
"
{{
delegate_host_to_gather_facts
}}"
connection
:
"
{{
(delegate_host_to_gather_facts
==
'localhost')
|
ternary('local',
omit)
}}"
delegate_facts
:
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