{"action":"created","comment":{"url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/comments/25240553","id":25240553,"diff_hunk":"@@ -7,14 +7,83 @@\n \n class rjil::db (\n   $mysql_root_pass,\n+  $repl_pass,\n   $mysql_server_package_name = 'mariadb-server',\n-  $mysql_datadir =  '/data',\n-  $mysql_max_connections = 1024,\n-  $mysql_data_disk = undef,\n-  $dbs = {},\n-  $bind_address = '0.0.0.0',\n+  $mysql_datadir             =  '/data',\n+  $mysql_max_connections     = 1024,\n+  $mysql_data_disk           = undef,\n+  $dbs                       = {},\n+  $bind_address              = '0.0.0.0',\n+  $server_id                 = undef,\n+  $log_bin                   = 'mysql-bin.log',\n+  $is_master                 = false,\n+  $binlog_format             = 'mixed',\n+  $sync_binlog               = 1,\n+  $relay_log                 = 'mysql-relay-bin.log',\n+  $repl_user                 = 'repl',\n+  $master_server             = 'master.mysql.service.consul',\n )  {\n \n+  if $server_id {\n+    $server_id_orig = $server_id\n+  } else {\n+    $server_id_orig = regsubst($bind_address,'^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$','\\4')\n+  }\n+\n+  $default_mysqld_options = {\n+        'max_connections' => $mysql_max_connections,\n+        'datadir'         => $mysql_datadir,\n+        'bind-address'    => $bind_address,\n+        'server-id'       => $server_id_orig,\n+        'log_bin'         => $log_bin,\n+        'binlog_format'   => $binlog_format,\n+        'sync_binlog'     => $sync_binlog,\n+      }\n+\n+  if $is_master {\n+    $override_mysqld_options = {}\n+    $consul_tags = ['master']\n+\n+    ##\n+    # Add master data to consul kv\n+    ##\n+    consul_kv_mysql_masterdata {'openstack':}\n+    Mysql_user<||> -> Consul_kv_mysql_masterdata<||>\n+    Mysql_grant<||> -> Consul_kv_mysql_masterdata<||>\n+    Mysql_database<||> -> Consul_kv_mysql_masterdata<||>\n+    Consul_kv_mysql_masterdata<||> -> Rjil::Jiocloud::Consul::Service<| title == 'mysql' |>\n+    Class['rjil::db'] -> Rjil::Service_blocker<| title == 'master.mysql' |>\n+  } else {\n+    if $::leader {\n+      $override_mysqld_options = {\n+        'read_only' => true,\n+        'relay_log' => $relay_log,\n+      }\n+      $consul_tags = ['slave']\n+\n+      consul_kv_mysql_slave_update{'openstack':\n+        repl_user => $repl_user,\n+        repl_password => $repl_user,","path":"manifests/db.pp","position":65,"original_position":65,"commit_id":"82cc3fbd75325d87627034dde1792f07cbd4cf63","original_commit_id":"82cc3fbd75325d87627034dde1792f07cbd4cf63","user":{"login":"hkumarmk","id":6316902,"avatar_url":"https://avatars.githubusercontent.com/u/6316902?v=3","gravatar_id":"","url":"https://api.github.com/users/hkumarmk","html_url":"https://github.com/hkumarmk","followers_url":"https://api.github.com/users/hkumarmk/followers","following_url":"https://api.github.com/users/hkumarmk/following{/other_user}","gists_url":"https://api.github.com/users/hkumarmk/gists{/gist_id}","starred_url":"https://api.github.com/users/hkumarmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkumarmk/subscriptions","organizations_url":"https://api.github.com/users/hkumarmk/orgs","repos_url":"https://api.github.com/users/hkumarmk/repos","events_url":"https://api.github.com/users/hkumarmk/events{/privacy}","received_events_url":"https://api.github.com/users/hkumarmk/received_events","type":"User","site_admin":false},"body":"It must be repl_password, ill fix it. and I did not understand your second question.","created_at":"2015-02-24T10:01:20Z","updated_at":"2015-02-24T10:01:20Z","html_url":"https://github.com/JioCloud/puppet-rjil/pull/414#discussion_r25240553","pull_request_url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414","_links":{"self":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/comments/25240553"},"html":{"href":"https://github.com/JioCloud/puppet-rjil/pull/414#discussion_r25240553"},"pull_request":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414"}}},"pull_request":{"url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414","id":29152430,"html_url":"https://github.com/JioCloud/puppet-rjil/pull/414","diff_url":"https://github.com/JioCloud/puppet-rjil/pull/414.diff","patch_url":"https://github.com/JioCloud/puppet-rjil/pull/414.patch","issue_url":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/414","number":414,"state":"open","locked":false,"title":"Setup mysql binary file replication","user":{"login":"hkumarmk","id":6316902,"avatar_url":"https://avatars.githubusercontent.com/u/6316902?v=3","gravatar_id":"","url":"https://api.github.com/users/hkumarmk","html_url":"https://github.com/hkumarmk","followers_url":"https://api.github.com/users/hkumarmk/followers","following_url":"https://api.github.com/users/hkumarmk/following{/other_user}","gists_url":"https://api.github.com/users/hkumarmk/gists{/gist_id}","starred_url":"https://api.github.com/users/hkumarmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkumarmk/subscriptions","organizations_url":"https://api.github.com/users/hkumarmk/orgs","repos_url":"https://api.github.com/users/hkumarmk/repos","events_url":"https://api.github.com/users/hkumarmk/events{/privacy}","received_events_url":"https://api.github.com/users/hkumarmk/received_events","type":"User","site_admin":false},"body":"This is ready for testing - worked on my vagrant.\r\n\r\n* Updated rjil::db class to configure mysql master server\r\n* Updated the name of ocdb to ocdbm (master) and ocdbs (slave)\r\n* Connect to master.mysql.service.consul\r\n\r\nThis depends on PR jiocloud/puppet-orchestration_utils#7","created_at":"2015-02-12T04:37:46Z","updated_at":"2015-02-24T10:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"abc27e5b46a867d48ddd888aa40d5bb7325bb1dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414/commits","review_comments_url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414/comments","review_comment_url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/414/comments","statuses_url":"https://api.github.com/repos/JioCloud/puppet-rjil/statuses/82cc3fbd75325d87627034dde1792f07cbd4cf63","head":{"label":"hkumarmk:mysql_replication","ref":"mysql_replication","sha":"82cc3fbd75325d87627034dde1792f07cbd4cf63","user":{"login":"hkumarmk","id":6316902,"avatar_url":"https://avatars.githubusercontent.com/u/6316902?v=3","gravatar_id":"","url":"https://api.github.com/users/hkumarmk","html_url":"https://github.com/hkumarmk","followers_url":"https://api.github.com/users/hkumarmk/followers","following_url":"https://api.github.com/users/hkumarmk/following{/other_user}","gists_url":"https://api.github.com/users/hkumarmk/gists{/gist_id}","starred_url":"https://api.github.com/users/hkumarmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkumarmk/subscriptions","organizations_url":"https://api.github.com/users/hkumarmk/orgs","repos_url":"https://api.github.com/users/hkumarmk/repos","events_url":"https://api.github.com/users/hkumarmk/events{/privacy}","received_events_url":"https://api.github.com/users/hkumarmk/received_events","type":"User","site_admin":false},"repo":{"id":23566380,"name":"puppet-rjil","full_name":"hkumarmk/puppet-rjil","owner":{"login":"hkumarmk","id":6316902,"avatar_url":"https://avatars.githubusercontent.com/u/6316902?v=3","gravatar_id":"","url":"https://api.github.com/users/hkumarmk","html_url":"https://github.com/hkumarmk","followers_url":"https://api.github.com/users/hkumarmk/followers","following_url":"https://api.github.com/users/hkumarmk/following{/other_user}","gists_url":"https://api.github.com/users/hkumarmk/gists{/gist_id}","starred_url":"https://api.github.com/users/hkumarmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hkumarmk/subscriptions","organizations_url":"https://api.github.com/users/hkumarmk/orgs","repos_url":"https://api.github.com/users/hkumarmk/repos","events_url":"https://api.github.com/users/hkumarmk/events{/privacy}","received_events_url":"https://api.github.com/users/hkumarmk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hkumarmk/puppet-rjil","description":"","fork":true,"url":"https://api.github.com/repos/hkumarmk/puppet-rjil","forks_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/forks","keys_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/teams","hooks_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/hooks","issue_events_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/issues/events{/number}","events_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/events","assignees_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/assignees{/user}","branches_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/branches{/branch}","tags_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/tags","blobs_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/git/refs{/sha}","trees_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/statuses/{sha}","languages_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/languages","stargazers_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/stargazers","contributors_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/contributors","subscribers_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/subscribers","subscription_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/subscription","commits_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/commits{/sha}","git_commits_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/git/commits{/sha}","comments_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/comments{/number}","issue_comment_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/issues/comments{/number}","contents_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/contents/{+path}","compare_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/merges","archive_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/downloads","issues_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/issues{/number}","pulls_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/pulls{/number}","milestones_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/milestones{/number}","notifications_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/labels{/name}","releases_url":"https://api.github.com/repos/hkumarmk/puppet-rjil/releases{/id}","created_at":"2014-09-02T05:36:38Z","updated_at":"2014-08-14T10:22:52Z","pushed_at":"2015-02-24T06:25:34Z","git_url":"git://github.com/hkumarmk/puppet-rjil.git","ssh_url":"git@github.com:hkumarmk/puppet-rjil.git","clone_url":"https://github.com/hkumarmk/puppet-rjil.git","svn_url":"https://github.com/hkumarmk/puppet-rjil","homepage":null,"size":2191,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JioCloud:master","ref":"master","sha":"1c7e39fe67111fcca08d810d64644782b8deae35","user":{"login":"JioCloud","id":5500757,"avatar_url":"https://avatars.githubusercontent.com/u/5500757?v=3","gravatar_id":"","url":"https://api.github.com/users/JioCloud","html_url":"https://github.com/JioCloud","followers_url":"https://api.github.com/users/JioCloud/followers","following_url":"https://api.github.com/users/JioCloud/following{/other_user}","gists_url":"https://api.github.com/users/JioCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/JioCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JioCloud/subscriptions","organizations_url":"https://api.github.com/users/JioCloud/orgs","repos_url":"https://api.github.com/users/JioCloud/repos","events_url":"https://api.github.com/users/JioCloud/events{/privacy}","received_events_url":"https://api.github.com/users/JioCloud/received_events","type":"Organization","site_admin":false},"repo":{"id":16161513,"name":"puppet-rjil","full_name":"JioCloud/puppet-rjil","owner":{"login":"JioCloud","id":5500757,"avatar_url":"https://avatars.githubusercontent.com/u/5500757?v=3","gravatar_id":"","url":"https://api.github.com/users/JioCloud","html_url":"https://github.com/JioCloud","followers_url":"https://api.github.com/users/JioCloud/followers","following_url":"https://api.github.com/users/JioCloud/following{/other_user}","gists_url":"https://api.github.com/users/JioCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/JioCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JioCloud/subscriptions","organizations_url":"https://api.github.com/users/JioCloud/orgs","repos_url":"https://api.github.com/users/JioCloud/repos","events_url":"https://api.github.com/users/JioCloud/events{/privacy}","received_events_url":"https://api.github.com/users/JioCloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JioCloud/puppet-rjil","description":"Puppet scripts for managing JioCloud","fork":false,"url":"https://api.github.com/repos/JioCloud/puppet-rjil","forks_url":"https://api.github.com/repos/JioCloud/puppet-rjil/forks","keys_url":"https://api.github.com/repos/JioCloud/puppet-rjil/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JioCloud/puppet-rjil/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JioCloud/puppet-rjil/teams","hooks_url":"https://api.github.com/repos/JioCloud/puppet-rjil/hooks","issue_events_url":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/events{/number}","events_url":"https://api.github.com/repos/JioCloud/puppet-rjil/events","assignees_url":"https://api.github.com/repos/JioCloud/puppet-rjil/assignees{/user}","branches_url":"https://api.github.com/repos/JioCloud/puppet-rjil/branches{/branch}","tags_url":"https://api.github.com/repos/JioCloud/puppet-rjil/tags","blobs_url":"https://api.github.com/repos/JioCloud/puppet-rjil/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JioCloud/puppet-rjil/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JioCloud/puppet-rjil/git/refs{/sha}","trees_url":"https://api.github.com/repos/JioCloud/puppet-rjil/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JioCloud/puppet-rjil/statuses/{sha}","languages_url":"https://api.github.com/repos/JioCloud/puppet-rjil/languages","stargazers_url":"https://api.github.com/repos/JioCloud/puppet-rjil/stargazers","contributors_url":"https://api.github.com/repos/JioCloud/puppet-rjil/contributors","subscribers_url":"https://api.github.com/repos/JioCloud/puppet-rjil/subscribers","subscription_url":"https://api.github.com/repos/JioCloud/puppet-rjil/subscription","commits_url":"https://api.github.com/repos/JioCloud/puppet-rjil/commits{/sha}","git_commits_url":"https://api.github.com/repos/JioCloud/puppet-rjil/git/commits{/sha}","comments_url":"https://api.github.com/repos/JioCloud/puppet-rjil/comments{/number}","issue_comment_url":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/comments{/number}","contents_url":"https://api.github.com/repos/JioCloud/puppet-rjil/contents/{+path}","compare_url":"https://api.github.com/repos/JioCloud/puppet-rjil/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JioCloud/puppet-rjil/merges","archive_url":"https://api.github.com/repos/JioCloud/puppet-rjil/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JioCloud/puppet-rjil/downloads","issues_url":"https://api.github.com/repos/JioCloud/puppet-rjil/issues{/number}","pulls_url":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls{/number}","milestones_url":"https://api.github.com/repos/JioCloud/puppet-rjil/milestones{/number}","notifications_url":"https://api.github.com/repos/JioCloud/puppet-rjil/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JioCloud/puppet-rjil/labels{/name}","releases_url":"https://api.github.com/repos/JioCloud/puppet-rjil/releases{/id}","created_at":"2014-01-23T03:45:55Z","updated_at":"2015-02-16T09:12:42Z","pushed_at":"2015-02-16T09:12:42Z","git_url":"git://github.com/JioCloud/puppet-rjil.git","ssh_url":"git@github.com:JioCloud/puppet-rjil.git","clone_url":"https://github.com/JioCloud/puppet-rjil.git","svn_url":"https://github.com/JioCloud/puppet-rjil","homepage":"","size":4556,"stargazers_count":1,"watchers_count":1,"language":"Puppet","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":78,"forks":26,"open_issues":78,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414"},"html":{"href":"https://github.com/JioCloud/puppet-rjil/pull/414"},"issue":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/414"},"comments":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/issues/414/comments"},"review_comments":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414/comments"},"review_comment":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/pulls/414/commits"},"statuses":{"href":"https://api.github.com/repos/JioCloud/puppet-rjil/statuses/82cc3fbd75325d87627034dde1792f07cbd4cf63"}}}}