File tree 4 files changed +57
-6
lines changed
4 files changed +57
-6
lines changed Original file line number Diff line number Diff line change 6
6
class mysql::params {
7
7
8
8
$manage_config_file = true
9
+ $config_file_mode = ' 0644'
9
10
$purge_conf_dir = false
10
11
$restart = false
11
12
$root_password = ' UNSET'
Original file line number Diff line number Diff line change 11
11
#
12
12
# @param config_file
13
13
# The location, as a path, of the MySQL configuration file.
14
+ # @param config_file_mode
15
+ # The MySQL configuration file's permissions mode.
14
16
# @param includedir
15
17
# The location, as a path, of !includedir for custom configuration overrides.
16
18
# @param install_options
68
70
#
69
71
class mysql::server (
70
72
$config_file = $mysql::params::config_file,
73
+ $config_file_mode = $mysql::params::config_file_mode,
71
74
$includedir = $mysql::params::includedir,
72
75
$install_options = undef ,
73
76
$install_secret_file = $mysql::params::install_secret_file,
94
97
$users = {},
95
98
$grants = {},
96
99
$databases = {},
97
-
98
- # Deprecated parameters
99
- $enabled = undef ,
100
- $manage_service = undef ,
101
- $old_root_password = undef
100
+ # Deprecated parameters
101
+ $enabled = undef ,
102
+ $manage_service = undef ,
103
+ $old_root_password = undef
102
104
) inherits mysql::params {
103
105
104
106
# Deprecated parameters.
Original file line number Diff line number Diff line change 37
37
file { 'mysql-config-file' :
38
38
path => $mysql::server::config_file ,
39
39
content => template (' mysql/my.cnf.erb' ),
40
- mode => ' 0644 ' ,
40
+ mode => $mysql::server::config_file_mode ,
41
41
selinux_ignore_defaults => true ,
42
42
}
43
43
Original file line number Diff line number Diff line change 80
80
81
81
it { is_expected . to contain_file ( 'mysql-config-file' ) . without_content ( %r{!includedir} ) }
82
82
end
83
+
84
+ context 'with file mode 0644' do
85
+ let ( :params ) { { 'config_file_mode' => '0644' } }
86
+
87
+ it do
88
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0644' )
89
+ end
90
+ end
91
+
92
+ context 'with file mode 0664' do
93
+ let ( :params ) { { 'config_file_mode' => '0664' } }
94
+
95
+ it do
96
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0664' )
97
+ end
98
+ end
99
+
100
+ context 'with file mode 0660' do
101
+ let ( :params ) { { 'config_file_mode' => '0660' } }
102
+
103
+ it do
104
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0660' )
105
+ end
106
+ end
107
+
108
+ context 'with file mode 0641' do
109
+ let ( :params ) { { 'config_file_mode' => '0641' } }
110
+
111
+ it do
112
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0641' )
113
+ end
114
+ end
115
+
116
+ context 'with file mode 0610' do
117
+ let ( :params ) { { 'config_file_mode' => '0610' } }
118
+
119
+ it do
120
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0610' )
121
+ end
122
+ end
123
+
124
+ context 'with file 0600' do
125
+ let ( :params ) { { 'config_file_mode' => '0600' } }
126
+
127
+ it do
128
+ is_expected . to contain_file ( 'mysql-config-file' ) . with ( mode : '0600' )
129
+ end
130
+ end
83
131
end
84
132
end
85
133
end
You can’t perform that action at this time.
0 commit comments