{"action":"created","comment":{"url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/comments/83836800","pull_request_review_id":4652857,"id":83836800,"diff_hunk":"@@ -0,0 +1,269 @@\n+\n+{%- macro load_grains_file(grains_fragment_file) %}{% include grains_fragment_file %}{% endmacro %}\n+\n+{%- macro service_config(service_name) %}\n+\n+{%- set server = salt['pillar.get']('heka:'+service_name) %}\n+\n+{%- if server.enabled %}\n+\n+heka_{{ service_name }}_log_file:\n+  file.managed:\n+  - name: /var/log/{{ service_name }}.log\n+  - user: heka\n+  - mode: 750\n+  - replace: False\n+\n+heka_{{ service_name }}_conf_dir:\n+  file.directory:\n+  - name: /etc/{{ service_name }}\n+  - user: root\n+  - mode: 750\n+  - makedirs: true\n+\n+heka_{{ service_name }}_conf_dir_clean:\n+  file.directory:\n+  - name: /etc/{{ service_name }}\n+  - clean: true\n+\n+{%- if grains.get('init', None) == 'systemd' %}\n+\n+heka_{{ service_name }}_service_file:\n+  file.managed:\n+  - name: /etc/init/{{ service_name }}.conf\n+  - user: root\n+  - mode: 644\n+  - template: jinja\n+\n+{%- else %}\n+\n+heka_{{ service_name }}_service_file:\n+  file.managed:\n+  - name: /etc/init/{{ service_name }}.conf\n+  - user: root\n+  - mode: 644\n+  - template: jinja\n+\n+heka_{{ service_name }}_service_wrapper:\n+  file.managed:\n+  - name: /usr/local/bin/{{ service_name }}.log\n+  - user: root\n+  - mode: 755\n+  - template: jinja\n+\n+{%- endif %}\n+\n+\n+{# Setup basic structure for all roles so updates can apply #}\n+\n+{%- set service_grains = {\n+  'heka': {\n+    'log_collector': {\n+      'decoder': {},\n+      'input': {},\n+      'filter': {}\n+    },\n+    'metric_collector': {\n+      'decoder': {},\n+      'input': {},\n+      'filter': {}\n+    },\n+    'remote_collector': {\n+      'decoder': {},\n+      'input': {},\n+      'filter': {}\n+    },\n+    'aggregator': {\n+      'decoder': {},\n+      'input': {},\n+      'filter': {}\n+    }\n+  }\n+} %}\n+\n+\n+{# Loading the other services' support metadata for local roles #}\n+\n+{%- if service_name in ['log_collector', 'metric_collector'] %}\n+\n+{%- for service_name, service in pillar.items() %}\n+{%- if service.get('_support', {}).get('heka', {}).get('enabled', False) %}\n+\n+{%- set grains_fragment_file = service_name+'/meta/heka.yml' %}\n+{%- set grains_yaml = load_grains_file(grains_fragment_file)|load_yaml %}\n+{%- set _dummy = service_grains.heka.update(grains_yaml) %}\n+\n+{%- endif %}\n+{%- endfor %}\n+\n+{%- endif %}\n+\n+\n+{# Loading the other services' support metadata from salt-mine #}\n+\n+{%- if service_name in ['remote_collector', 'aggregator'] %}\n+\n+{%- for node_name, node_grains in salt['mine.get']('*', 'grains.items').iteritems() %}\n+{%- if node_grains.heka is defined %}\n+\n+{%- set _dummy = service_grains.heka.update(node_grains.heka) %}\n+\n+{%- endif %}\n+{%- endfor %}\n+\n+{%- endif %}\n+\n+\n+{# Overriding aggregated metadata from user-space pillar data #}\n+\n+{%- for service_grain_name, service_grain in service_grains.items() %}\n+{% if salt['pillar.get']('heka:'+service_grain_name) %}\n+\n+{%- for service_action_name, service_action in service_grain.items() %}\n+{%- if salt['pillar.get']('heka:'+service_grain_name).get(service_action_name, False) is mapping %}\n+{%- set _dummy = service_grains.heka.[service_grain_name].[service_action_name].update(salt['pillar.get']('heka:'+service_grain_name+':'+service_action_name)) %}","path":"heka/_service.sls","position":124,"original_position":124,"commit_id":"e5d08bc8575f7b9a7f9ff6cca729aedad287a3de","original_commit_id":"e5d08bc8575f7b9a7f9ff6cca729aedad287a3de","user":{"login":"fpytloun","id":948799,"avatar_url":"https://avatars.githubusercontent.com/u/948799?v=3","gravatar_id":"","url":"https://api.github.com/users/fpytloun","html_url":"https://github.com/fpytloun","followers_url":"https://api.github.com/users/fpytloun/followers","following_url":"https://api.github.com/users/fpytloun/following{/other_user}","gists_url":"https://api.github.com/users/fpytloun/gists{/gist_id}","starred_url":"https://api.github.com/users/fpytloun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpytloun/subscriptions","organizations_url":"https://api.github.com/users/fpytloun/orgs","repos_url":"https://api.github.com/users/fpytloun/repos","events_url":"https://api.github.com/users/fpytloun/events{/privacy}","received_events_url":"https://api.github.com/users/fpytloun/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2016-10-18T11:55:10Z","updated_at":"2016-10-18T11:55:10Z","html_url":"https://github.com/tcpcloud/salt-formula-heka/pull/1#discussion_r83836800","pull_request_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/comments/83836800"},"html":{"href":"https://github.com/tcpcloud/salt-formula-heka/pull/1#discussion_r83836800"},"pull_request":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1","id":88980360,"html_url":"https://github.com/tcpcloud/salt-formula-heka/pull/1","diff_url":"https://github.com/tcpcloud/salt-formula-heka/pull/1.diff","patch_url":"https://github.com/tcpcloud/salt-formula-heka/pull/1.patch","issue_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/1","number":1,"state":"open","locked":false,"title":"WIP: Stacklight integration","user":{"login":"cznewt","id":1389088,"avatar_url":"https://avatars.githubusercontent.com/u/1389088?v=3","gravatar_id":"","url":"https://api.github.com/users/cznewt","html_url":"https://github.com/cznewt","followers_url":"https://api.github.com/users/cznewt/followers","following_url":"https://api.github.com/users/cznewt/following{/other_user}","gists_url":"https://api.github.com/users/cznewt/gists{/gist_id}","starred_url":"https://api.github.com/users/cznewt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cznewt/subscriptions","organizations_url":"https://api.github.com/users/cznewt/orgs","repos_url":"https://api.github.com/users/cznewt/repos","events_url":"https://api.github.com/users/cznewt/events{/privacy}","received_events_url":"https://api.github.com/users/cznewt/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-12T09:18:34Z","updated_at":"2016-10-18T11:55:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6426bd3861ab0a935f2a50b256a094dda698995c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1/commits","review_comments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1/comments","review_comment_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/1/comments","statuses_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/statuses/e5d08bc8575f7b9a7f9ff6cca729aedad287a3de","head":{"label":"tcpcloud:stacklight","ref":"stacklight","sha":"e5d08bc8575f7b9a7f9ff6cca729aedad287a3de","user":{"login":"tcpcloud","id":8155954,"avatar_url":"https://avatars.githubusercontent.com/u/8155954?v=3","gravatar_id":"","url":"https://api.github.com/users/tcpcloud","html_url":"https://github.com/tcpcloud","followers_url":"https://api.github.com/users/tcpcloud/followers","following_url":"https://api.github.com/users/tcpcloud/following{/other_user}","gists_url":"https://api.github.com/users/tcpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/tcpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcpcloud/subscriptions","organizations_url":"https://api.github.com/users/tcpcloud/orgs","repos_url":"https://api.github.com/users/tcpcloud/repos","events_url":"https://api.github.com/users/tcpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/tcpcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":43812591,"name":"salt-formula-heka","full_name":"tcpcloud/salt-formula-heka","owner":{"login":"tcpcloud","id":8155954,"avatar_url":"https://avatars.githubusercontent.com/u/8155954?v=3","gravatar_id":"","url":"https://api.github.com/users/tcpcloud","html_url":"https://github.com/tcpcloud","followers_url":"https://api.github.com/users/tcpcloud/followers","following_url":"https://api.github.com/users/tcpcloud/following{/other_user}","gists_url":"https://api.github.com/users/tcpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/tcpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcpcloud/subscriptions","organizations_url":"https://api.github.com/users/tcpcloud/orgs","repos_url":"https://api.github.com/users/tcpcloud/repos","events_url":"https://api.github.com/users/tcpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/tcpcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tcpcloud/salt-formula-heka","description":null,"fork":false,"url":"https://api.github.com/repos/tcpcloud/salt-formula-heka","forks_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/forks","keys_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/teams","hooks_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/hooks","issue_events_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/events{/number}","events_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/events","assignees_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/assignees{/user}","branches_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/branches{/branch}","tags_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/tags","blobs_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/refs{/sha}","trees_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/statuses/{sha}","languages_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/languages","stargazers_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/stargazers","contributors_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/contributors","subscribers_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/subscribers","subscription_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/subscription","commits_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/commits{/sha}","git_commits_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/commits{/sha}","comments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/comments{/number}","issue_comment_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/comments{/number}","contents_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/contents/{+path}","compare_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/merges","archive_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/downloads","issues_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues{/number}","pulls_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls{/number}","milestones_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/milestones{/number}","notifications_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/labels{/name}","releases_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/releases{/id}","deployments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/deployments","created_at":"2015-10-07T12:01:53Z","updated_at":"2016-02-07T20:56:22Z","pushed_at":"2016-10-18T11:12:08Z","git_url":"git://github.com/tcpcloud/salt-formula-heka.git","ssh_url":"git@github.com:tcpcloud/salt-formula-heka.git","clone_url":"https://github.com/tcpcloud/salt-formula-heka.git","svn_url":"https://github.com/tcpcloud/salt-formula-heka","homepage":null,"size":219,"stargazers_count":1,"watchers_count":1,"language":"SaltStack","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"tcpcloud:master","ref":"master","sha":"41a41d43c5cc5960ae0930c9332b62bc0446b77d","user":{"login":"tcpcloud","id":8155954,"avatar_url":"https://avatars.githubusercontent.com/u/8155954?v=3","gravatar_id":"","url":"https://api.github.com/users/tcpcloud","html_url":"https://github.com/tcpcloud","followers_url":"https://api.github.com/users/tcpcloud/followers","following_url":"https://api.github.com/users/tcpcloud/following{/other_user}","gists_url":"https://api.github.com/users/tcpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/tcpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcpcloud/subscriptions","organizations_url":"https://api.github.com/users/tcpcloud/orgs","repos_url":"https://api.github.com/users/tcpcloud/repos","events_url":"https://api.github.com/users/tcpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/tcpcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":43812591,"name":"salt-formula-heka","full_name":"tcpcloud/salt-formula-heka","owner":{"login":"tcpcloud","id":8155954,"avatar_url":"https://avatars.githubusercontent.com/u/8155954?v=3","gravatar_id":"","url":"https://api.github.com/users/tcpcloud","html_url":"https://github.com/tcpcloud","followers_url":"https://api.github.com/users/tcpcloud/followers","following_url":"https://api.github.com/users/tcpcloud/following{/other_user}","gists_url":"https://api.github.com/users/tcpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/tcpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcpcloud/subscriptions","organizations_url":"https://api.github.com/users/tcpcloud/orgs","repos_url":"https://api.github.com/users/tcpcloud/repos","events_url":"https://api.github.com/users/tcpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/tcpcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tcpcloud/salt-formula-heka","description":null,"fork":false,"url":"https://api.github.com/repos/tcpcloud/salt-formula-heka","forks_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/forks","keys_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/teams","hooks_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/hooks","issue_events_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/events{/number}","events_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/events","assignees_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/assignees{/user}","branches_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/branches{/branch}","tags_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/tags","blobs_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/refs{/sha}","trees_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/statuses/{sha}","languages_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/languages","stargazers_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/stargazers","contributors_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/contributors","subscribers_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/subscribers","subscription_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/subscription","commits_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/commits{/sha}","git_commits_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/git/commits{/sha}","comments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/comments{/number}","issue_comment_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/comments{/number}","contents_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/contents/{+path}","compare_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/merges","archive_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/downloads","issues_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues{/number}","pulls_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls{/number}","milestones_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/milestones{/number}","notifications_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/labels{/name}","releases_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/releases{/id}","deployments_url":"https://api.github.com/repos/tcpcloud/salt-formula-heka/deployments","created_at":"2015-10-07T12:01:53Z","updated_at":"2016-02-07T20:56:22Z","pushed_at":"2016-10-18T11:12:08Z","git_url":"git://github.com/tcpcloud/salt-formula-heka.git","ssh_url":"git@github.com:tcpcloud/salt-formula-heka.git","clone_url":"https://github.com/tcpcloud/salt-formula-heka.git","svn_url":"https://github.com/tcpcloud/salt-formula-heka","homepage":null,"size":219,"stargazers_count":1,"watchers_count":1,"language":"SaltStack","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1"},"html":{"href":"https://github.com/tcpcloud/salt-formula-heka/pull/1"},"issue":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/1"},"comments":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/tcpcloud/salt-formula-heka/statuses/e5d08bc8575f7b9a7f9ff6cca729aedad287a3de"}}}}
{"actor":{"display_login":"fpytloun"}}