{"action":"opened","number":318,"pull_request":{"url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318","id":41650235,"html_url":"https://github.com/puppetlabs/razor-server/pull/318","diff_url":"https://github.com/puppetlabs/razor-server/pull/318.diff","patch_url":"https://github.com/puppetlabs/razor-server/pull/318.patch","issue_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/318","number":318,"state":"open","locked":false,"title":"Hostname hook","user":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"body":"One frequently requested feature with hooks is the ability to dynamically\r\nupdate the hostname for a node. The sample hook being added here\r\nwill demonstrate how to do that by updating the node's `hostname` metadata\r\nvalue. Then, the task can refer to this value in its templates in order to\r\nset the hostname.\r\n\r\nThe hook operates by keeping track of the number of nodes bound to each\r\npolicy. The counter for the policy, stored as hook configuration, starts at 1.\r\nWhen a node binds to this policy, the hook increments its `counter`\r\nconfiguration and returns a rendered hostname.\r\n\r\nMore details are included in the file's README.md in the hostname.hook\r\ndirectory.\r\n\r\nFixes https://tickets.puppetlabs.com/browse/RAZOR-642\r\nFixes https://tickets.puppetlabs.com/browse/RAZOR-643","created_at":"2015-08-05T07:26:55Z","updated_at":"2015-08-05T07:26:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/318/comments","statuses_url":"https://api.github.com/repos/puppetlabs/razor-server/statuses/9eea45d6a61201ef4ca9d632f2c3ea8aeeb90abc","head":{"label":"smcclellan:hostname-hook","ref":"hostname-hook","sha":"9eea45d6a61201ef4ca9d632f2c3ea8aeeb90abc","user":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"repo":{"id":17226113,"name":"razor-server","full_name":"smcclellan/razor-server","owner":{"login":"smcclellan","id":6577757,"avatar_url":"https://avatars.githubusercontent.com/u/6577757?v=3","gravatar_id":"","url":"https://api.github.com/users/smcclellan","html_url":"https://github.com/smcclellan","followers_url":"https://api.github.com/users/smcclellan/followers","following_url":"https://api.github.com/users/smcclellan/following{/other_user}","gists_url":"https://api.github.com/users/smcclellan/gists{/gist_id}","starred_url":"https://api.github.com/users/smcclellan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smcclellan/subscriptions","organizations_url":"https://api.github.com/users/smcclellan/orgs","repos_url":"https://api.github.com/users/smcclellan/repos","events_url":"https://api.github.com/users/smcclellan/events{/privacy}","received_events_url":"https://api.github.com/users/smcclellan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smcclellan/razor-server","description":"Razor is next generation provisioning software that handles bare metal hardware and virtual server provisioning","fork":true,"url":"https://api.github.com/repos/smcclellan/razor-server","forks_url":"https://api.github.com/repos/smcclellan/razor-server/forks","keys_url":"https://api.github.com/repos/smcclellan/razor-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smcclellan/razor-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smcclellan/razor-server/teams","hooks_url":"https://api.github.com/repos/smcclellan/razor-server/hooks","issue_events_url":"https://api.github.com/repos/smcclellan/razor-server/issues/events{/number}","events_url":"https://api.github.com/repos/smcclellan/razor-server/events","assignees_url":"https://api.github.com/repos/smcclellan/razor-server/assignees{/user}","branches_url":"https://api.github.com/repos/smcclellan/razor-server/branches{/branch}","tags_url":"https://api.github.com/repos/smcclellan/razor-server/tags","blobs_url":"https://api.github.com/repos/smcclellan/razor-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smcclellan/razor-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smcclellan/razor-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/smcclellan/razor-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smcclellan/razor-server/statuses/{sha}","languages_url":"https://api.github.com/repos/smcclellan/razor-server/languages","stargazers_url":"https://api.github.com/repos/smcclellan/razor-server/stargazers","contributors_url":"https://api.github.com/repos/smcclellan/razor-server/contributors","subscribers_url":"https://api.github.com/repos/smcclellan/razor-server/subscribers","subscription_url":"https://api.github.com/repos/smcclellan/razor-server/subscription","commits_url":"https://api.github.com/repos/smcclellan/razor-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/smcclellan/razor-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/smcclellan/razor-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/smcclellan/razor-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/smcclellan/razor-server/contents/{+path}","compare_url":"https://api.github.com/repos/smcclellan/razor-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smcclellan/razor-server/merges","archive_url":"https://api.github.com/repos/smcclellan/razor-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smcclellan/razor-server/downloads","issues_url":"https://api.github.com/repos/smcclellan/razor-server/issues{/number}","pulls_url":"https://api.github.com/repos/smcclellan/razor-server/pulls{/number}","milestones_url":"https://api.github.com/repos/smcclellan/razor-server/milestones{/number}","notifications_url":"https://api.github.com/repos/smcclellan/razor-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smcclellan/razor-server/labels{/name}","releases_url":"https://api.github.com/repos/smcclellan/razor-server/releases{/id}","created_at":"2014-02-26T21:32:27Z","updated_at":"2015-03-13T23:07:19Z","pushed_at":"2015-08-05T07:26:19Z","git_url":"git://github.com/smcclellan/razor-server.git","ssh_url":"git@github.com:smcclellan/razor-server.git","clone_url":"https://github.com/smcclellan/razor-server.git","svn_url":"https://github.com/smcclellan/razor-server","homepage":"","size":3667,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"puppetlabs:master","ref":"master","sha":"695f51d4f887348e584456c00f6ac5f82411cfb4","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":10631737,"name":"razor-server","full_name":"puppetlabs/razor-server","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/razor-server","description":"Razor is next generation provisioning software that handles bare metal hardware and virtual server provisioning","fork":false,"url":"https://api.github.com/repos/puppetlabs/razor-server","forks_url":"https://api.github.com/repos/puppetlabs/razor-server/forks","keys_url":"https://api.github.com/repos/puppetlabs/razor-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/razor-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/razor-server/teams","hooks_url":"https://api.github.com/repos/puppetlabs/razor-server/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/razor-server/events","assignees_url":"https://api.github.com/repos/puppetlabs/razor-server/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/razor-server/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/razor-server/tags","blobs_url":"https://api.github.com/repos/puppetlabs/razor-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/razor-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/razor-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/razor-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/razor-server/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/razor-server/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/razor-server/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/razor-server/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/razor-server/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/razor-server/subscription","commits_url":"https://api.github.com/repos/puppetlabs/razor-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/razor-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/razor-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/razor-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/razor-server/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/razor-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/razor-server/merges","archive_url":"https://api.github.com/repos/puppetlabs/razor-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/razor-server/downloads","issues_url":"https://api.github.com/repos/puppetlabs/razor-server/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/razor-server/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/razor-server/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/razor-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/razor-server/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/razor-server/releases{/id}","created_at":"2013-06-11T21:55:35Z","updated_at":"2015-08-02T15:09:03Z","pushed_at":"2015-07-30T16:48:05Z","git_url":"git://github.com/puppetlabs/razor-server.git","ssh_url":"git@github.com:puppetlabs/razor-server.git","clone_url":"https://github.com/puppetlabs/razor-server.git","svn_url":"https://github.com/puppetlabs/razor-server","homepage":"","size":6295,"stargazers_count":277,"watchers_count":277,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":16,"forks":99,"open_issues":16,"watchers":277,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318"},"html":{"href":"https://github.com/puppetlabs/razor-server/pull/318"},"issue":{"href":"https://api.github.com/repos/puppetlabs/razor-server/issues/318"},"comments":{"href":"https://api.github.com/repos/puppetlabs/razor-server/issues/318/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/razor-server/pulls/318/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/razor-server/statuses/9eea45d6a61201ef4ca9d632f2c3ea8aeeb90abc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":5,"additions":324,"deletions":89,"changed_files":27}}