Skip to content

Commit

Permalink
Merge branch 'main' of github.com:vegaaz/puppetlabs-docker into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaaz committed Mar 6, 2023
2 parents d0582b0 + 9d18e68 commit d83fb5b
Show file tree
Hide file tree
Showing 24 changed files with 129 additions and 150 deletions.
5 changes: 0 additions & 5 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
--relative
--no-parameter_types-check
--no-legacy_facts-check
--no-top_scope_facts-check
--no-parameter_documentation-check
--no-topscope_variable-check
7 changes: 0 additions & 7 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,3 @@ spec/spec_helper.rb:
unmanaged: false
.travis.yml:
delete: true
Rakefile:
extra_disabled_lint_checks:
- parameter_types
- legacy_facts
- top_scope_facts
- parameter_documentation
- topscope_variable
5 changes: 0 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ def changelog_future_release
end

PuppetLint.configuration.send('disable_relative')
PuppetLint.configuration.send('disable_parameter_types')
PuppetLint.configuration.send('disable_legacy_facts')
PuppetLint.configuration.send('disable_top_scope_facts')
PuppetLint.configuration.send('disable_parameter_documentation')
PuppetLint.configuration.send('disable_topscope_variable')


if Bundler.rubygems.find_name('github_changelog_generator').any?
Expand Down
2 changes: 1 addition & 1 deletion manifests/compose.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if $raw_url != undef {
$docker_compose_url = $raw_url
} else {
$docker_compose_url = "${base_url}/${version}/docker-compose-${::kernel}-${facts['os']['hardware']}${file_extension}"
$docker_compose_url = "${base_url}/${version}/docker-compose-${facts['kernel']}-${facts['os']['hardware']}${file_extension}"
}

if $proxy != undef {
Expand Down
4 changes: 2 additions & 2 deletions manifests/exec.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
$docker_command = $docker::params::docker_command

if $facts['os']['family'] == 'windows' {
$exec_environment = "PATH=${::docker_program_files_path}/Docker/"
$exec_environment = "PATH=${facts['docker_program_files_path']}/Docker/"
$exec_timeout = 3000
$exec_path = ["${::docker_program_files_path}/Docker/",]
$exec_path = ["${facts['docker_program_files_path']}/Docker/",]
$exec_provider = 'powershell'
} else {
$exec_environment = 'HOME=/root'
Expand Down
6 changes: 3 additions & 3 deletions manifests/image.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@

if $facts['os']['family'] == 'windows' {
$update_docker_image_template = 'docker/windows/update_docker_image.ps1.erb'
$update_docker_image_path = "${::docker_user_temp_path}/update_docker_image.ps1"
$exec_environment = "PATH=${::docker_program_files_path}/Docker/"
$update_docker_image_path = "${facts['docker_user_temp_path']}/update_docker_image.ps1"
$exec_environment = "PATH=${facts['docker_program_files_path']}/Docker/"
$exec_timeout = 3000
$update_docker_image_owner = undef
$exec_path = ["${::docker_program_files_path}/Docker/",]
$exec_path = ["${facts['docker_program_files_path']}/Docker/",]
$exec_provider = 'powershell'
} else {
$update_docker_image_template = 'docker/update_docker_image.sh.erb'
Expand Down
2 changes: 1 addition & 1 deletion manifests/images.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param images
#
class docker::images (
$images
Hash $images
) {
create_resources(docker::image, $images)
}
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@
# @param keyring
# Absolute path to a file containing the PGP keyring used to sign this repository. Value is used to set signed-by on the source entry.
# See https://wiki.debian.org/DebianRepository/UseThirdParty for details.
# @param have_systemd_v230
#
class docker (
Optional[String] $version = $docker::params::version,
Expand Down
12 changes: 6 additions & 6 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
# @param dependent_packages
#
class docker::install (
$version = $docker::version,
$nuget_package_provider_version = $docker::nuget_package_provider_version,
$docker_msft_provider_version = $docker::docker_msft_provider_version,
$docker_ee_package_name = $docker::docker_ee_package_name,
$docker_download_url = $docker::package_location,
$dependent_packages = $docker::dependent_packages,
Optional[String] $version = $docker::version,
Optional[String] $nuget_package_provider_version = $docker::nuget_package_provider_version,
Optional[String] $docker_msft_provider_version = $docker::docker_msft_provider_version,
Optional[String] $docker_ee_package_name = $docker::docker_ee_package_name,
Optional[String] $docker_download_url = $docker::package_location,
Array $dependent_packages = $docker::dependent_packages,
) {
$docker_start_command = $docker::docker_start_command

Expand Down
2 changes: 1 addition & 1 deletion manifests/machine.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

if $ensure == 'present' {
$docker_machine_url = $url ? {
undef => "https://github.com/docker/machine/releases/download/v${version}/docker-machine-${::kernel}-x86_64${file_extension}",
undef => "https://github.com/docker/machine/releases/download/v${version}/docker-machine-${facts['kernel']}-x86_64${file_extension}",
default => $url,
}

Expand Down
12 changes: 6 additions & 6 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@
$docker_command = 'docker'

if ($facts['os']['family'] == 'windows') {
$compose_install_path = "${::docker_program_files_path}/Docker"
$compose_install_path = "${facts['docker_program_files_path']}/Docker"
$compose_version = '1.29.2'
$docker_ee_package_name = 'Docker'
$machine_install_path = "${::docker_program_files_path}/Docker"
$tls_cacert = "${::docker_program_data_path}/docker/certs.d/ca.pem"
$tls_cert = "${::docker_program_data_path}/docker/certs.d/server-cert.pem"
$tls_key = "${::docker_program_data_path}/docker/certs.d/server-key.pem"
$machine_install_path = "${facts['docker_program_files_path']}/Docker"
$tls_cacert = "${facts['docker_program_data_path']}/docker/certs.d/ca.pem"
$tls_cert = "${facts['docker_program_data_path']}/docker/certs.d/server-cert.pem"
$tls_key = "${facts['docker_program_data_path']}/docker/certs.d/server-key.pem"
} else {
$compose_install_path = '/usr/local/bin'
$compose_version = '1.29.2'
Expand Down Expand Up @@ -244,7 +244,7 @@
$msft_provider_version = $docker_msft_provider_version
$msft_package_version = $version
$service_config_template = 'docker/windows/config/daemon.json.erb'
$service_config = "${::docker_program_data_path}/docker/config/daemon.json"
$service_config = "${facts['docker_program_data_path']}/docker/config/daemon.json"
$docker_group = 'docker'
$package_ce_source_location = undef
$package_ce_key_source = undef
Expand Down
5 changes: 0 additions & 5 deletions manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
# Note that the default behaviour of docker plugin
# requires a plugin be disabled before it can be removed
#
# @param plugin_name
# The name of the docker plugin
#
# @param enabled
# A setting to enable or disable an installed plugin.
#
Expand All @@ -35,8 +32,6 @@
#
# @param ensure
#
# @param grant_all_permissions
#
define docker::plugin (
Enum[present,absent] $ensure = 'present',
String $plugin_name = $title,
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugins.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param plugins
#
class docker::plugins (
$plugins
Hash $plugins
) {
create_resources(docker::plugin, $plugins)
}
6 changes: 3 additions & 3 deletions manifests/registry.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
$docker_command = $docker::params::docker_command

if $facts['os']['family'] == 'windows' {
$exec_environment = ["PATH=${::docker_program_files_path}/Docker/",]
$exec_environment = ["PATH=${facts['docker_program_files_path']}/Docker/",]
$exec_timeout = 3000
$exec_path = ["${::docker_program_files_path}/Docker/",]
$exec_path = ["${facts['docker_program_files_path']}/Docker/",]
$exec_provider = 'powershell'
$password_env = '$env:password'
$exec_user = undef
Expand Down Expand Up @@ -124,7 +124,7 @@
} else {
# server may be an URI, which can contain /
$server_strip = regsubst($server, '[/:]', '_', 'G')
$passfile = "${::docker_user_temp_path}/registry-auth-puppet_receipt_${server_strip}_${local_user}"
$passfile = "${facts['docker_user_temp_path']}/registry-auth-puppet_receipt_${server_strip}_${local_user}"
$_auth_command = "if (-not (${auth_cmd})) { Remove-Item -Path ${passfile} -Force -Recurse -EA SilentlyContinue; exit 1 } else { exit 0 }" # lint:ignore:140chars

if $ensure == 'absent' {
Expand Down
2 changes: 1 addition & 1 deletion manifests/registry_auth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param registries
#
class docker::registry_auth (
$registries
Hash $registries
) {
create_resources(docker::registry, $registries)
}
12 changes: 6 additions & 6 deletions manifests/repos.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
# Whether or not the gpg package is ensured by this module.
#
class docker::repos (
$location = $docker::package_location,
$key_source = $docker::package_key_source,
$key_check_source = $docker::package_key_check_source,
$architecture = $facts['os']['architecture'],
$keyring = $docker::keyring,
$gpg_ensure = $docker::params::gpg_ensure,
Optional[String] $location = $docker::package_location,
Optional[String] $key_source = $docker::package_key_source,
Optional[Boolean] $key_check_source = $docker::package_key_check_source,
String $architecture = $facts['os']['architecture'],
Stdlib::Absolutepath $keyring = $docker::keyring,
Boolean $gpg_ensure = $docker::params::gpg_ensure,
) {
ensure_packages($docker::prerequired_packages)

Expand Down
8 changes: 4 additions & 4 deletions manifests/run.pp
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@
}

if $facts['os']['family'] == 'windows' {
$exec_environment = "PATH=${::docker_program_files_path}/Docker/;${::docker_systemroot}/System32/"
$exec_environment = "PATH=${facts['docker_program_files_path']}/Docker/;${facts['docker_systemroot']}/System32/"
$exec_timeout = 3000
$exec_path = ["${::docker_program_files_path}/Docker/"]
$exec_path = ["${facts['docker_program_files_path']}/Docker/"]
$exec_provider = 'powershell'
$cidfile = "${::docker_user_temp_path}/${service_prefix}${sanitised_title}.cid"
$cidfile = "${facts['docker_user_temp_path']}/${service_prefix}${sanitised_title}.cid"
$restart_check = "${docker_command} inspect ${sanitised_title} -f '{{ if eq \\\"unhealthy\\\" .State.Health.Status }} {{ .Name }}{{ end }}' | findstr ${sanitised_title}" # lint:ignore:140chars
$container_running_check = "\$state = ${docker_command} inspect ${sanitised_title} -f \"{{ .State.Running }}\"; if (\$state -ieq \"true\") { Exit 0 } else { Exit 1 }" # lint:ignore:140chars
} else {
Expand Down Expand Up @@ -505,7 +505,7 @@
fail('Restart parameter is required for Windows')
}

$hasstatus = $::docker::params::service_hasstatus
$hasstatus = $docker::params::service_hasstatus
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/run_instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param instance
#
class docker::run_instance (
$instance
Hash $instance
) {
create_resources(docker::run, $instance)
}
Loading

0 comments on commit d83fb5b

Please sign in to comment.