Browse Source

mysql/client: create tripleo.cnf everytime

If TLS isn't enabled, Augeas won't create tripleo.cnf but Docker will
create the file itself while mount binding it into the container.
With podman, the files/dirs that don't exist aren't created (probably
for the best), so let's create this empty file so podman can mount it
anyway.

We need to backport this commit to support a change in paunch that
only starts docker if the mounts exist

Blueprint podman-support
Co-Authored-By: Cédric Jeanneret <cjeanner@redhat.com>
Needed-By: https://review.opendev.org/#/c/673561/

(cherry picked from commit 5a96b2ec0c)

Change-Id: Ib46505fa1426e5c9ab0345ee186540ca5b983d92
tags/9.5.1
Emilien Macchi 1 year ago
parent
commit
1ef0aca325

+ 4
- 0
manifests/profile/base/database/mysql/client.pp View File

@@ -101,10 +101,14 @@ class tripleo::profile::base::database::mysql::client (
101 101
       }
102 102
     }
103 103
 
104
+    file { $mysql_read_default_file:
105
+      ensure => file,
106
+    }
104 107
     augeas { 'tripleo-mysql-client-conf':
105 108
       incl    => $mysql_read_default_file,
106 109
       lens    => 'Puppet.lns',
107 110
       changes => $conf_changes,
111
+      require => File[$mysql_read_default_file],
108 112
     }
109 113
 
110 114
     # If a profile created a file resource for the parent directory,

+ 3
- 0
spec/classes/tripleo_profile_base_database_mysql_client_spec.rb View File

@@ -30,6 +30,9 @@ describe 'tripleo::profile::base::database::mysql::client' do
30 30
 
31 31
       it {
32 32
         is_expected.to contain_exec('directory-create-etc-my.cnf.d')
33
+        is_expected.to contain_file('/etc/my.cnf.d/tripleo.cnf').with(
34
+          :ensure => 'file',
35
+        )
33 36
         is_expected.to contain_augeas('tripleo-mysql-client-conf').with(
34 37
           :incl    => '/etc/my.cnf.d/tripleo.cnf',
35 38
           :changes => [

Loading…
Cancel
Save