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
9926395e
Commit
9926395e
authored
8 years ago
by
Bogdan Dobrelya
Browse files
Options
Downloads
Patches
Plain Diff
Distribute downloaded artifacts
Signed-off-by:
Bogdan Dobrelya
<
bdobrelia@mirantis.com
>
parent
42242890
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/download/tasks/main.yml
+30
-2
30 additions, 2 deletions
roles/download/tasks/main.yml
with
30 additions
and
2 deletions
roles/download/tasks/main.yml
+
30
−
2
View file @
9926395e
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
-
name
:
Create dest directories
-
name
:
Create dest directories
file
:
path={{local_release_dir}}/{{download.dest|dirname}} state=directory recurse=yes
file
:
path={{local_release_dir}}/{{download.dest|dirname}} state=directory recurse=yes
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
if
download_run_once|bool
else
omit
}}"
run_once
:
"
{{
download_run_once|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
-
name
:
Download items
-
name
:
Download items
...
@@ -23,6 +24,7 @@
...
@@ -23,6 +24,7 @@
retries
:
4
retries
:
4
delay
:
"
{{
20
|
random
+
3
}}"
delay
:
"
{{
20
|
random
+
3
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
if
download_run_once|bool
else
omit
}}"
run_once
:
"
{{
download_run_once|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
-
name
:
Extract archives
-
name
:
Extract archives
...
@@ -33,6 +35,7 @@
...
@@ -33,6 +35,7 @@
mode
:
"
{{
download.mode|default(omit)
}}"
mode
:
"
{{
download.mode|default(omit)
}}"
copy
:
no
copy
:
no
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
and
download.unarchive
is
defined
and
download.unarchive
==
True
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
and
download.unarchive
is
defined
and
download.unarchive
==
True
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
if
download_run_once|bool
else
omit
}}"
run_once
:
"
{{
download_run_once|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
-
name
:
Fix permissions
-
name
:
Fix permissions
...
@@ -42,6 +45,7 @@
...
@@ -42,6 +45,7 @@
owner
:
"
{{
download.owner|default(omit)
}}"
owner
:
"
{{
download.owner|default(omit)
}}"
mode
:
"
{{
download.mode|default(omit)
}}"
mode
:
"
{{
download.mode|default(omit)
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
and
(download.unarchive
is
not
defined
or
download.unarchive
==
False)
}}"
when
:
"
{{
download.enabled|bool
and
not
download.container|bool
and
(download.unarchive
is
not
defined
or
download.unarchive
==
False)
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
if
download_run_once|bool
else
omit
}}"
run_once
:
"
{{
download_run_once|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
-
name
:
pulling...
-
name
:
pulling...
...
@@ -49,10 +53,9 @@
...
@@ -49,10 +53,9 @@
msg
:
"
{{
download.repo
}}:{{
download.tag
}}"
msg
:
"
{{
download.repo
}}:{{
download.tag
}}"
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
-
name
:
Create dest directory for container images
to be saved
-
name
:
Create dest directory for
saved/loaded
container images
file
:
path="{{local_release_dir}}/containers" state=directory recurse=yes
file
:
path="{{local_release_dir}}/containers" state=directory recurse=yes
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
#NOTE(bogdando) this brings no docker-py deps for nodes
#NOTE(bogdando) this brings no docker-py deps for nodes
-
name
:
Download containers
-
name
:
Download containers
...
@@ -62,4 +65,29 @@
...
@@ -62,4 +65,29 @@
retries
:
4
retries
:
4
delay
:
"
{{
20
|
random
+
3
}}"
delay
:
"
{{
20
|
random
+
3
}}"
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
when
:
"
{{
download.enabled|bool
and
download.container|bool
}}"
delegate_to
:
"
{{
groups['kube-master'][0]
if
download_run_once|bool
else
omit
}}"
run_once
:
"
{{
download_run_once|bool
}}"
run_once
:
"
{{
download_run_once|bool
}}"
-
set_fact
:
fname
:
"
{{local_release_dir}}/containers/{{download.repo|regex_replace('/|
\0
|:',
'_')}}:{{download.tag|regex_replace('/|
\0
|:',
'_')}}.tar"
-
name
:
Download | save container images
shell
:
docker save "{{ download.repo }}:{{ download.tag }}" > "{{ fname }}"
delegate_to
:
"
{{groups['kube-master'][0]}}"
run_once
:
true
when
:
ansible_os_family != "CoreOS" and download_run_once|bool
-
name
:
Download | get container images
synchronize
:
src
:
"
{{
fname
}}"
dest
:
"
{{local_release_dir}}/containers"
mode
:
push
register
:
get_task
until
:
get_task|success
retries
:
4
delay
:
"
{{
20
|
random
+
3
}}"
when
:
ansible_os_family != "CoreOS" and inventory_hostname != groups['kube-master'][0] and download_run_once|bool
-
name
:
Download | load container images
shell
:
docker load < "{{ fname }}"
when
:
ansible_os_family != "CoreOS" and inventory_hostname != groups['kube-master'][0] and download_run_once|bool
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