{"action":"created","issue":{"url":"https://api.github.com/repos/tmobile/jazz-installer/issues/244","repository_url":"https://api.github.com/repos/tmobile/jazz-installer","labels_url":"https://api.github.com/repos/tmobile/jazz-installer/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/tmobile/jazz-installer/issues/244/comments","events_url":"https://api.github.com/repos/tmobile/jazz-installer/issues/244/events","html_url":"https://github.com/tmobile/jazz-installer/pull/244","id":332594594,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MDQxMTQ3","number":244,"title":"Simplify chef cookbooks some more","user":{"login":"bleggett","id":854255,"node_id":"MDQ6VXNlcjg1NDI1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/854255?v=4","gravatar_id":"","url":"https://api.github.com/users/bleggett","html_url":"https://github.com/bleggett","followers_url":"https://api.github.com/users/bleggett/followers","following_url":"https://api.github.com/users/bleggett/following{/other_user}","gists_url":"https://api.github.com/users/bleggett/gists{/gist_id}","starred_url":"https://api.github.com/users/bleggett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleggett/subscriptions","organizations_url":"https://api.github.com/users/bleggett/orgs","repos_url":"https://api.github.com/users/bleggett/repos","events_url":"https://api.github.com/users/bleggett/events{/privacy}","received_events_url":"https://api.github.com/users/bleggett/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tmobile/jazz-installer/milestones/8","html_url":"https://github.com/tmobile/jazz-installer/milestone/8","labels_url":"https://api.github.com/repos/tmobile/jazz-installer/milestones/8/labels","id":3451377,"node_id":"MDk6TWlsZXN0b25lMzQ1MTM3Nw==","number":8,"title":"v1.8","description":"Show assets and metrics related to the services created using Jazz.","creator":{"login":"suryajak","id":9021084,"node_id":"MDQ6VXNlcjkwMjEwODQ=","avatar_url":"https://avatars3.githubusercontent.com/u/9021084?v=4","gravatar_id":"","url":"https://api.github.com/users/suryajak","html_url":"https://github.com/suryajak","followers_url":"https://api.github.com/users/suryajak/followers","following_url":"https://api.github.com/users/suryajak/following{/other_user}","gists_url":"https://api.github.com/users/suryajak/gists{/gist_id}","starred_url":"https://api.github.com/users/suryajak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suryajak/subscriptions","organizations_url":"https://api.github.com/users/suryajak/orgs","repos_url":"https://api.github.com/users/suryajak/repos","events_url":"https://api.github.com/users/suryajak/events{/privacy}","received_events_url":"https://api.github.com/users/suryajak/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"open","created_at":"2018-06-25T23:48:45Z","updated_at":"2018-06-29T15:35:39Z","due_on":"2018-07-06T07:00:00Z","closed_at":null},"comments":11,"created_at":"2018-06-14T23:08:02Z","updated_at":"2018-07-05T12:49:41Z","closed_at":"2018-06-29T15:35:39Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/tmobile/jazz-installer/pulls/244","html_url":"https://github.com/tmobile/jazz-installer/pull/244","diff_url":"https://github.com/tmobile/jazz-installer/pull/244.diff","patch_url":"https://github.com/tmobile/jazz-installer/pull/244.patch"},"body":"## Changes\r\n- Removed hand-rolled Chef cookbooks for installing npm/maven/aws etc prerequisites on Jenkins server in favor of 3rd-party cookbooks fetched and installed at runtime from the Chef Supermarket. These setup steps now live in the `prereqs.rb` recipe, which runs all the prerequisite installs/setups.\r\n- Moved SonarQube scanner install into its own recipe `sonarqube-scanner.rb`\r\n- Moved provisioning of Jenkins server with Python 2.x out of Terraform and into Chef, also using a 3rd party cookbook.\r\n- Created `cookbooks/Policyfile.rb` which now contains the recipe runlist and the set of external cookbooks to install.\r\n- Bumped ChefDK to 3.0.36 (NOTE: Ideally we would not need to install the entire ChefDK on the Jenkins server, just the client executable, but for now it's fine)\r\n- Deleted some shell scripts and misc cookbook files that were unreferenced and unused.\r\n- Fixed most places where the installer or Terraform reach over into the Chef cookbooks and directly `sed` values into shell scripts that Chef will later run (see below for how we should pass values correctly)\r\n- To get 3rd party cookbooks to work correctly with Chef \"headless\" mode, we have to fetch/install the 3rd party cookbooks and then `chef export` a bundle to a different folder that can be run with `chef-zero`. This forces us to follow Chef best practices and copy all of our scripts to a temp location with `cookbook_file` before executing them, rather than just executing them with a hardcoded fixed path. A future improvement might be to do the `chef-export` on the staging box and just copy over the exported folder, which would mean we would only need `chef-client` to be installed on the Jenkins server and not the whole ChefDK.\r\n\r\n## Where/how to set Terraform and Chef variables.\r\n**As of now, the only Chef-related file that should be touched with `sed` is `cookbooks/jenkins/attributes/default.rb`. This is where all the variables and values that Chef is aware of should live, and any values a script needs should be passed in by Chef from those variables, not `sed`ed into the script from Terraform or the installer.**\r\n\r\nSummary of the layers now:\r\n- **Installer scripts should only set and pass values to Terraform**\r\n-- **Set Terraform values in /jazz-terraform-unix-noinstances/terraform.tfvars**\r\n- **Terraform should only set and pass values to Chef**\r\n-- **Set Chef cookbook values in /cookbooks/jenkins/attributes/default.rb**\r\n\r\nTo keep things tidy recommend we do not break this separation, and reject PRs that do.\r\n\r\n## Adding more 3rd party Chef recipies\r\nIt is easy to add more [3rd party recipes from the Chef Supermarket](https://supermarket.chef.io/) if we need to:\r\n1. Add the new cookbook you want to use to `cookbooks/Policyfile.rb`\r\n2. Edit the `metadata.rb` of the cookbook from which you want to use the external cookbook and add a `depends` line.\r\n3. Use `include_recipe` from your recipe to run the external cookbook's recipe (see `prereqs.rb` recipe for an example of a recipe that includes/runs other recipes). \r\n\r\n----\r\nAm sorry for another large PR, but I am hopeful that this is the last big/systemic change for a while.\r\n"},"comment":{"url":"https://api.github.com/repos/tmobile/jazz-installer/issues/comments/402711027","html_url":"https://github.com/tmobile/jazz-installer/pull/244#issuecomment-402711027","issue_url":"https://api.github.com/repos/tmobile/jazz-installer/issues/244","id":402711027,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjcxMTAyNw==","user":{"login":"rajeevr2715","id":36688599,"node_id":"MDQ6VXNlcjM2Njg4NTk5","avatar_url":"https://avatars3.githubusercontent.com/u/36688599?v=4","gravatar_id":"","url":"https://api.github.com/users/rajeevr2715","html_url":"https://github.com/rajeevr2715","followers_url":"https://api.github.com/users/rajeevr2715/followers","following_url":"https://api.github.com/users/rajeevr2715/following{/other_user}","gists_url":"https://api.github.com/users/rajeevr2715/gists{/gist_id}","starred_url":"https://api.github.com/users/rajeevr2715/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajeevr2715/subscriptions","organizations_url":"https://api.github.com/users/rajeevr2715/orgs","repos_url":"https://api.github.com/users/rajeevr2715/repos","events_url":"https://api.github.com/users/rajeevr2715/events{/privacy}","received_events_url":"https://api.github.com/users/rajeevr2715/received_events","type":"User","site_admin":false},"created_at":"2018-07-05T12:49:41Z","updated_at":"2018-07-05T12:49:41Z","author_association":"COLLABORATOR","body":"@bleggett Yes. \r\n[Chef-error.txt](https://github.com/tmobile/jazz-installer/files/2166594/Chef-error.txt)\r\n\r\n"}}
{"actor":{"display_login":"rajeevr2715"}}