From 5d588dd512a070b8f2cdfc535a57d2eb1faf6444 Mon Sep 17 00:00:00 2001 From: Matthew Alexander LaChance Date: Mon, 27 Nov 2023 12:49:12 -0500 Subject: [PATCH] Add /etc/containerd directory Without this, puppet fails on trying to create the config file. --- manifests/profile/containerd.pp | 4 ++++ spec/classes/profile/containerd_spec.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/manifests/profile/containerd.pp b/manifests/profile/containerd.pp index d283384d2..8067fe0d8 100644 --- a/manifests/profile/containerd.pp +++ b/manifests/profile/containerd.pp @@ -29,4 +29,8 @@ content => template('nebula/profile/containerd/config.toml.erb'), notify => Service['containerd'] } + + file { "/etc/containerd": + ensure => "directory" + } } diff --git a/spec/classes/profile/containerd_spec.rb b/spec/classes/profile/containerd_spec.rb index 7a2b10bfa..4a058fdf0 100644 --- a/spec/classes/profile/containerd_spec.rb +++ b/spec/classes/profile/containerd_spec.rb @@ -16,6 +16,8 @@ it { is_expected.to contain_service('containerd').that_requires('Package[containerd.io]') } it { is_expected.to contain_file('/etc/containerd/config.toml').with_content(/^disabled_plugins = \[\]$/) } it { is_expected.to contain_file('/etc/containerd/config.toml').with_content(/^\s*SystemdCgroup = true$/) } + it { is_expected.to contain_file('/etc/containerd').with_ensure("directory") } + it { is_expected.to contain_file('/etc/containerd').that_comes_before("File[/etc/containerd/config.toml]") } end end end