{"action":"created","comment":{"url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments/154695424","pull_request_review_id":80896443,"id":154695424,"diff_hunk":"@@ -70,6 +70,56 @@ def create_resource(name)\n end\n \n def update_resource(name)\n+  ops = new_resource.op\n+  op_defaults = CrowbarPacemakerHelper.op_defaults(node)","path":"chef/cookbooks/pacemaker/providers/primitive.rb","position":5,"original_position":5,"commit_id":"45b2da88576a57dd347a8ae41acd61366b8aed42","original_commit_id":"45b2da88576a57dd347a8ae41acd61366b8aed42","user":{"login":"vuntz","id":1758783,"avatar_url":"https://avatars3.githubusercontent.com/u/1758783?v=4","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 should not call something from the crowbar-pacemaker cookbook here.\r\n\r\nCan we simply move this helper method to the pacemaker cookbook?","created_at":"2017-12-04T16:16:08Z","updated_at":"2017-12-04T16:23:47Z","html_url":"https://github.com/crowbar/crowbar-ha/pull/262#discussion_r154695424","pull_request_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments/154695424"},"html":{"href":"https://github.com/crowbar/crowbar-ha/pull/262#discussion_r154695424"},"pull_request":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262"}}},"pull_request":{"url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262","id":147741387,"html_url":"https://github.com/crowbar/crowbar-ha/pull/262","diff_url":"https://github.com/crowbar/crowbar-ha/pull/262.diff","patch_url":"https://github.com/crowbar/crowbar-ha/pull/262.patch","issue_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/262","number":262,"state":"open","locked":false,"title":"Added support for op defaults","user":{"login":"abel-navarro","id":1333236,"avatar_url":"https://avatars1.githubusercontent.com/u/1333236?v=4","gravatar_id":"","url":"https://api.github.com/users/abel-navarro","html_url":"https://github.com/abel-navarro","followers_url":"https://api.github.com/users/abel-navarro/followers","following_url":"https://api.github.com/users/abel-navarro/following{/other_user}","gists_url":"https://api.github.com/users/abel-navarro/gists{/gist_id}","starred_url":"https://api.github.com/users/abel-navarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abel-navarro/subscriptions","organizations_url":"https://api.github.com/users/abel-navarro/orgs","repos_url":"https://api.github.com/users/abel-navarro/repos","events_url":"https://api.github.com/users/abel-navarro/events{/privacy}","received_events_url":"https://api.github.com/users/abel-navarro/received_events","type":"User","site_admin":false},"body":"**pacemaker: added support for op defaults**\r\n\r\nWe needed to add a default option for the pacemaker op defaults. In\r\nparticular we are interested in offering a default for \"op monitor\r\non-fail\" action.\r\n\r\nPacemaker does not offer a configuration option to offer such defaults\r\nfor all resources. There's a way to do it for a single resource with\r\nrsc_defaults, but that is not our case. Also with Pacemaker you could\r\nlink one resource operations to another one with 'id-ref', but in that\r\ncase if you modify the reference resource it will cascade changes to all\r\nother resourced.\r\n\r\nThis approach allows to store in the pacemaker barclamp a default for\r\nop. In this case we are only interested in op monitor but could easily\r\nbe extended later on.\r\n\r\nThis change by itself does not fullfill the requirement. It needs the\r\n'pacemaker-primitive' to read the value we store here.\r\n\r\n**pacemaker: primitive to read global op defaults**\r\n\r\nThe pacemaker_primitive object has been extended in order to add support\r\nfor global 'op monitor on-fail' defaults. In this commit we consider the\r\nbarclamp schema already supports an option to configure the defaults for\r\nthe 'op monitor on-fail' action.\r\n\r\nThe primitive will read that value from the founder node and set it to\r\nall 'op monitor on-fail' actions. Should the user had configured\r\nmanually the defaults (editing the barclamp), then those manually\r\nconfigured values will prevail.\r\n\r\nThis code required the 'op monitor on-fail' attribute to be configured\r\nas a Chef::Node::Attribute class. The main reason is that this class\r\nkeeps the original values configured in the barclamp as well as the new\r\nones, so it is possible to roll-back changes.\r\n\r\nSome barclamps set this attribute as a Hash object. In that case there's\r\nno possible rollback. The behavior in this case will be to not modify\r\nit, in order not to break anything. The user can still manually set the\r\nvalues in that particular barclamp to suit their needs, but not as a\r\nglobal option.","created_at":"2017-10-20T08:10:45Z","updated_at":"2017-12-04T16:23:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45572c16967e6a23794cbf4d93f2df5f6f132768","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262/commits","review_comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262/comments","review_comment_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/262/comments","statuses_url":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/45b2da88576a57dd347a8ae41acd61366b8aed42","head":{"label":"abel-navarro:pacemaker-onfail","ref":"pacemaker-onfail","sha":"45b2da88576a57dd347a8ae41acd61366b8aed42","user":{"login":"abel-navarro","id":1333236,"avatar_url":"https://avatars1.githubusercontent.com/u/1333236?v=4","gravatar_id":"","url":"https://api.github.com/users/abel-navarro","html_url":"https://github.com/abel-navarro","followers_url":"https://api.github.com/users/abel-navarro/followers","following_url":"https://api.github.com/users/abel-navarro/following{/other_user}","gists_url":"https://api.github.com/users/abel-navarro/gists{/gist_id}","starred_url":"https://api.github.com/users/abel-navarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abel-navarro/subscriptions","organizations_url":"https://api.github.com/users/abel-navarro/orgs","repos_url":"https://api.github.com/users/abel-navarro/repos","events_url":"https://api.github.com/users/abel-navarro/events{/privacy}","received_events_url":"https://api.github.com/users/abel-navarro/received_events","type":"User","site_admin":false},"repo":{"id":47201022,"name":"crowbar-ha","full_name":"abel-navarro/crowbar-ha","owner":{"login":"abel-navarro","id":1333236,"avatar_url":"https://avatars1.githubusercontent.com/u/1333236?v=4","gravatar_id":"","url":"https://api.github.com/users/abel-navarro","html_url":"https://github.com/abel-navarro","followers_url":"https://api.github.com/users/abel-navarro/followers","following_url":"https://api.github.com/users/abel-navarro/following{/other_user}","gists_url":"https://api.github.com/users/abel-navarro/gists{/gist_id}","starred_url":"https://api.github.com/users/abel-navarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abel-navarro/subscriptions","organizations_url":"https://api.github.com/users/abel-navarro/orgs","repos_url":"https://api.github.com/users/abel-navarro/repos","events_url":"https://api.github.com/users/abel-navarro/events{/privacy}","received_events_url":"https://api.github.com/users/abel-navarro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abel-navarro/crowbar-ha","description":"HA deployment for Crowbar","fork":true,"url":"https://api.github.com/repos/abel-navarro/crowbar-ha","forks_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/forks","keys_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/teams","hooks_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/hooks","issue_events_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/issues/events{/number}","events_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/events","assignees_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/assignees{/user}","branches_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/branches{/branch}","tags_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/tags","blobs_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/git/refs{/sha}","trees_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/statuses/{sha}","languages_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/languages","stargazers_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/stargazers","contributors_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/contributors","subscribers_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/subscribers","subscription_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/subscription","commits_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/commits{/sha}","git_commits_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/git/commits{/sha}","comments_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/comments{/number}","issue_comment_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/issues/comments{/number}","contents_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/contents/{+path}","compare_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/merges","archive_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/downloads","issues_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/issues{/number}","pulls_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/pulls{/number}","milestones_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/milestones{/number}","notifications_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/labels{/name}","releases_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/releases{/id}","deployments_url":"https://api.github.com/repos/abel-navarro/crowbar-ha/deployments","created_at":"2015-12-01T16:11:29Z","updated_at":"2015-12-01T16:11:30Z","pushed_at":"2017-11-29T17:24:21Z","git_url":"git://github.com/abel-navarro/crowbar-ha.git","ssh_url":"git@github.com:abel-navarro/crowbar-ha.git","clone_url":"https://github.com/abel-navarro/crowbar-ha.git","svn_url":"https://github.com/abel-navarro/crowbar-ha","homepage":"","size":1780,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"crowbar:master","ref":"master","sha":"2590c668d25865049de2f6742544e4dbecf43b5b","user":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars2.githubusercontent.com/u/2910205?v=4","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":39006836,"name":"crowbar-ha","full_name":"crowbar/crowbar-ha","owner":{"login":"crowbar","id":2910205,"avatar_url":"https://avatars2.githubusercontent.com/u/2910205?v=4","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-ha","description":"HA deployment for Crowbar","fork":false,"url":"https://api.github.com/repos/crowbar/crowbar-ha","forks_url":"https://api.github.com/repos/crowbar/crowbar-ha/forks","keys_url":"https://api.github.com/repos/crowbar/crowbar-ha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowbar/crowbar-ha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowbar/crowbar-ha/teams","hooks_url":"https://api.github.com/repos/crowbar/crowbar-ha/hooks","issue_events_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/events{/number}","events_url":"https://api.github.com/repos/crowbar/crowbar-ha/events","assignees_url":"https://api.github.com/repos/crowbar/crowbar-ha/assignees{/user}","branches_url":"https://api.github.com/repos/crowbar/crowbar-ha/branches{/branch}","tags_url":"https://api.github.com/repos/crowbar/crowbar-ha/tags","blobs_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/{sha}","languages_url":"https://api.github.com/repos/crowbar/crowbar-ha/languages","stargazers_url":"https://api.github.com/repos/crowbar/crowbar-ha/stargazers","contributors_url":"https://api.github.com/repos/crowbar/crowbar-ha/contributors","subscribers_url":"https://api.github.com/repos/crowbar/crowbar-ha/subscribers","subscription_url":"https://api.github.com/repos/crowbar/crowbar-ha/subscription","commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowbar/crowbar-ha/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowbar/crowbar-ha/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowbar/crowbar-ha/contents/{+path}","compare_url":"https://api.github.com/repos/crowbar/crowbar-ha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowbar/crowbar-ha/merges","archive_url":"https://api.github.com/repos/crowbar/crowbar-ha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowbar/crowbar-ha/downloads","issues_url":"https://api.github.com/repos/crowbar/crowbar-ha/issues{/number}","pulls_url":"https://api.github.com/repos/crowbar/crowbar-ha/pulls{/number}","milestones_url":"https://api.github.com/repos/crowbar/crowbar-ha/milestones{/number}","notifications_url":"https://api.github.com/repos/crowbar/crowbar-ha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowbar/crowbar-ha/labels{/name}","releases_url":"https://api.github.com/repos/crowbar/crowbar-ha/releases{/id}","deployments_url":"https://api.github.com/repos/crowbar/crowbar-ha/deployments","created_at":"2015-07-13T10:53:43Z","updated_at":"2017-10-12T09:47:51Z","pushed_at":"2017-11-29T21:56:07Z","git_url":"git://github.com/crowbar/crowbar-ha.git","ssh_url":"git@github.com:crowbar/crowbar-ha.git","clone_url":"https://github.com/crowbar/crowbar-ha.git","svn_url":"https://github.com/crowbar/crowbar-ha","homepage":"","size":1585,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":17,"license":null,"forks":32,"open_issues":17,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262"},"html":{"href":"https://github.com/crowbar/crowbar-ha/pull/262"},"issue":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/issues/262"},"comments":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/issues/262/comments"},"review_comments":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262/comments"},"review_comment":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/pulls/262/commits"},"statuses":{"href":"https://api.github.com/repos/crowbar/crowbar-ha/statuses/45b2da88576a57dd347a8ae41acd61366b8aed42"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"vuntz"}}