Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125750
docker_compose.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
docker_compose.rb
View Options
# frozen_string_literal: true
Puppet
::
Type
.
newtype
(
:docker_compose
)
do
@doc
=
'A type representing a Docker Compose file'
ensurable
def
refresh
provider
.
restart
end
newparam
(
:scale
)
do
desc
'A hash of compose services and number of containers.'
validate
do
|
value
|
raise
_
(
'scale should be a Hash'
)
unless
value
.
is_a?
Hash
unless
value
.
all?
{
|
k
,
_v
|
k
.
is_a?
String
}
raise
_
(
'The name of the compose service in scale should be a String'
)
end
unless
value
.
all?
{
|
_k
,
v
|
v
.
is_a?
Integer
}
raise
_
(
'The number of containers in scale should be an Integer'
)
end
end
end
newparam
(
:options
)
do
desc
'Additional options to be passed directly to docker-compose.'
validate
do
|
value
|
raise
_
(
'options should be an Array'
)
unless
value
.
is_a?
Array
end
end
newparam
(
:up_args
)
do
desc
'Arguments to be passed directly to docker-compose up.'
validate
do
|
value
|
raise
_
(
'up_args should be a String'
)
unless
value
.
is_a?
String
end
end
newparam
(
:compose_files
,
array_matching
:
:all
)
do
desc
'An array of Docker Compose Files paths.'
validate
do
|
value
|
raise
_
(
'compose files should be an array'
)
unless
value
.
is_a?
Array
end
end
newparam
(
:name
)
do
isnamevar
desc
'The name of the project'
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 9:17 PM (4 w, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3404976
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment