Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
92f7aa79
Commit
92f7aa79
authored
Aug 18, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bad commit from #8095 and fix bad splitting on :'s in the image
Fixes #8095 Fixes #8658
parent
f4d649be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
library/cloud/docker
+17
-10
No files found.
library/cloud/docker
View file @
92f7aa79
...
...
@@ -197,6 +197,14 @@ options:
default: false
aliases: []
version_added: "1.8"
registry:
description:
- The remote registry URL to use for pulling images.
required: false
default: ''
aliases: []
version_added: "1.8"
author: Cove Schneider, Joshua Conner, Pavel Antonov
requirements: [ "docker-py >= 0.3.0", "docker >= 0.10.0" ]
'''
...
...
@@ -499,13 +507,6 @@ class DockerManager:
def
get_split_image_tag
(
self
,
image
):
if
'/'
in
image
:
image
=
image
.
split
(
'/'
)[
-
1
]
tag
=
None
if
image
.
find
(
':'
)
>
0
:
return
image
.
split
(
':'
)
else
:
return
image
,
tag
def
get_split_full_image_tag
(
self
,
image
):
tag
=
"latest"
if
image
.
find
(
':'
)
>
0
:
return
image
.
split
(
':'
)
...
...
@@ -611,8 +612,13 @@ class DockerManager:
try
:
containers
=
do_create
(
count
,
params
)
except
:
image
,
tag
=
self
.
get_split_full_image_tag
(
params
[
'image'
])
self
.
client
.
pull
(
image
,
tag
=
tag
)
image
,
tag
=
self
.
get_split_image_tag
(
params
[
'image'
])
if
self
.
module
.
params
.
get
(
'username'
):
self
.
client
.
login
(
self
.
module
.
params
.
get
(
'username'
),
password
=
self
.
module
.
params
.
get
(
'password'
),
email
=
self
.
module
.
params
.
get
(
'email'
),
registry
=
self
.
module
.
params
.
get
(
'registry'
))
self
.
client
.
pull
(
image
,
tag
=
tag
)
self
.
increment_counter
(
'pull'
)
containers
=
do_create
(
count
,
params
)
...
...
@@ -700,9 +706,10 @@ def main():
memory_swap
=
dict
(
default
=
0
),
docker_url
=
dict
(
default
=
'unix://var/run/docker.sock'
),
docker_api_version
=
dict
(
default
=
docker
.
client
.
DEFAULT_DOCKER_API_VERSION
),
user
=
dict
(
default
=
None
),
user
name
=
dict
(
default
=
None
),
password
=
dict
(),
email
=
dict
(),
registry
=
dict
(),
hostname
=
dict
(
default
=
None
),
env
=
dict
(
type
=
'dict'
),
dns
=
dict
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment