-
Notifications
You must be signed in to change notification settings - Fork 7
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
Overwrite single value with hiera #22
Comments
Hi @linuxmail , Can you show me your Thanks |
hi @aerostitch that is our config profile and it works so far so good. But on one or two servers I want a slightly different configuration, for example the password hash, or user/server .. With my knowledge, I would change the hardcoded lines with variables, getting from hiera, maybe with defaults e.g.
cu denny |
We actually don't deep merge the default config with the configuration provided so you would need to declare the entire config inside your hash (can be done in hiera). class profile::mysql::maxscale {
include '::maxscale'
} And have in hiera the config that would look like (You could have, for example maxscale::repo_custom_url: 'http://foo.bar/debian/'
maxscale::repo_fingerprint: '56045F842...CBFA4C0'
maxscale::services_conf:
'default':
datadir: '/var/lib/maxscale/data'
config:
maxscale:
threads: 2
'Galera Monitor':
type: 'monitor'
module: 'galeramon'
user: 'maxscale'
passwd: '<secrethash>'
servers: 'mariadb1,mariadb2'
monitor_interval: 1000
disable_master_failback: true
detect_stale_master: true
use_priority: true
detect_replication_lag: true
'RW Split Router':
type: 'service'
router: 'readwritesplit'
user: 'maxscale'
servers: 'maria1db,mariadb2'
passwd: '<secrethash>'
max_slave_connections: '100%'
localhost_match_wildcard_host: 1
enable_root_user: 1
router_options: 'slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS'
'Debug Interface':
type: 'service'
router: 'debugcli'
'CLI':
type: 'service'
router: 'cli'
'Debug Listener':
type: 'listener'
service: 'Debug Interface'
protocol: 'telnetd'
address: '127.0.0.1'
port: 4442
'CLI Listener':
type: 'listener'
service: 'CLI'
protocol: 'maxscaled'
port: 6603
'ina-mariadb1':
type: 'server'
address: '192.168.1.51'
protocol: 'MySQLBackend'
port: 3306
'ina-mariadb2':
type: 'server'
address: '192.168.1.50'
protocol: 'MySQLBackend'
port: 3306 Note: the values that are already declared as the default in the define (https://github.com/tubemogul/puppet-maxscale/blob/master/manifests/instance.pp) don't need to be re-declared. Does that makes sense? Try to avoid hard-coded stuffs, it always ends up being a mess. ;) |
hi @aerostitch thanks for the example, but do I think right, that .. if we have 5 hosts, all with some slightly different configurations, I need the whole config (except the package defaults) ? Hmm, what I didn't say: I have the option ":merge_behavior: deeper" in hiera.yaml, so I thought, that it should work :-) Hhu .. so many new things :-) Thanks for the help 👍 |
hi,
I'm new to Hiera and I want to have the most parts as a classical manifest (profile::mysql::maxscale). but want to overwrite some lines, for example "password/user" or "servers" ...
Is that possible?
I tried the following:
But it seems to be ignored. If it doesn't work, I expect, that I have to change the fixed name in the manifest, with variables. Right?
cu denny
The text was updated successfully, but these errors were encountered: