$ cd cf-mysql-release
$ gem install bosh-template
$ bosh-template jobs/mysql/templates/my.cnf.erb --context "$(cat template-context.json)"
Last active
April 30, 2019 19:45
-
-
Save zankich/8889b9bfff70992ffc69e668d2d35751 to your computer and use it in GitHub Desktop.
testing a bosh template using the bosh-template gem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
spec = YAML::load(File.open('spec')) | |
spec["properties"].each do |name, property| | |
next if name.split('.')[1] != "mysql" | |
puts "\"#{name.split('.').last}\": \"#{property['default']}\"," | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"links": { | |
"mysql": { | |
"instances": {} | |
} | |
}, | |
"networks": { | |
"default": { | |
"ip": "127.0.0.1" | |
} | |
}, | |
"properties": { | |
"cf_mysql": { | |
"mysql": { | |
"admin_username": "root", | |
"admin_password": "password", | |
"remote_admin_access": "false", | |
"port": "3306", | |
"galera_port": "4567", | |
"max_connections": null, | |
"character_set_server": "utf8", | |
"collation_server": "utf8_unicode_ci", | |
"max_open_files": "65536", | |
"innodb_buffer_pool_size_percent": "50", | |
"innodb_log_buffer_size": "32M", | |
"innodb_flush_log_at_trx_commit": 1, | |
"innodb_large_prefix_enabled": "true", | |
"innodb_strict_mode": "false", | |
"max_allowed_packet": "256M", | |
"max_heap_table_size": "16777216", | |
"table_definition_cache_size": "8192", | |
"table_open_cache": "2000", | |
"tmp_table_size": "33554432", | |
"wsrep_max_ws_rows": "0", | |
"wsrep_max_ws_size": "1073741824", | |
"skip_name_resolve": "true", | |
"gcache_size": "512", | |
"ib_log_file_size": "1024", | |
"seeded_databases": "{}", | |
"roadmin_enabled": "false", | |
"server_audit_file_rotations": "30", | |
"server_audit_file_rotate_size_in_mb": "100", | |
"server_audit_excluded_users": "[]", | |
"cluster_name": "cf-mariadb-galera-cluster", | |
"log_interval": "30", | |
"endpoint_username": "galera-healthcheck", | |
"port": "9200", | |
"disable_auto_sst": "true", | |
"cluster_probe_timeout": "10", | |
"userstat": "false", | |
"binlog_enabled": "true", | |
"binlog_expire_days": "7", | |
"cli_history": "true", | |
"wsrep_debug": "OFF", | |
"log_conflicts": "true", | |
"log_queries_not_using_indexes": "false", | |
"event_scheduler": "OFF", | |
"startup_timeout": "60", | |
"enable_local_file": "false" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment