{"action":"closed","number":63,"pull_request":{"url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63","id":111562351,"html_url":"https://github.com/istresearch/ansible-symphony/pull/63","diff_url":"https://github.com/istresearch/ansible-symphony/pull/63.diff","patch_url":"https://github.com/istresearch/ansible-symphony/pull/63.patch","issue_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/63","number":63,"state":"closed","locked":false,"title":"Nginx es proxy version 2","user":{"login":"joequery","id":503584,"avatar_url":"https://avatars1.githubusercontent.com/u/503584?v=3","gravatar_id":"","url":"https://api.github.com/users/joequery","html_url":"https://github.com/joequery","followers_url":"https://api.github.com/users/joequery/followers","following_url":"https://api.github.com/users/joequery/following{/other_user}","gists_url":"https://api.github.com/users/joequery/gists{/gist_id}","starred_url":"https://api.github.com/users/joequery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joequery/subscriptions","organizations_url":"https://api.github.com/users/joequery/orgs","repos_url":"https://api.github.com/users/joequery/repos","events_url":"https://api.github.com/users/joequery/events{/privacy}","received_events_url":"https://api.github.com/users/joequery/received_events","type":"User","site_admin":false},"body":"This PR does two things:\r\n\r\n1) Creates an nginx role, including an `nginx_conf` module that allows us to easily enable a jinja2 file as an nginx configuration\r\n\r\n2) Configure nginx to serve as a proxy in front of Elasticsearch. \r\n\r\n## Testing\r\n\r\nSet `elasticsearch_nginx_proxy_enabled` to `true`.\r\n\r\nRun the nginx role:\r\n\r\n```shell\r\n$ ansible-playbook -i staging.inventory -u vagrant --tags=\"site-nginx\" --limit=vagrant-as-01 site-infrastructure.yml\r\n```\r\n\r\nRun the elasticsearch role:\r\n\r\n```shell\r\n$ ansible-playbook -i staging.inventory -u vagrant --tags=\"site-elasticsearch\" --limit=vagrant-as-01 site-infrastructure.yml\r\n```\r\n\r\nSSH into the vm\r\n\r\n```shell\r\n$ vagrant ssh vagrant-as-01\r\n```\r\n\r\nVerify you can hit the local ES instance directly on port 9200\r\n\r\n```\r\nvagrant@vagrant-as-01:~$ curl \"http://vagrant-as-01:9200\"\r\n{\r\n  \"name\" : \"vagrant-as-01-master_data\",\r\n  \"cluster_name\" : \"elasticsearch\",\r\n  \"version\" : {\r\n    \"number\" : \"2.3.1\",\r\n    \"build_hash\" : \"bd980929010aef404e7cb0843e61d0665269fc39\",\r\n    \"build_timestamp\" : \"2016-04-04T12:25:05Z\",\r\n    \"build_snapshot\" : false,\r\n    \"lucene_version\" : \"5.5.0\"\r\n  },\r\n  \"tagline\" : \"You Know, for Search\"\r\n}\r\n```\r\n\r\nVerify when you try to hit the nginx proxy running on 9201 without credentials you get rejected\r\n\r\n```\r\nvagrant@vagrant-as-01:~$ curl \"http://vagrant-as-01:9201\"\r\n<html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.4.6 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n```\r\n\r\nVerify the request through the proxy succeeds when the proper credentials are provided\r\n\r\n```\r\nvagrant@vagrant-as-01:~$ curl \"http://user:password@vagrant-as-01:9201\"\r\n{\r\n  \"name\" : \"vagrant-as-01-master_data\",\r\n  \"cluster_name\" : \"elasticsearch\",\r\n  \"version\" : {\r\n    \"number\" : \"2.3.1\",\r\n    \"build_hash\" : \"bd980929010aef404e7cb0843e61d0665269fc39\",\r\n    \"build_timestamp\" : \"2016-04-04T12:25:05Z\",\r\n    \"build_snapshot\" : false,\r\n    \"lucene_version\" : \"5.5.0\"\r\n  },\r\n  \"tagline\" : \"You Know, for Search\"\r\n}\r\n```\r\n\r\nVerify the nginx error and access logs are being written to\r\n\r\n```\r\n$ sudo tail /var/log/nginx/access.log\r\n...\r\n$ sudo tail /var/log/nginx/error.log\r\n...\r\n```","created_at":"2017-03-20T14:19:02Z","updated_at":"2017-03-20T19:45:58Z","closed_at":"2017-03-20T19:45:58Z","merged_at":"2017-03-20T19:45:58Z","merge_commit_sha":"ca90c977316f9cd882801a4e4427b83917e5ae72","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63/commits","review_comments_url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63/comments","review_comment_url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/63/comments","statuses_url":"https://api.github.com/repos/istresearch/ansible-symphony/statuses/b78449982f97424c6537494e792e997d3b773949","head":{"label":"istresearch:nginx_es_proxyv2","ref":"nginx_es_proxyv2","sha":"b78449982f97424c6537494e792e997d3b773949","user":{"login":"istresearch","id":4365304,"avatar_url":"https://avatars2.githubusercontent.com/u/4365304?v=3","gravatar_id":"","url":"https://api.github.com/users/istresearch","html_url":"https://github.com/istresearch","followers_url":"https://api.github.com/users/istresearch/followers","following_url":"https://api.github.com/users/istresearch/following{/other_user}","gists_url":"https://api.github.com/users/istresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/istresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istresearch/subscriptions","organizations_url":"https://api.github.com/users/istresearch/orgs","repos_url":"https://api.github.com/users/istresearch/repos","events_url":"https://api.github.com/users/istresearch/events{/privacy}","received_events_url":"https://api.github.com/users/istresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":49677438,"name":"ansible-symphony","full_name":"istresearch/ansible-symphony","owner":{"login":"istresearch","id":4365304,"avatar_url":"https://avatars2.githubusercontent.com/u/4365304?v=3","gravatar_id":"","url":"https://api.github.com/users/istresearch","html_url":"https://github.com/istresearch","followers_url":"https://api.github.com/users/istresearch/followers","following_url":"https://api.github.com/users/istresearch/following{/other_user}","gists_url":"https://api.github.com/users/istresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/istresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istresearch/subscriptions","organizations_url":"https://api.github.com/users/istresearch/orgs","repos_url":"https://api.github.com/users/istresearch/repos","events_url":"https://api.github.com/users/istresearch/events{/privacy}","received_events_url":"https://api.github.com/users/istresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istresearch/ansible-symphony","description":"Master Ansible repository","fork":false,"url":"https://api.github.com/repos/istresearch/ansible-symphony","forks_url":"https://api.github.com/repos/istresearch/ansible-symphony/forks","keys_url":"https://api.github.com/repos/istresearch/ansible-symphony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istresearch/ansible-symphony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istresearch/ansible-symphony/teams","hooks_url":"https://api.github.com/repos/istresearch/ansible-symphony/hooks","issue_events_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/events{/number}","events_url":"https://api.github.com/repos/istresearch/ansible-symphony/events","assignees_url":"https://api.github.com/repos/istresearch/ansible-symphony/assignees{/user}","branches_url":"https://api.github.com/repos/istresearch/ansible-symphony/branches{/branch}","tags_url":"https://api.github.com/repos/istresearch/ansible-symphony/tags","blobs_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/refs{/sha}","trees_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istresearch/ansible-symphony/statuses/{sha}","languages_url":"https://api.github.com/repos/istresearch/ansible-symphony/languages","stargazers_url":"https://api.github.com/repos/istresearch/ansible-symphony/stargazers","contributors_url":"https://api.github.com/repos/istresearch/ansible-symphony/contributors","subscribers_url":"https://api.github.com/repos/istresearch/ansible-symphony/subscribers","subscription_url":"https://api.github.com/repos/istresearch/ansible-symphony/subscription","commits_url":"https://api.github.com/repos/istresearch/ansible-symphony/commits{/sha}","git_commits_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/commits{/sha}","comments_url":"https://api.github.com/repos/istresearch/ansible-symphony/comments{/number}","issue_comment_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/comments{/number}","contents_url":"https://api.github.com/repos/istresearch/ansible-symphony/contents/{+path}","compare_url":"https://api.github.com/repos/istresearch/ansible-symphony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istresearch/ansible-symphony/merges","archive_url":"https://api.github.com/repos/istresearch/ansible-symphony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istresearch/ansible-symphony/downloads","issues_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues{/number}","pulls_url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls{/number}","milestones_url":"https://api.github.com/repos/istresearch/ansible-symphony/milestones{/number}","notifications_url":"https://api.github.com/repos/istresearch/ansible-symphony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istresearch/ansible-symphony/labels{/name}","releases_url":"https://api.github.com/repos/istresearch/ansible-symphony/releases{/id}","deployments_url":"https://api.github.com/repos/istresearch/ansible-symphony/deployments","created_at":"2016-01-14T21:48:19Z","updated_at":"2017-02-13T22:05:03Z","pushed_at":"2017-03-20T19:45:58Z","git_url":"git://github.com/istresearch/ansible-symphony.git","ssh_url":"git@github.com:istresearch/ansible-symphony.git","clone_url":"https://github.com/istresearch/ansible-symphony.git","svn_url":"https://github.com/istresearch/ansible-symphony","homepage":null,"size":354,"stargazers_count":6,"watchers_count":6,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":6,"default_branch":"master"}},"base":{"label":"istresearch:master","ref":"master","sha":"e733868c00e5023196d251b78e0fa2ff5b37deec","user":{"login":"istresearch","id":4365304,"avatar_url":"https://avatars2.githubusercontent.com/u/4365304?v=3","gravatar_id":"","url":"https://api.github.com/users/istresearch","html_url":"https://github.com/istresearch","followers_url":"https://api.github.com/users/istresearch/followers","following_url":"https://api.github.com/users/istresearch/following{/other_user}","gists_url":"https://api.github.com/users/istresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/istresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istresearch/subscriptions","organizations_url":"https://api.github.com/users/istresearch/orgs","repos_url":"https://api.github.com/users/istresearch/repos","events_url":"https://api.github.com/users/istresearch/events{/privacy}","received_events_url":"https://api.github.com/users/istresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":49677438,"name":"ansible-symphony","full_name":"istresearch/ansible-symphony","owner":{"login":"istresearch","id":4365304,"avatar_url":"https://avatars2.githubusercontent.com/u/4365304?v=3","gravatar_id":"","url":"https://api.github.com/users/istresearch","html_url":"https://github.com/istresearch","followers_url":"https://api.github.com/users/istresearch/followers","following_url":"https://api.github.com/users/istresearch/following{/other_user}","gists_url":"https://api.github.com/users/istresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/istresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istresearch/subscriptions","organizations_url":"https://api.github.com/users/istresearch/orgs","repos_url":"https://api.github.com/users/istresearch/repos","events_url":"https://api.github.com/users/istresearch/events{/privacy}","received_events_url":"https://api.github.com/users/istresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istresearch/ansible-symphony","description":"Master Ansible repository","fork":false,"url":"https://api.github.com/repos/istresearch/ansible-symphony","forks_url":"https://api.github.com/repos/istresearch/ansible-symphony/forks","keys_url":"https://api.github.com/repos/istresearch/ansible-symphony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istresearch/ansible-symphony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istresearch/ansible-symphony/teams","hooks_url":"https://api.github.com/repos/istresearch/ansible-symphony/hooks","issue_events_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/events{/number}","events_url":"https://api.github.com/repos/istresearch/ansible-symphony/events","assignees_url":"https://api.github.com/repos/istresearch/ansible-symphony/assignees{/user}","branches_url":"https://api.github.com/repos/istresearch/ansible-symphony/branches{/branch}","tags_url":"https://api.github.com/repos/istresearch/ansible-symphony/tags","blobs_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/refs{/sha}","trees_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istresearch/ansible-symphony/statuses/{sha}","languages_url":"https://api.github.com/repos/istresearch/ansible-symphony/languages","stargazers_url":"https://api.github.com/repos/istresearch/ansible-symphony/stargazers","contributors_url":"https://api.github.com/repos/istresearch/ansible-symphony/contributors","subscribers_url":"https://api.github.com/repos/istresearch/ansible-symphony/subscribers","subscription_url":"https://api.github.com/repos/istresearch/ansible-symphony/subscription","commits_url":"https://api.github.com/repos/istresearch/ansible-symphony/commits{/sha}","git_commits_url":"https://api.github.com/repos/istresearch/ansible-symphony/git/commits{/sha}","comments_url":"https://api.github.com/repos/istresearch/ansible-symphony/comments{/number}","issue_comment_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues/comments{/number}","contents_url":"https://api.github.com/repos/istresearch/ansible-symphony/contents/{+path}","compare_url":"https://api.github.com/repos/istresearch/ansible-symphony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istresearch/ansible-symphony/merges","archive_url":"https://api.github.com/repos/istresearch/ansible-symphony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istresearch/ansible-symphony/downloads","issues_url":"https://api.github.com/repos/istresearch/ansible-symphony/issues{/number}","pulls_url":"https://api.github.com/repos/istresearch/ansible-symphony/pulls{/number}","milestones_url":"https://api.github.com/repos/istresearch/ansible-symphony/milestones{/number}","notifications_url":"https://api.github.com/repos/istresearch/ansible-symphony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istresearch/ansible-symphony/labels{/name}","releases_url":"https://api.github.com/repos/istresearch/ansible-symphony/releases{/id}","deployments_url":"https://api.github.com/repos/istresearch/ansible-symphony/deployments","created_at":"2016-01-14T21:48:19Z","updated_at":"2017-02-13T22:05:03Z","pushed_at":"2017-03-20T19:45:58Z","git_url":"git://github.com/istresearch/ansible-symphony.git","ssh_url":"git@github.com:istresearch/ansible-symphony.git","clone_url":"https://github.com/istresearch/ansible-symphony.git","svn_url":"https://github.com/istresearch/ansible-symphony","homepage":null,"size":354,"stargazers_count":6,"watchers_count":6,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63"},"html":{"href":"https://github.com/istresearch/ansible-symphony/pull/63"},"issue":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/issues/63"},"comments":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/istresearch/ansible-symphony/statuses/b78449982f97424c6537494e792e997d3b773949"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"joequery","id":503584,"avatar_url":"https://avatars1.githubusercontent.com/u/503584?v=3","gravatar_id":"","url":"https://api.github.com/users/joequery","html_url":"https://github.com/joequery","followers_url":"https://api.github.com/users/joequery/followers","following_url":"https://api.github.com/users/joequery/following{/other_user}","gists_url":"https://api.github.com/users/joequery/gists{/gist_id}","starred_url":"https://api.github.com/users/joequery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joequery/subscriptions","organizations_url":"https://api.github.com/users/joequery/orgs","repos_url":"https://api.github.com/users/joequery/repos","events_url":"https://api.github.com/users/joequery/events{/privacy}","received_events_url":"https://api.github.com/users/joequery/received_events","type":"User","site_admin":false},"comments":5,"review_comments":1,"maintainer_can_modify":false,"commits":9,"additions":247,"deletions":2,"changed_files":11}}
{"actor":{"display_login":"joequery"}}