Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value not written to custom.cnf when 0 #28

Closed
ghost opened this issue Sep 3, 2019 · 1 comment
Closed

Value not written to custom.cnf when 0 #28

ghost opened this issue Sep 3, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 3, 2019

Hi,

When the custom.cnf file is generated, if a key-value mapping has a numerical value greater than 0 then {{ key }}={{ value }} is written to file, else only {{ key }} is written.

mariadb_custom_cnf:
mysqld:
server_id: '{{ groups[mariadb_servers].index(inventory_hostname) | int + 1 }}'
log_bin: 'mysqld-bin'
replicate-same-server-id: 0
replicate-do-db: 'testdb'

Generated custom.cnf file
[mysqld]
server_id=1
log_bin=mysqld-bin
replicate-same-server-id (expected : replicate-same-server-id=0, as per the MariaDB documentation)
replicate-do-db=testdb

Would it be possible to look into this "issue" for a future release?

Thank you in advance.

Kinds regards,

@bertvv
Copy link
Owner

bertvv commented Jun 17, 2020

It's best to consider all values, even numerical ones, as strings:

mariadb_custom_cnf:
  mysqld:
    server_id: '{{ groups[mariadb_servers].index(inventory_hostname) | int + 1 }}'
    log_bin: 'mysqld-bin'
    replicate-same-server-id: "0"  # Enter numbers as strings
    replicate-do-db: 'testdb'

I'll update the documentation to warn users for this.

@bertvv bertvv closed this as completed Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant