From 9865399f16af88b6037b98d1c3e2d6b84ecd0026 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 2 Mar 2021 14:34:38 +0200 Subject: [PATCH 1/2] Disable forced docker service restart for RedHat 7 and docker server 1.13 --- manifests/service.pp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/manifests/service.pp b/manifests/service.pp index 0cee85c1..fc5b9fc3 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -356,12 +356,25 @@ default: {} } + #workaround for docker 1.13 on RedHat 7 + if $facts['docker_server_version']{ + if $facts['os']['family'] == 'RedHat' and $facts['docker_server_version'] =~ /1\.13.+/{ + $_skip_storage_config = true + } else { + $_skip_storage_config = false + } + } else { + $_skip_storage_config = false + } + if $storage_config { - file { $storage_config: - ensure => file, - force => true, - content => template($storage_config_template), - notify => $_manage_service, + unless $_skip_storage_config { + file { $storage_config: + ensure => file, + force => true, #force rewrite storage configuration + content => template($storage_config_template), + notify => $_manage_service, + } } } From 784ba18bbc865f4146c7845d76933e7f9ed003a3 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Thu, 4 Mar 2021 09:55:39 +0200 Subject: [PATCH 2/2] Update README Limitations for RedHat 7 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f5d2c333..861ebf64 100644 --- a/README.md +++ b/README.md @@ -1010,12 +1010,14 @@ This module supports: * Debian 8.0 * Debian 9.0 * Debian 10 -* RedHat 7.0 +* RedHat 7.0 - limited support available * Ubuntu 14.04 * Ubuntu 16.04 * Ubuntu 18.04 * Windows Server 2016 (Docker Enterprise Edition only) +On RedHat 7 the default docker package installs docker server version 1.13.1. The default docker.service uses the docker-storage-service in this version and creates /etc/sysconfig/docker-storage based on the container-storage-setup configuration and /etc/sysconfig/docker-storage-setup file. As the puppetlabs-docker module manages both the docker-storage and docker-storage-setup files it causes a conflict with the container-storage-setup forcing a docker service restart, therefore a workaround was included in the service manifest that disables the service restart on storage configuration changes for this version of docker on RedHat 7. As a side effect of these changes, storage configuration changes with this docker version on RedHat 7 are not picked up by default by the docker.service. + ## Development If you would like to contribute to this module, see the guidelines in [CONTRIBUTING.MD](https://github.com/puppetlabs/puppetlabs-docker/blob/main/CONTRIBUTING.md).