Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCKER_STORAGE_OPTIONS under CentOS 7 #518

Closed
linotelerainfo opened this issue Aug 9, 2019 · 5 comments
Closed

DOCKER_STORAGE_OPTIONS under CentOS 7 #518

linotelerainfo opened this issue Aug 9, 2019 · 5 comments
Assignees

Comments

@linotelerainfo
Copy link

Describe the Bug

During every agent run, according to template definition, the file /etc/sysconfig/docker-storage is modified introducing some modifications. After service refresh, the file is modified back eliminating comment and white spaces.
During the next agent run the file is being modified again, establishing a loop of configuration change and service restart.

Steps to Reproduce

Steps to reproduce the behavior:

  1. using hiera simply define docker::storage_driver: 'overlay2'
  2. puppet run

Notice: /Stage[main]/Docker::Service/File[/etc/sysconfig/docker-storage]/content:
--- /etc/sysconfig/docker-storage 2019-08-09 11:19:36.522292463 +0200
+++ /tmp/puppet-file20190809-6870-1uzkg1e 2019-08-09 11:24:50.431992585 +0200
@@ -1 +1,17 @@
-DOCKER_STORAGE_OPTIONS="--storage-driver overlay2 "
+# This file is managed by Puppet and local changes
+# may be overwritten
+
+# This file may be automatically generated by an installation program.
+
+# By default, Docker uses a loopback-mounted sparse file in
+# /var/lib/docker. The loopback makes it slower, and there are some
+# restrictive defaults, such as 100GB max storage.
+
+# If your installation did not set a custom storage for Docker, you
+# may do it below.
+
+# Example: Use a custom pair of raw logical volumes (one for metadata,
+# one for data).
+# DOCKER_STORAGE_OPTIONS = --storage-opt dm.metadatadev=/dev/mylogvol/my-docker-metadata --storage-opt dm.datadev=/dev/mylogvol/my-docker-data
+
+DOCKER_STORAGE_OPTIONS=" --storage-driver overlay2"

Info: Computing checksum on file /etc/sysconfig/docker-storage
Info: /Stage[main]/Docker::Service/File[/etc/sysconfig/docker-storage]: Filebucketed /etc/sysconfig/docker-storage to puppet with sum b207e5a55244479f4a7cc4ac361e1daf
Notice: /Stage[main]/Docker::Service/File[/etc/sysconfig/docker-storage]/content: content changed '{md5}b207e5a55244479f4a7cc4ac361e1daf' to '{md5}a4e00a01b4e7a8011c4d9b7375f6a50d'
Info: /Stage[main]/Docker::Service/File[/etc/sysconfig/docker-storage]: Scheduling refresh of Service[docker]
Notice: /Stage[main]/Docker::Service/Service[docker]: Triggered 'refresh' from 1 event

Environment

  • Platform CentOS 6.7
@iglov
Copy link

iglov commented Aug 20, 2019

In head you wrote "CentOS 7" but environment is "CentOS 6.7" - is this ok?

@linotelerainfo
Copy link
Author

My mistake... The correct environment is CentOS 7.5

@timelordx
Copy link

The module is trying to manage both, /etc/sysconfig/docker-storage AND /etc/sysconfig/docker-storage-setup, and they end up fighting each other.

@timelordx
Copy link

To clarify my comment above, the default docker.service that comes with Docker rpm from CentOS7 Extras has this:

Wants=docker-storage-setup.service

which calls container-storage-setup which reads /etc/sysconfig/docker-storage-setup and creates /etc/sysconfig/docker-storage.

The module, however, manages both files, so Puppet module fights container-storage-setup, causing Puppet module restarting the docker service every time it runs.

@carabasdaniel carabasdaniel self-assigned this Jan 18, 2021
@carabasdaniel
Copy link
Contributor

Closing this issue as this issue only happens with older docker versions (ex. 1.13) on EL7 based OSes.
The issue is not reproducible with recent docker versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants