Puppet Function: complyadm::runtime::version
- Defined in:
-
functions/runtime/version.pp
- Function type:
- Puppet Language
Overview
complyadm::runtime::version(TargetSpec $target, Complyadm::Runtime $runtime, Boolean $run_as_root = true) ⇒ ResultSet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'functions/runtime/version.pp', line 1
function complyadm::runtime::version(
TargetSpec $target,
Complyadm::Runtime $runtime,
Boolean $run_as_root = true,
) >> ResultSet {
$command = $runtime ? {
# Check for Docker in the output to ensure it is not the podman-docker shim
'docker' => 'docker version |grep --ignore-case docker',
# In case a docker-podman shim exists somewhere, doublecheck it is actually podman
'podman' => 'podman version |grep --ignore-case podman',
default => fail_plan("${runtime} is not yet implemented", 'comply/error')
}
if($run_as_root) {
return run_command($command, $target, '_run_as' => 'root', '_catch_errors' => 'true')
}
return run_command($command, $target, '_catch_errors' => 'true')
}
|