{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/48854458","id":48854458,"diff_hunk":"@@ -0,0 +1,46 @@\n+#\n+# Copyright 2015, SUSE\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#     http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+# These helper methods provides a convenient way to create Pacemaker\n+# location constraints which limit resources to only run on OpenStack\n+# controller nodes or compute nodes.\n+#\n+# Example usage:\n+#\n+#   service_name = \"keystone\"\n+#   location_name = \"l-#{service_name}-controller\"\n+#   pacemaker_location location_name do\n+#     definition controller_only_location(location_name, service_name)\n+#     action :update\n+#     only_if { CrowbarPacemakerHelper.is_cluster_founder?(node) }\n+#   end\n+#   transaction_objects << \"pacemaker_location[#{location_name}]\"\n+\n+class Chef\n+  class Resource\n+    class PacemakerLocation\n+      def controller_only_location(location, service)\n+        \"location #{location} #{service} resource-discovery=exclusive \" +\n+          \"rule 0: OpenStack-role eq controller\"\n+      end\n+\n+      def compute_only_location(location, service)","path":"chef/cookbooks/crowbar-openstack/libraries/pacemaker_helpers.rb","position":40,"original_position":40,"commit_id":"a3a216672108a3730cf3997e590d690c6b0a2412","original_commit_id":"320531fdb07f73c2a85d203d2b6e465cb3da6633","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars.githubusercontent.com/u/1758783?v=3","gravatar_id":"","url":"https://api.github.com/users/vuntz","html_url":"https://github.com/vuntz","followers_url":"https://api.github.com/users/vuntz/followers","following_url":"https://api.github.com/users/vuntz/following{/other_user}","gists_url":"https://api.github.com/users/vuntz/gists{/gist_id}","starred_url":"https://api.github.com/users/vuntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vuntz/subscriptions","organizations_url":"https://api.github.com/users/vuntz/orgs","repos_url":"https://api.github.com/users/vuntz/repos","events_url":"https://api.github.com/users/vuntz/events{/privacy}","received_events_url":"https://api.github.com/users/vuntz/received_events","type":"User","site_admin":false},"body":"We're in the context of a pacemaker cluster, and in this case, the question is \"can we have a node both as remote and normal member of the cluster\", and the answer is no.\r\n\r\nYou can still have a compute node on a cluster member, but not with hypervisor HA.","created_at":"2016-01-05T15:17:07Z","updated_at":"2016-01-05T15:17:07Z","html_url":"https://github.com/crowbar/crowbar-openstack/pull/170#discussion_r48854458","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments/48854458"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/170#discussion_r48854458"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170","id":54842844,"html_url":"https://github.com/crowbar/crowbar-openstack/pull/170","diff_url":"https://github.com/crowbar/crowbar-openstack/pull/170.diff","patch_url":"https://github.com/crowbar/crowbar-openstack/pull/170.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/170","number":170,"state":"open","locked":false,"title":"limit OpenStack services by node role","user":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"body":"**WIP - the helpers do not work due to Chef internals.  Need to be replaced with definitions or wrapper LWRPs.**\r\n\r\nNow that `pacemaker_remote` can extend the cluster beyond the core corosync nodes, we have to ensure that controller services only run on the core nodes, and compute services only run on the compute nodes.  We do this by introducing new `crowbar-openstack::controller` and `crowbar-openstack::compute` roles, which new rule-based `location` constraints can then reference.\r\n\r\n**N.B. These new constraints require https://github.com/crowbar/crowbar-ha/pull/54 to work.**\r\n\r\nThis PR is currently based on #139, but will be rebased when that is merged.","created_at":"2015-12-31T01:47:59Z","updated_at":"2016-01-05T15:17:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f7722b8a716ce56dec98f91b8352b1bb1435936","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/170/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/a3a216672108a3730cf3997e590d690c6b0a2412","head":{"label":"aspiers:use-transactions","ref":"use-transactions","sha":"a3a216672108a3730cf3997e590d690c6b0a2412","user":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"repo":{"id":41430315,"name":"crowbar-openstack","full_name":"aspiers/crowbar-openstack","owner":{"login":"aspiers","id":100738,"avatar_url":"https://avatars.githubusercontent.com/u/100738?v=3","gravatar_id":"","url":"https://api.github.com/users/aspiers","html_url":"https://github.com/aspiers","followers_url":"https://api.github.com/users/aspiers/followers","following_url":"https://api.github.com/users/aspiers/following{/other_user}","gists_url":"https://api.github.com/users/aspiers/gists{/gist_id}","starred_url":"https://api.github.com/users/aspiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspiers/subscriptions","organizations_url":"https://api.github.com/users/aspiers/orgs","repos_url":"https://api.github.com/users/aspiers/repos","events_url":"https://api.github.com/users/aspiers/events{/privacy}","received_events_url":"https://api.github.com/users/aspiers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aspiers/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/aspiers/crowbar-openstack","forks_url":"https://api.github.com/repos/aspiers/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/aspiers/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspiers/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspiers/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/aspiers/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/aspiers/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/aspiers/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/aspiers/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/aspiers/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/aspiers/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/aspiers/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspiers/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspiers/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspiers/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspiers/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/aspiers/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/aspiers/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/aspiers/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/aspiers/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/aspiers/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/aspiers/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspiers/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspiers/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspiers/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspiers/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/aspiers/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspiers/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/aspiers/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspiers/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/aspiers/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/aspiers/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/aspiers/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/aspiers/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspiers/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/aspiers/crowbar-openstack/releases{/id}","created_at":"2015-08-26T14:27:03Z","updated_at":"2015-08-26T14:27:04Z","pushed_at":"2016-01-04T10:41:11Z","git_url":"git://github.com/aspiers/crowbar-openstack.git","ssh_url":"git@github.com:aspiers/crowbar-openstack.git","clone_url":"https://github.com/aspiers/crowbar-openstack.git","svn_url":"https://github.com/aspiers/crowbar-openstack","homepage":null,"size":15629,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"crowbar:master","ref":"master","sha":"cb12edce3326c9a997e8c0fd6a65a855fd91f687","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"repo":{"id":39006903,"name":"crowbar-openstack","full_name":"crowbar/crowbar-openstack","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars.githubusercontent.com/u/2910205?v=3","gravatar_id":"","url":"https://api.github.com/users/crowbar","html_url":"https://github.com/crowbar","followers_url":"https://api.github.com/users/crowbar/followers","following_url":"https://api.github.com/users/crowbar/following{/other_user}","gists_url":"https://api.github.com/users/crowbar/gists{/gist_id}","starred_url":"https://api.github.com/users/crowbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowbar/subscriptions","organizations_url":"https://api.github.com/users/crowbar/orgs","repos_url":"https://api.github.com/users/crowbar/repos","events_url":"https://api.github.com/users/crowbar/events{/privacy}","received_events_url":"https://api.github.com/users/crowbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowbar/crowbar-openstack","description":"Openstack deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-openstack","forks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-openstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-openstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-openstack/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-openstack/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-openstack/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-openstack/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-openstack/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-openstack/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-openstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-openstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-openstack/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-openstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-openstack/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-openstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-openstack/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-openstack/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-openstack/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-openstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-openstack/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-openstack/releases{/id}","created_at":"2015-07-13T10:55:33Z","updated_at":"2015-12-29T20:40:38Z","pushed_at":"2016-01-05T14:28:20Z","git_url":"git://github.com/crowbar/crowbar-openstack.git","ssh_url":"git@github.com:crowbar/crowbar-openstack.git","clone_url":"https://github.com/crowbar/crowbar-openstack.git","svn_url":"https://github.com/crowbar/crowbar-openstack","homepage":null,"size":16018,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":37,"forks":20,"open_issues":37,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170"},"html":{"href":"https://github.com/crowbar/crowbar-openstack/pull/170"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/170"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-openstack/statuses/a3a216672108a3730cf3997e590d690c6b0a2412"}}}}