Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos
Commits
b8cbc8a0
Commit
b8cbc8a0
authored
Oct 29, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/erp5: Add mariadb user for replication
Use a generated password and publish its url.
parent
a1ddc54e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+2
-2
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+6
-0
stack/erp5/mariadb_initial_setup.sql.in
stack/erp5/mariadb_initial_setup.sql.in
+5
-0
No files found.
stack/erp5/buildout.hash.cfg
View file @
b8cbc8a0
...
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
89793174999fc95f4bc4692c9d4e883e
md5sum =
03a9b5e5e3997d9024bbf72fe7d706ed
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
@@ -46,7 +46,7 @@ md5sum = 2c553103f1196f95e4b6d0716a1e0638
[template-mariadb-initial-setup]
filename = mariadb_initial_setup.sql.in
md5sum =
f928b9dc99f7f970caadfe7dd6f95d34
md5sum =
6562d4cf2325577ab39f8fe2a46d3f1c
[template-postfix]
filename = instance-postfix.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
b8cbc8a0
...
...
@@ -38,6 +38,7 @@ database-list = {{ render_database_list(database_list) }}
test-database-list = {{ render_database_list(test_database_list) }}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
replication-bootstrap-url = ${mariadb-backup-static-http-server:bootstrap-url}
replication-primary-url = mysql://replication_user:${replication-password:passwd}@{{ ip_as_host }}:{{ port }}
[publish-early]
recipe = slapos.cookbook:publish-early
...
...
@@ -167,9 +168,14 @@ output = ${directory:etc}/mariadb.cnf
url = {{ parameter_dict['template-my-cnf'] }}
context = section parameter_dict my-cnf-parameters
[replication-password]
recipe = slapos.cookbook:generate.password
storage-path = ${directory:etc}/mariadb-replication.password
[init-script-parameters]
database-list = {{ dumps(database_list + test_database_list) }}
mroonga-mariadb-install-sql = {{ dumps(parameter_dict['mroonga-mariadb-install-sql']) }}
replication-password = ${replication-password:passwd}
[init-script]
recipe = slapos.recipe.template:jinja2
...
...
stack/erp5/mariadb_initial_setup.sql.in
View file @
b8cbc8a0
...
...
@@ -20,3 +20,8 @@ GRANT PROCESS ON *.* TO `{{ user }}`@localhost IDENTIFIED BY '{{ password }}';
{% for entry in parameter_dict['database-list'] -%}
{{ database(entry['name'], entry.get('user'), entry.get('password'), entry.get('with-process-privilege')) }}
{% endfor -%}
{% set replication_password = parameter_dict.get('replication-password') -%}
{% if replication_password -%}
GRANT REPLICATION SLAVE ON *.* TO `replication_user`@`%` IDENTIFIED BY '{{ replication_password }}';
{%- endif %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment