Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aim_control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
liu-puppet-modules
aim_control
Merge requests
!53
Testing new config for mysql
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Testing new config for mysql
update_init
into
devel
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Saga Norén Karlsson
requested to merge
update_init
into
devel
9 months ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Compare
devel
devel (base)
and
latest version
latest version
d749cd93
1 commit,
9 months ago
1 file
+
40
−
29
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
manifests/init.pp
+
40
−
29
Options
@@ -191,39 +191,50 @@ class aim_control (
class
{
'mysql::server'
:
root_password
=>
$mysql_password
,
databases
=>
{
$db_name
=>
{
ensure
=>
'present'
,
charset
=>
'utf8'
,
},
},
users
=>
{
"
${skadereg_ro_user}
@%"
=>
{
ensure
=>
'present'
,
password_hash
=>
mysql_password
(
$skadereg_ro_password
),
},
},
grants
=>
{
"
${skadereg_ro_user}
@%/
${db_name}
.*"
=>
{
ensure
=>
'present'
,
privileges
=>
[
'SELECT'
],
table
=>
"
${db_name}
.*"
,
user
=>
"
${skadereg_ro_user}
@%"
,
},
'root@%'
=>
{
ensure
=>
'present'
,
options
=>
[
'GRANT'
],
privileges
=>
[
'ALL'
],
table
=>
'*.*'
,
user
=>
'root@%'
,
},
},
override_options
=>
{
mysqld
=>
{
'
mysqld
'
=>
{
'bind-address'
=>
'0.0.0.0'
,
port
=>
33060
,
'port'
=>
33060
,
'socket'
=>
'/var/lib/mysql/mysql.sock'
,
# Add socket path explicitly if needed
},
},
restart
=>
true
,
# Ensure server restarts to apply configuration changes
}
# Create the database with the necessary charset
mysql::db
{
$db_name
:
user
=>
$skadereg_ro_user
,
password
=>
$skadereg_ro_password
,
host
=>
'%'
,
charset
=>
'utf8'
,
grant
=>
[
'SELECT'
],
}
# Create the root user with full privileges
mysql_user
{
'root@%'
:
ensure
=>
'present'
,
password_hash
=>
mysql_password
(
$mysql_password
),
}
mysql_grant
{
'root@%/*.*'
:
ensure
=>
'present'
,
options
=>
[
'GRANT'
],
privileges
=>
[
'ALL'
],
table
=>
'*.*'
,
user
=>
'root@%'
,
}
# Create the read-only user with select privileges on the database
mysql_user
{
"
${skadereg_ro_user}
@%"
:
ensure
=>
'present'
,
password_hash
=>
mysql_password
(
$skadereg_ro_password
),
}
mysql_grant
{
"
${skadereg_ro_user}
@%/
${db_name}
.*"
:
ensure
=>
'present'
,
privileges
=>
[
'SELECT'
],
table
=>
"
${db_name}
.*"
,
user
=>
"
${skadereg_ro_user}
@%"
,
}
# ['entries', 'guardian_confirmations', 'users'].each |String $table| {
Loading