Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125436
registry.pp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
registry.pp
View Options
# == Class: docker
#
# Module to configure private docker registries from which to pull Docker images
# If the registry does not require authentication, this module is not required.
#
# === Parameters
# [*server*]
# The hostname and port of the private Docker registry. Ex: dockerreg:5000
#
# [*ensure*]
# Whether or not you want to login or logout of a repository
#
# [*username*]
# Username for authentication to private Docker registry.
# auth is not required.
#
# [*password*]
# Password for authentication to private Docker registry. Leave undef if
# auth is not required.
#
# [*email*]
# Email for registration to private Docker registry. Leave undef if
# auth is not required.
#
# [*local_user*]
# The local user to log in as. Docker will store credentials in this
# users home directory
#
#
define
docker
::
registry
(
$server
=
$title,
$ensure
=
'present'
,
$username
=
undef
,
$password
=
undef
,
$email
=
undef
,
$local_user
=
'root'
,
)
{
include
docker
::
params
validate_re
(
$ensure,
'^(present|absent)$'
)
$docker_command
=
$docker::params::docker_command
if
$ensure
==
'present'
{
if
$username
!=
undef
and
$password
!=
undef
and
$email
!=
undef
{
$auth_cmd
=
"${docker_command} login -u '${username}' -p \"
\
${password}\"
-
e
'${email}'
${server}"
$auth_environment
=
"password=${password}"
}
elsif
$username
!=
undef
and
$password
!=
undef
{
$auth_cmd
=
"${docker_command} login -u '${username}' -p \"
\
${password}\"
${server}"
$auth_environment
=
"password=${password}"
}
else
{
$auth_cmd
=
"${docker_command} login ${server}"
$auth_environment
=
undef
}
}
else
{
$auth_cmd
=
"${docker_command} logout ${server}"
$auth_environment
=
undef
}
exec
{
"${title} auth"
:
environment
=>
$auth_environment,
command
=>
$auth_cmd,
user
=>
$local_user,
cwd
=>
'/root'
,
path
=>
[
'/bin'
,
'/usr/bin'
],
timeout
=>
0
,
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 21, 8:47 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3288288
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment