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
d1d1b0fd
Commit
d1d1b0fd
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
1cec44c1
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 @
d1d1b0fd
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
[template-mariadb]
filename = instance-mariadb.cfg.in
filename = instance-mariadb.cfg.in
md5sum =
023c9d7bb40ed55e2d760d4381760819
md5sum =
336353523d6528c3ffe06d00f5799552
[template-kumofs]
[template-kumofs]
filename = instance-kumofs.cfg.in
filename = instance-kumofs.cfg.in
...
@@ -46,7 +46,7 @@ md5sum = 2c553103f1196f95e4b6d0716a1e0638
...
@@ -46,7 +46,7 @@ md5sum = 2c553103f1196f95e4b6d0716a1e0638
[template-mariadb-initial-setup]
[template-mariadb-initial-setup]
filename = mariadb_initial_setup.sql.in
filename = mariadb_initial_setup.sql.in
md5sum =
f928b9dc99f7f970caadfe7dd6f95d34
md5sum =
6562d4cf2325577ab39f8fe2a46d3f1c
[template-postfix]
[template-postfix]
filename = instance-postfix.cfg.in
filename = instance-postfix.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
d1d1b0fd
...
@@ -38,6 +38,7 @@ database-list = {{ render_database_list(database_list) }}
...
@@ -38,6 +38,7 @@ database-list = {{ render_database_list(database_list) }}
test-database-list = {{ render_database_list(test_database_list) }}
test-database-list = {{ render_database_list(test_database_list) }}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
monitor-base-url = ${monitor-publish-parameters:monitor-base-url}
replication-bootstrap-url = ${mariadb-backup-static-http-server:bootstrap-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]
[publish-early]
recipe = slapos.cookbook:publish-early
recipe = slapos.cookbook:publish-early
...
@@ -168,9 +169,14 @@ output = ${directory:etc}/mariadb.cnf
...
@@ -168,9 +169,14 @@ output = ${directory:etc}/mariadb.cnf
url = {{ parameter_dict['template-my-cnf'] }}
url = {{ parameter_dict['template-my-cnf'] }}
context = section parameter_dict my-cnf-parameters
context = section parameter_dict my-cnf-parameters
[replication-password]
recipe = slapos.cookbook:generate.password
storage-path = ${directory:etc}/mariadb-replication.password
[init-script-parameters]
[init-script-parameters]
database-list = {{ dumps(database_list + test_database_list) }}
database-list = {{ dumps(database_list + test_database_list) }}
mroonga-mariadb-install-sql = {{ dumps(parameter_dict['mroonga-mariadb-install-sql']) }}
mroonga-mariadb-install-sql = {{ dumps(parameter_dict['mroonga-mariadb-install-sql']) }}
replication-password = ${replication-password:passwd}
[init-script]
[init-script]
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
...
...
stack/erp5/mariadb_initial_setup.sql.in
View file @
d1d1b0fd
...
@@ -20,3 +20,8 @@ GRANT PROCESS ON *.* TO `{{ user }}`@localhost IDENTIFIED BY '{{ password }}';
...
@@ -20,3 +20,8 @@ GRANT PROCESS ON *.* TO `{{ user }}`@localhost IDENTIFIED BY '{{ password }}';
{% for entry in parameter_dict['database-list'] -%}
{% for entry in parameter_dict['database-list'] -%}
{{ database(entry['name'], entry.get('user'), entry.get('password'), entry.get('with-process-privilege')) }}
{{ database(entry['name'], entry.get('user'), entry.get('password'), entry.get('with-process-privilege')) }}
{% endfor -%}
{% 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