Skip to content

Add Suse support using the Suse provided packages - #1081

Open
mattmallard wants to merge 13 commits into
puppetlabs:mainfrom
mattmallard:suse-support
Open

mattmallard wants to merge 13 commits into
puppetlabs:mainfrom
mattmallard:suse-support

Conversation

@mattmallard

@mattmallard mattmallard commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

Add Suse Support to Docker Module

  • Add SLES 15 and 16 to supported platforms and allow SUSE through the core install, service, and package flows.
  • Use SUSE’s native docker and docker-compose packages from enabled OS repositories; default upstream package-source management to false on SUSE.
  • Manage /etc/sysconfig/docker using a new template that renders daemon settings into DOCKER_OPTS.
  • Add SUSE package, service, removal, version-pin, and Compose coverage; update the README.

Additional Context

I tried to be consistent with the existing platforms as much as possible, but there is no upstream distribution for Suse - just what is in the suse repos, so that is the only supported way to install docker-ce on suse and through this module.

Related Issues (if any)

none

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@mattmallard
mattmallard requested a review from a team as a code owner October 13, 2026 09:24
@CLAassistant

CLAassistant commented Oct 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@jst-cyr

jst-cyr commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you for the PR, @mattmallard ! I've authorized the basic CI to run (no acceptance tests) and it looks good. Puppet Core 9 failed, but that's an infra issue (need to run that on a branch, not a fork).

The CLA assistant seems to be reporting that you haven't signed the contributor license agreement yet. Would you be able to complete that before we move further with the PR?

@mattmallard

Copy link
Copy Markdown
Author

Thanks @jst-cyr , I have completed the CLA now.

@jst-cyr

jst-cyr commented Oct 19, 2026

Copy link
Copy Markdown
Member

Running CI tests for this PR here: #1083

@jst-cyr

jst-cyr commented Oct 19, 2026

Copy link
Copy Markdown
Member

Thank you for doing that @mattmallard ! I'll kick off the acceptance tests and we'll see how those do.

@jst-cyr

jst-cyr commented Oct 20, 2026

Copy link
Copy Markdown
Member

Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-docker/actions/runs/39327274334?pr=1083

Failures on CentOS 8 and Debian 11. Both failures match to what is seen with nightly tests against main, so not introduced by this PR.

However, there are no results for Suse. This PR is specifically about SUSE support and would require acceptance testing against SUSE. The tests reported this error: openSUSE-15 no provisioner found

The matrix attempted to open an acceptance test against openSUSE-15 but this was not a supported test environment to provision so was unable to do so. For now, progressing with this PR is blocked until acceptance testing is possible against SUSE. We do have supported SUSE Linux Enterprise Server (SLES) images for testing, but likely not openSUSE specifically. This requires some changes to map to the supported SLES images that are used for acceptance testing by looking at another module that already has SLES testing configured in the matrix.

@mattmallard

Copy link
Copy Markdown
Author

Thanks for the update @jst-cyr , is there anything I can do? I'm pretty sure SLES and openSUSE are identical in their layout and software versions (mostly), but I don't have access to a SLES system.

@jst-cyr

jst-cyr commented Oct 22, 2026

Copy link
Copy Markdown
Member

@mattmallard : Let me do some digging here... I think we have SLES 15 running on some other modules, I'll check to see what they are referencing in the metadata and see if I can fix it up.

@jst-cyr

jst-cyr commented Oct 22, 2026

Copy link
Copy Markdown
Member

@mattmallard : I found in our puppetlabs-postgresql module the metadata it uses to support SLES: https://github.com/puppetlabs/puppetlabs-postgresql/blob/main/metadata.json

You'll notice this block:

    {
      "operatingsystem": "SLES",
      "operatingsystemrelease": [
        "12",
        "15"
      ]
    },

We use SLES as that is the official OS that is supported for Puppet agents. Do you have a hard requirement to only do openSuse? Or would it be okay to update this PR to be focused towards Suse in general, using SLES as the testing bed?

If so, I think the only fix you need is to change the operatingsystem in metadata to SLES and then acceptance testing should run. The other changes in the PR look like they should work on either, it would only be the PR description that would need some extra updates since it is specifically about openSuse.

@mattmallard

Copy link
Copy Markdown
Author

Thanks @jst-cyr , I have now updated it to SLES 15 and 16 (12 is a bit old now and may not work so well with docker). SLES 16 has been out for a year now and it and 15 is pretty aligned to opensuse. I have left the code logic based on Suse which is the family that will match both sles and opensuse.

@jst-cyr

jst-cyr commented Oct 24, 2026

Copy link
Copy Markdown
Member

Thank you @mattmallard ! I agree, adding SLES 12 at this point doesn't make much sense. Right now, Puppet Core doesn't support SLES 16, so I don't know if we'll have any provisioned infrastructure for doing SLES 16 acceptance testing, but we should be able to get the v15 tested.

I'll kick off a new round of acceptance testing and let's see if the SLES 15 spins up...

@jst-cyr

jst-cyr commented Oct 24, 2026

Copy link
Copy Markdown
Member

Running CI for this PR here: #1087

@jst-cyr

jst-cyr commented Oct 26, 2026

Copy link
Copy Markdown
Member

Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-docker/actions/runs/40054939249?pr=1087

All green except for SLES 15.

All 3 failures below occur identically on both the Puppet Core 8 and Puppet Core 9 SLES-15 runs, which confirms this is a single root-cause set rather than a version-specific regression. I had Claude analyze and suggest some possible fixes:

1. docker with default parameters Package "docker-ce" is expected to be installed

File: spec/acceptance/docker_spec.rb:166

The test hardcodes:

package_name = 'docker-ce'

and checks rpm -q docker-ce. On SUSE, this PR intentionally installs the native docker package (not docker-ce — see manifests/params.pp, where docker_ce_package_name resolves to 'docker' for the Suse os family). The package is correctly installed, but under the wrong name per the test.

A possible fix: Make package_name in docker_spec.rb OS-family-aware, e.g.:

package_name = os[:family] == 'suse' ? 'docker' : 'docker-ce'

2. docker with default parameters netstat -tlndp

File: spec/acceptance/docker_spec.rb:199

sh: netstat: command not found

The SLES 15 test image doesn't ship net-tools by default, so netstat isn't on the PATH. This looks unrelated to the SUSE docker-support changes themselves — it's an environment gap (net-tools isn't installed/required by this module on SUSE).

Some fix options:

  • Ensure net-tools is installed as part of the SUSE test setup/manifest, or
  • Switch the assertion to ss -tlnp (available via iproute2, typically present on SLES by default).

3. the Puppet Docker module with download location is start a docker process

File: spec/acceptance/docker_custom_source_spec.rb:41

expect(r.stdout).to match %r{dockerd -H unix:///var/run/docker.sock}

Actual process line on SLES:

/usr/bin/dockerd --add-runtime oci=/usr/sbin/runc -H unix:///var/run/docker.sock --ip-forward=true --iptables=true --ip-masq=true -G docker

The regex assumes -H immediately follows dockerd, but SUSE's docker service launches dockerd with an extra --add-runtime oci=/usr/sbin/runc flag before -H. The daemon is listening on the expected socket — the test's strict regex is just too narrow.

Fix: Loosen the regex to not assume adjacency, e.g.:

expect(r.stdout).to match %r{dockerd\b.*-H unix:///var/run/docker.sock}

Net takeaway for the contributor: the manifest changes for SUSE support look functionally correct — all 3 failures are acceptance-spec assumptions (hardcoded docker-ce name, missing net-tools, and an overly strict dockerd command regex) that need to be made SUSE-aware/less brittle.

@mattmallard

Copy link
Copy Markdown
Author

@jst-cyr, sorry for the delay, it takes a while to get time to focus on this. I have submitted some fixes that hopefully get us through the acceptance tests.

@jst-cyr

jst-cyr commented Nov 3, 2026

Copy link
Copy Markdown
Member

No worries on the delay at all, @mattmallard ! Life happens, and I'm really appreciative of the effort you're putting in here. I've approved the base unit tests to run, and if those go green on 8.0 I'll kick off the acceptance test suite.

@jst-cyr

jst-cyr commented Nov 3, 2026

Copy link
Copy Markdown
Member

@mattmallard : It looks like the basic unit tests failed on Rubocop style checks:

Error: Style/TernaryParentheses: Use parentheses for ternary expressions with complex conditions.

@mattqm

mattqm commented Nov 4, 2026

Copy link
Copy Markdown

@jst-cyr , I pushed another update, hopefully that's sorted it now.

@jst-cyr

jst-cyr commented Nov 4, 2026

Copy link
Copy Markdown
Member

Thanks @mattmallard ! I confirmed the CI against 8.0 looked good, then merged in latest from main and will kick off the acceptance tests.

@jst-cyr

jst-cyr commented Nov 4, 2026

Copy link
Copy Markdown
Member

Running CI tests for this PR via #1091

@jst-cyr

jst-cyr commented Nov 4, 2026

Copy link
Copy Markdown
Member

🛑 Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-docker/actions/runs/41901386056?pr=1091

Failures on SLES 15 for both Puppet Core 8 and Puppet Core 9. Otherwise looks good.

Given the PR is about Suse/SLES support, this is a blocker. From looking at the error, it seems that there is a mismatch in comparing 'Suse' to 'suse'. The other parts of the module use 'Suse' for checks, but the docker_spec.rb is using 'suse' for the os family check.

Needs to be updated to either use the expected casing ('Suse') or string-insensitive comparison.

@mmallar2-coles

Copy link
Copy Markdown

@jst-cyr , ok I have pushed another fix, glad to know the testing is so thorough!

@jst-cyr

jst-cyr commented Nov 6, 2026

Copy link
Copy Markdown
Member

Thanks @mattmallard ! CI spec test against 8.0 looks good, I'll kick off acceptance tests and report back.

@jst-cyr

jst-cyr commented Nov 6, 2026

Copy link
Copy Markdown
Member

Running CI tests via: #1093

specinfra's os[:family] reports SLES hosts as 'sles', not 'suse',
unlike Puppet's Facter os.family which uses 'Suse'. The acceptance
test was comparing against the wrong value, so it fell through to
the docker-ce/netstat checks that don't apply on SLES.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jst-cyr

jst-cyr commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

✅ Acceptance Test Results: https://github.com/puppetlabs/puppetlabs-docker/actions/runs/42310612402?pr=1093

All green! Hooray! The only failure in the first check was in spec/acceptance/docker_spec.rb: os[:family] (from specinfra, used in acceptance test resource checks) reports SLES hosts as sles, not suse — that's different from Puppet's Facter os.family, which does return Suse. The is_suse check never matched, so the tests fell through to the docker-ce/netstat checks that don't apply on SLES.

Pushed a fix directly to this branch (commit 6d97023) widening the check to ['suse', 'sles', 'opensuse'].include?(os[:family].downcase). All acceptance and spec jobs are passing now, good for engineering review.

@jbagleyjr

Copy link
Copy Markdown
Contributor

tested this and it works well for us except the $socket_overrides_template needs to be defined in params.pp at line 305. This worked for me on sles15sp7.

$socket_overrides_template = 'docker/etc/systemd/system/docker.socket.d/socket-overrides.conf.epp'

Not sure the best way to contribute directly to someone else's pull request?

@jst-cyr

jst-cyr commented Nov 21, 2026

Copy link
Copy Markdown
Member

@jbagleyjr : Might be best for @mattmallard to coordinate on this so it gets incorporated into the PR. A good find!

@mattmallard

Copy link
Copy Markdown
Author

@jst-cyr, I added the suggestion

@jst-cyr

jst-cyr commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Thanks @mattmallard , I'll kick off the spec testing for initial tests. It looks like there are some conflicts with main branch, now, though. Might be good to get those looked at before I run the acceptance tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants