Skip to content

Commit 1560b10

Browse files
committed
fix data types usage
1 parent 9020545 commit 1560b10

File tree

12 files changed

+218
-219
lines changed

12 files changed

+218
-219
lines changed

manifests/compose.pp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
# Defaults to true
4343
#
4444
class docker::compose(
45-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
46-
Optional[String] $version = $docker::params::compose_version,
47-
Optional[String] $install_path = $docker::params::compose_install_path,
48-
Optional[String] $symlink_name = $docker::params::compose_symlink_name,
49-
Optional[String] $proxy = undef,
50-
Optional[String] $base_url = $docker::params::compose_base_url,
51-
Optional[String] $raw_url = undef,
52-
Optional[Boolean] $curl_ensure = $docker::params::curl_ensure,
45+
Optional[Enum[present,absent]] $ensure = 'present',
46+
Optional[String] $version = $docker::params::compose_version,
47+
Optional[String] $install_path = $docker::params::compose_install_path,
48+
Optional[String] $symlink_name = $docker::params::compose_symlink_name,
49+
Optional[String] $proxy = undef,
50+
Optional[String] $base_url = $docker::params::compose_base_url,
51+
Optional[String] $raw_url = undef,
52+
Optional[Boolean] $curl_ensure = $docker::params::curl_ensure,
5353
) inherits docker::params {
5454

5555
if $proxy != undef {

manifests/image.pp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
# If you want to load a docker image from specific docker tar
2525
#
2626
define docker::image(
27-
Optional[Pattern[/^(present|absent|latest)$/]] $ensure = 'present',
28-
Optional[Pattern[/^[\S]*$/]] $image = $title,
29-
Optional[String] $image_tag = undef,
30-
Optional[String] $image_digest = undef,
31-
Optional[Boolean] $force = false,
32-
Optional[String] $docker_file = undef,
33-
Optional[String] $docker_dir = undef,
34-
Optional[String] $docker_tar = undef,
27+
Optional[Enum[present,absent,latest]] $ensure = 'present',
28+
Optional[Pattern[/^[\S]*$/]] $image = $title,
29+
Optional[String] $image_tag = undef,
30+
Optional[String] $image_digest = undef,
31+
Optional[Boolean] $force = false,
32+
Optional[String] $docker_file = undef,
33+
Optional[String] $docker_dir = undef,
34+
Optional[String] $docker_tar = undef,
3535
) {
3636
include docker::params
3737
$docker_command = $docker::params::docker_command

manifests/init.pp

Lines changed: 117 additions & 117 deletions
Large diffs are not rendered by default.

manifests/install.pp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
# [*docker_ee_package_name*]
1919
# The name of the Docker Enterprise Edition package
2020
# Default: Docker
21-
22-
2321
class docker::install(
2422
$version = $docker::version,
2523
$nuget_package_provider_version = $docker::nuget_package_provider_version,
@@ -29,6 +27,7 @@
2927
$dependent_packages = $docker::dependent_packages,
3028
) {
3129
$docker_start_command = $docker::docker_start_command
30+
3231
if $::osfamily and !::docker::acknowledge_unsupported_os {
3332
assert_type(Pattern[/^(Debian|RedHat|windows)$/], $::osfamily) |$a, $b| {
3433
fail(translate('This module only works on Debian, RedHat or Windows.'))

manifests/machine.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
# [*url*]
2424
# The URL from which the docker machine binary should be fetched
2525
# Defaults to a auto determined value based on version, kernel and OS.
26-
#
26+
#
2727
# [*curl_ensure*]
2828
# Whether or not the curl package is ensured by this module.
2929
# Defaults to true
3030
class docker::machine(
31-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
31+
Optional[Enum[present,absent]] $ensure = 'present',
3232
Optional[String] $version = $docker::params::machine_version,
3333
Optional[String] $install_path = $docker::params::machine_install_path,
3434
Optional[String] $proxy = undef,

manifests/plugin.pp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@
4848
#
4949

5050
define docker::plugin(
51-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
52-
String $plugin_name = $title,
53-
Optional[Boolean] $enabled = true,
54-
Optional[String] $timeout = undef,
55-
Optional[String] $plugin_alias = undef,
56-
Optional[Boolean] $disable_on_install = false,
57-
Optional[Boolean] $disable_content_trust = true,
58-
Optional[Boolean] $grant_all_permissions = true,
59-
Optional[Boolean] $force_remove = true,
60-
Optional[Array] $settings = [],
51+
Optional[Enum[present,absent]] $ensure = 'present',
52+
String $plugin_name = $title,
53+
Optional[Boolean] $enabled = true,
54+
Optional[String] $timeout = undef,
55+
Optional[String] $plugin_alias = undef,
56+
Optional[Boolean] $disable_on_install = false,
57+
Optional[Boolean] $disable_content_trust = true,
58+
Optional[Boolean] $grant_all_permissions = true,
59+
Optional[Boolean] $force_remove = true,
60+
Optional[Array] $settings = [],
6161
) {
6262
include docker::params
6363

manifests/registry.pp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
# Required to be true for idempotency
3434
#
3535
define docker::registry(
36-
Optional[String] $server = $title,
37-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
38-
Optional[String] $username = undef,
39-
Optional[String] $password = undef,
40-
Optional[String] $pass_hash = undef,
41-
Optional[String] $email = undef,
42-
Optional[String] $local_user = 'root',
43-
Optional[String] $version = $docker::version,
44-
Optional[Boolean] $receipt = true,
36+
Optional[String] $server = $title,
37+
Optional[Enum[present,absent]] $ensure = 'present',
38+
Optional[String] $username = undef,
39+
Optional[String] $password = undef,
40+
Optional[String] $pass_hash = undef,
41+
Optional[String] $email = undef,
42+
Optional[String] $local_user = 'root',
43+
Optional[String] $version = $docker::version,
44+
Optional[Boolean] $receipt = true,
4545
) {
4646
include docker::params
4747

manifests/run.pp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
#
9595
define docker::run(
9696
Optional[Pattern[/^[\S]*$/]] $image,
97-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
97+
Optional[Enum[present,absent]] $ensure = 'present',
9898
Optional[String] $command = undef,
9999
Optional[Pattern[/^[\d]*(b|k|m|g)$/]] $memory_limit = '0b',
100100
Variant[String,Array,Undef] $cpuset = [],
@@ -105,15 +105,15 @@
105105
Variant[String,Array,Undef] $links = [],
106106
Optional[Boolean] $use_name = false,
107107
Optional[Boolean] $running = true,
108-
Variant[String,Array,Undef] $volumes_from = [],
108+
Optional[Variant[String,Array]] $volumes_from = [],
109109
Variant[String,Array] $net = 'bridge',
110110
Variant[String,Boolean] $username = false,
111111
Variant[String,Boolean] $hostname = false,
112-
Variant[String,Array,Undef] $env = [],
113-
Variant[String,Array,Undef] $env_file = [],
114-
Variant[String,Array,Undef] $dns = [],
115-
Variant[String,Array,Undef] $dns_search = [],
116-
Variant[String,Array,Undef] $lxc_conf = [],
112+
Optional[Variant[String,Array]] $env = [],
113+
Optional[Variant[String,Array]] $env_file = [],
114+
Optional[Variant[String,Array]] $dns = [],
115+
Optional[Variant[String,Array]] $dns_search = [],
116+
Optional[Variant[String,Array]] $lxc_conf = [],
117117
Optional[String] $service_prefix = 'docker-',
118118
Optional[String] $service_provider = undef,
119119
Optional[Boolean] $restart_service = true,
@@ -123,17 +123,17 @@
123123
Optional[Boolean] $disable_network = false,
124124
Optional[Boolean] $privileged = false,
125125
Optional[Boolean] $detach = undef,
126-
Variant[String,Array[String],Undef] $extra_parameters = undef,
126+
Optional[Variant[String,Array[String]]] $extra_parameters = undef,
127127
Optional[String] $systemd_restart = 'on-failure',
128-
Variant[String,Hash,Undef] $extra_systemd_parameters = {},
128+
Optional[Variant[String,Hash]] $extra_systemd_parameters = {},
129129
Optional[Boolean] $pull_on_start = false,
130-
Variant[String,Array,Undef] $after = [],
131-
Variant[String,Array,Undef] $after_service = [],
132-
Variant[String,Array,Undef] $depends = [],
133-
Variant[String,Array,Undef] $depend_services = ['docker.service'],
130+
Optional[Variant[String,Array]] $after = [],
131+
Optional[Variant[String,Array]] $after_service = [],
132+
Optional[Variant[String,Array]] $depends = [],
133+
Optional[Variant[String,Array]] $depend_services = ['docker.service'],
134134
Optional[Boolean] $tty = false,
135-
Variant[String,Array,Undef] $socket_connect = [],
136-
Variant[String,Array,Undef] $hostentries = [],
135+
Optional[Variant[String,Array]] $socket_connect = [],
136+
Optional[Variant[String,Array]] $hostentries = [],
137137
Optional[String] $restart = undef,
138138
Variant[String,Boolean] $before_start = false,
139139
Variant[String,Boolean] $before_stop = false,
@@ -150,7 +150,7 @@
150150
Optional[String] $health_check_cmd = undef,
151151
Optional[Boolean] $restart_on_unhealthy = false,
152152
Optional[Integer] $health_check_interval = undef,
153-
Variant[String,Array,Undef] $custom_unless = [],
153+
Optional[Variant[String,Array]] $custom_unless = [],
154154
Optional[String] $remain_after_exit = undef,
155155
) {
156156
include docker::params

manifests/secrets.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# == Define: docker::secrets
22
define docker::secrets (
3-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
4-
Variant[String,Array,Undef] $label = [],
5-
Optional[String] $secret_name = undef,
6-
Optional[String] $secret_path = undef,
3+
Optional[Enum[present,absent]] $ensure = 'present',
4+
Optional[Variant[String,Array]] $label = [],
5+
Optional[String] $secret_name = undef,
6+
Optional[String] $secret_path = undef,
77
) {
88
include docker::params
99

manifests/services.pp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,26 @@
8080
#
8181

8282
define docker::services(
83-
Optional[Pattern[/^present$|^absent$/]] $ensure = 'present',
84-
Optional[Boolean] $create = true,
85-
Optional[Boolean] $update = false,
86-
Optional[Boolean] $scale = false,
87-
Optional[Boolean] $detach = true,
88-
Optional[Boolean] $tty = false,
89-
Optional[Array] $env = [],
90-
Optional[Array] $label = [],
91-
Optional[Array] $extra_params = [],
92-
Variant[String,Array,Undef] $image = undef,
93-
Variant[String,Array,Undef] $service_name = undef,
94-
Variant[String,Array,Undef] $publish = undef,
95-
Variant[String,Array,Undef] $replicas = undef,
96-
Variant[String,Array,Undef] $user = undef,
97-
Variant[String,Array,Undef] $workdir = undef,
98-
Variant[String,Array,Undef] $host_socket = undef,
99-
Variant[String,Array,Undef] $registry_mirror = undef,
100-
Variant[String,Array,Undef] $mounts = undef,
101-
Variant[Array,Undef] $networks = undef,
102-
Variant[String,Array,Undef] $command = undef,
83+
Optional[Enum[present,absent]] $ensure = 'present',
84+
Optional[Boolean] $create = true,
85+
Optional[Boolean] $update = false,
86+
Optional[Boolean] $scale = false,
87+
Optional[Boolean] $detach = true,
88+
Optional[Boolean] $tty = false,
89+
Optional[Array] $env = [],
90+
Optional[Array] $label = [],
91+
Optional[Array] $extra_params = [],
92+
Optional[Variant[String,Array]] $image = undef,
93+
Optional[Variant[String,Array]] $service_name = undef,
94+
Optional[Variant[String,Array]] $publish = undef,
95+
Optional[Variant[String,Array]] $replicas = undef,
96+
Optional[Variant[String,Array]] $user = undef,
97+
Optional[Variant[String,Array]] $workdir = undef,
98+
Optional[Variant[String,Array]] $host_socket = undef,
99+
Optional[Variant[String,Array]] $registry_mirror = undef,
100+
Optional[Variant[String,Array]] $mounts = undef,
101+
Optional[Array] $networks = undef,
102+
Optional[Variant[String,Array]] $command = undef,
103103
){
104104

105105
include docker::params

0 commit comments

Comments
 (0)