Skip to content

Commit 40f1a09

Browse files
committed
Remove unsupported puppet 5 code
Prior to this commit, there was a block of code checking for puppet 5, which we no longer support. This commit aims to clean up this unnecesary code in order to keep the module tidy.
1 parent 1c1562f commit 40f1a09

File tree

1 file changed

+18
-51
lines changed

1 file changed

+18
-51
lines changed

manifests/run.pp

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -429,59 +429,26 @@
429429
$exec_unless = $inspect
430430
}
431431

432-
if versioncmp($facts['puppetversion'], '6') < 0 {
433-
exec { "run ${title} with docker":
434-
command => join($run_with_docker_command, ' '),
435-
unless => $exec_unless,
436-
environment => $exec_environment,
437-
path => $exec_path,
438-
provider => $exec_provider,
439-
timeout => $exec_timeout,
440-
}
441-
442-
if $running == false {
443-
$running_stop_command = [$docker_command, 'stop', '--time', $stop_wait_time, $sanitised_title]
444-
exec { "stop ${title} with docker":
445-
command => $running_stop_command,
446-
onlyif => $container_running_check,
447-
environment => $exec_environment,
448-
path => $exec_path,
449-
provider => $exec_provider,
450-
timeout => $exec_timeout,
451-
}
452-
} else {
453-
$running_start_command = [$docker_command, 'start', $sanitised_title]
454-
exec { "start ${title} with docker":
455-
command => $running_start_command,
456-
unless => $container_running_check,
457-
environment => $exec_environment,
458-
path => $exec_path,
459-
provider => $exec_provider,
460-
timeout => $exec_timeout,
461-
}
462-
}
463-
} else {
464-
$docker_params_changed_args = {
465-
sanitised_title => $sanitised_title,
466-
osfamily => $facts['os']['family'],
467-
command => join($run_with_docker_command, ' '),
468-
cidfile => $cidfile,
469-
image => $image,
470-
volumes => $volumes,
471-
ports => $ports,
472-
stop_wait_time => $stop_wait_time,
473-
container_running => $running,
474-
# logfile_path => ($facts['os']['family'] == 'windows') ? {
475-
# true => ::docker_user_temp_path,
476-
# default => '/tmp',
477-
# },
478-
}
432+
$docker_params_changed_args = {
433+
sanitised_title => $sanitised_title,
434+
osfamily => $facts['os']['family'],
435+
command => join($run_with_docker_command, ' '),
436+
cidfile => $cidfile,
437+
image => $image,
438+
volumes => $volumes,
439+
ports => $ports,
440+
stop_wait_time => $stop_wait_time,
441+
container_running => $running,
442+
# logfile_path => ($facts['os']['family'] == 'windows') ? {
443+
# true => ::docker_user_temp_path,
444+
# default => '/tmp',
445+
# },
446+
}
479447

480-
$detect_changes = Deferred('docker_params_changed', [$docker_params_changed_args])
448+
$detect_changes = Deferred('docker_params_changed', [$docker_params_changed_args])
481449

482-
notify { "${title}_docker_params_changed":
483-
message => $detect_changes,
484-
}
450+
notify { "${title}_docker_params_changed":
451+
message => $detect_changes,
485452
}
486453
}
487454
} else {

0 commit comments

Comments
 (0)