{"action":"created","comment":{"url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/comments/28696280","id":28696280,"diff_hunk":"@@ -0,0 +1,70 @@\n+---\n+# Override some variables\n+- set_fact:\n+    kafka_stunnel_backend_hosts: \"{{kafka_hosts|regex_replace(':.*',':{{kafka_stunnel_server_port}}')}}\"\n+    kafka_hosts: 127.0.0.1:{{kafka_stunnel_client_port}}\n+    is_stunnel_enabled: true","path":"tasks/main.yml","position":6,"original_position":6,"commit_id":"7b75211ce0534db6900d7cdc2c8b72596b57fca9","original_commit_id":"7b75211ce0534db6900d7cdc2c8b72596b57fca9","user":{"login":"tkuhlman","id":150020,"avatar_url":"https://avatars.githubusercontent.com/u/150020?v=3","gravatar_id":"","url":"https://api.github.com/users/tkuhlman","html_url":"https://github.com/tkuhlman","followers_url":"https://api.github.com/users/tkuhlman/followers","following_url":"https://api.github.com/users/tkuhlman/following{/other_user}","gists_url":"https://api.github.com/users/tkuhlman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkuhlman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkuhlman/subscriptions","organizations_url":"https://api.github.com/users/tkuhlman/orgs","repos_url":"https://api.github.com/users/tkuhlman/repos","events_url":"https://api.github.com/users/tkuhlman/events{/privacy}","received_events_url":"https://api.github.com/users/tkuhlman/received_events","type":"User","site_admin":false},"body":"The rewriting of a variable is a bit of a surprising behavior. It is elegant because kafka_hosts can be set for the entire cluster and then each box ends up talking specifically to its proper tunnel. However the behavior is surprising and can be easy to undermine. If any of the roles using this run without this playbook run first they will reconfigure without stunnel. That means you can't call out individual roles by tag, something I commonly do. Additionally I believe (but am not sure) that variables reset between plays of a single playbook. That means you need this role run for each play. It is common to separate plays for example in the test clusters zookeeper runs in an earlier play so kafka and kafka topics can be built before starting up monasca components. Even amoung monasca components thresh runs in its own play as it is targeted at only the master node. You should verify if variables reset across plays in the same run.\r\n\r\nPerhaps a less surprising way for this work would be to utilize [fact caching](http://docs.ansible.com/playbooks_variables.html#fact-caching). This role could then register stunnel_kafka_hosts and cache that fact and the roles needing kafka_hosts pull it from the fact cache. This would allow the relationship to be clear to anyone looking at variables as well as allow using tags, and separate plays.\r\n\r\nEither way the readme could use a more complete explanation of what is happening.","created_at":"2015-04-20T15:03:19Z","updated_at":"2015-04-20T15:03:19Z","html_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1#discussion_r28696280","pull_request_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/comments/28696280"},"html":{"href":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1#discussion_r28696280"},"pull_request":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1","id":33574713,"html_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1","diff_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1.diff","patch_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1.patch","issue_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/1","number":1,"state":"open","locked":false,"title":"Initial commit of ansible-monasca-stunnel role","user":{"login":"davidschroeder","id":5023818,"avatar_url":"https://avatars.githubusercontent.com/u/5023818?v=3","gravatar_id":"","url":"https://api.github.com/users/davidschroeder","html_url":"https://github.com/davidschroeder","followers_url":"https://api.github.com/users/davidschroeder/followers","following_url":"https://api.github.com/users/davidschroeder/following{/other_user}","gists_url":"https://api.github.com/users/davidschroeder/gists{/gist_id}","starred_url":"https://api.github.com/users/davidschroeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidschroeder/subscriptions","organizations_url":"https://api.github.com/users/davidschroeder/orgs","repos_url":"https://api.github.com/users/davidschroeder/repos","events_url":"https://api.github.com/users/davidschroeder/events{/privacy}","received_events_url":"https://api.github.com/users/davidschroeder/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-17T19:29:31Z","updated_at":"2015-04-20T15:03:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a944108f1b8084a157fe4ae919e205ca70b254c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1/commits","review_comments_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1/comments","review_comment_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/1/comments","statuses_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/statuses/7b75211ce0534db6900d7cdc2c8b72596b57fca9","head":{"label":"hpcloud-mon:feature/initial-commit","ref":"feature/initial-commit","sha":"7b75211ce0534db6900d7cdc2c8b72596b57fca9","user":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"repo":{"id":34135409,"name":"ansible-monasca-stunnel","full_name":"hpcloud-mon/ansible-monasca-stunnel","owner":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel","description":"Optional method of encrypting Kafka and Zookeeper communications through stunnel","fork":false,"url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel","forks_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/forks","keys_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/teams","hooks_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/hooks","issue_events_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/events{/number}","events_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/events","assignees_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/assignees{/user}","branches_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/branches{/branch}","tags_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/tags","blobs_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/languages","stargazers_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/stargazers","contributors_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/contributors","subscribers_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/subscribers","subscription_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/subscription","commits_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/contents/{+path}","compare_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/merges","archive_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/downloads","issues_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues{/number}","pulls_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/labels{/name}","releases_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/releases{/id}","created_at":"2015-04-17T19:17:04Z","updated_at":"2015-04-17T19:17:04Z","pushed_at":"2015-04-17T19:29:31Z","git_url":"git://github.com/hpcloud-mon/ansible-monasca-stunnel.git","ssh_url":"git@github.com:hpcloud-mon/ansible-monasca-stunnel.git","clone_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel.git","svn_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hpcloud-mon:master","ref":"master","sha":"8f9ede76b50490d478c08900ca72ef0c4a95653c","user":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"repo":{"id":34135409,"name":"ansible-monasca-stunnel","full_name":"hpcloud-mon/ansible-monasca-stunnel","owner":{"login":"hpcloud-mon","id":7534935,"avatar_url":"https://avatars.githubusercontent.com/u/7534935?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud-mon","html_url":"https://github.com/hpcloud-mon","followers_url":"https://api.github.com/users/hpcloud-mon/followers","following_url":"https://api.github.com/users/hpcloud-mon/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud-mon/subscriptions","organizations_url":"https://api.github.com/users/hpcloud-mon/orgs","repos_url":"https://api.github.com/users/hpcloud-mon/repos","events_url":"https://api.github.com/users/hpcloud-mon/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud-mon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel","description":"Optional method of encrypting Kafka and Zookeeper communications through stunnel","fork":false,"url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel","forks_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/forks","keys_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/teams","hooks_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/hooks","issue_events_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/events{/number}","events_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/events","assignees_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/assignees{/user}","branches_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/branches{/branch}","tags_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/tags","blobs_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/languages","stargazers_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/stargazers","contributors_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/contributors","subscribers_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/subscribers","subscription_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/subscription","commits_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/contents/{+path}","compare_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/merges","archive_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/downloads","issues_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues{/number}","pulls_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/labels{/name}","releases_url":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/releases{/id}","created_at":"2015-04-17T19:17:04Z","updated_at":"2015-04-17T19:17:04Z","pushed_at":"2015-04-17T19:29:31Z","git_url":"git://github.com/hpcloud-mon/ansible-monasca-stunnel.git","ssh_url":"git@github.com:hpcloud-mon/ansible-monasca-stunnel.git","clone_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel.git","svn_url":"https://github.com/hpcloud-mon/ansible-monasca-stunnel","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1"},"html":{"href":"https://github.com/hpcloud-mon/ansible-monasca-stunnel/pull/1"},"issue":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/1"},"comments":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/hpcloud-mon/ansible-monasca-stunnel/statuses/7b75211ce0534db6900d7cdc2c8b72596b57fca9"}}}}