{"action":"created","comment":{"url":"https://api.github.com/repos/theforeman/kafo/pulls/comments/41736507","id":41736507,"diff_hunk":"@@ -108,6 +115,7 @@ def execute\n         store_params(temp_config_file)\n       else\n         store_params\n+        self.class.scenario_manager.link_last_scenario(self.class.config_file) if defined?(CONFIG_DIR)","path":"lib/kafo/kafo_configure.rb","position":43,"original_position":43,"commit_id":"68a2dd6cd253215506111cefcbf9eb93ef0de9be","original_commit_id":"68a2dd6cd253215506111cefcbf9eb93ef0de9be","user":{"login":"ares","id":109773,"avatar_url":"https://avatars.githubusercontent.com/u/109773?v=3","gravatar_id":"","url":"https://api.github.com/users/ares","html_url":"https://github.com/ares","followers_url":"https://api.github.com/users/ares/followers","following_url":"https://api.github.com/users/ares/following{/other_user}","gists_url":"https://api.github.com/users/ares/gists{/gist_id}","starred_url":"https://api.github.com/users/ares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ares/subscriptions","organizations_url":"https://api.github.com/users/ares/orgs","repos_url":"https://api.github.com/users/ares/repos","events_url":"https://api.github.com/users/ares/events{/privacy}","received_events_url":"https://api.github.com/users/ares/received_events","type":"User","site_admin":false},"body":"could you extract `defined?(CONFIG_DIR)` to some scenario manager method? it's used on multiple places.","created_at":"2015-10-12T09:07:53Z","updated_at":"2015-10-12T09:07:53Z","html_url":"https://github.com/theforeman/kafo/pull/117#discussion_r41736507","pull_request_url":"https://api.github.com/repos/theforeman/kafo/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/comments/41736507"},"html":{"href":"https://github.com/theforeman/kafo/pull/117#discussion_r41736507"},"pull_request":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/theforeman/kafo/pulls/117","id":42811162,"html_url":"https://github.com/theforeman/kafo/pull/117","diff_url":"https://github.com/theforeman/kafo/pull/117.diff","patch_url":"https://github.com/theforeman/kafo/pull/117.patch","issue_url":"https://api.github.com/repos/theforeman/kafo/issues/117","number":117,"state":"open","locked":false,"title":"Fixes #10162 - Added scenario support","user":{"login":"mbacovsky","id":1648174,"avatar_url":"https://avatars.githubusercontent.com/u/1648174?v=3","gravatar_id":"","url":"https://api.github.com/users/mbacovsky","html_url":"https://github.com/mbacovsky","followers_url":"https://api.github.com/users/mbacovsky/followers","following_url":"https://api.github.com/users/mbacovsky/following{/other_user}","gists_url":"https://api.github.com/users/mbacovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/mbacovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbacovsky/subscriptions","organizations_url":"https://api.github.com/users/mbacovsky/orgs","repos_url":"https://api.github.com/users/mbacovsky/repos","events_url":"https://api.github.com/users/mbacovsky/events{/privacy}","received_events_url":"https://api.github.com/users/mbacovsky/received_events","type":"User","site_admin":false},"body":"The PR contains implementation of scenarios. Things that are missing follows:\r\n * [x] tests\r\n * [x] code clean up\r\n * [ ] ~~handling of installation with different scenario (exit vs. answer file merge)~~ will be addressed in separate PR\r\n * [x] support for existing config file foremat (so that existing foreman_installer can run with new Kafo)\r\n * [x] KafoWizards packaging https://github.com/theforeman/kafo_wizards\r\n\r\nSummary of changes:\r\n * Foreman installer binary should be replaced with \r\n```ruby\r\n#!/usr/bin/env ruby\r\nrequire 'rubygems'\r\nrequire 'kafo'\r\n\r\n# where to find scenarios\r\nCONFIG_DIR = '/etc/foreman/installer-scenarios.d/'\r\n\r\n# Run the install\r\n@result = Kafo::KafoConfigure.run\r\n\r\n# handle exit code when help was invoked or installer ended with '2' (success in puppet)\r\nif @result.nil? || (!@result.config.app[:detailed_exitcodes] && @result.exit_code == 2)\r\n  exit(0)\r\nelse\r\n  exit(@result.exit_code)\r\nend\r\n```\r\nthis is dropping support for config files in ./config. Do we want it?\r\n\r\n * config directory was changed to \r\n```\r\n/etc/foreman\r\n├── installer-scenarios.d\r\n│   ├── foreman-installer-answers.yaml\r\n│   ├── foreman-installer.yaml\r\n│   ├── foreman-proxy-answers.yaml\r\n│   ├── foreman-proxy.yaml\r\n│   └── last_scenario.yaml -> /etc/foreman/installer-scenarios.d/foreman-proxy.yaml\r\n...\r\n```\r\n * Config file format changes:\r\n   * `:modules_dir` was renamed to `:module_dirs` and should be array. (`:modules_dir` still works)\r\n   * `:name` is mandatory name of the scenario\r\n   * `:description` optional scenario description\r\n   * `:check_dirs` was added accepting list of dirs with checks, defaults to current (installer_root)/checks \r\n\r\nMapping stays unchanged, installer is looking for the manifests in the module_dirs (first occurence is used). I hope puppet does the same later :) (needs to be checked)  \r\n\r\n * There are two new `foreman-installer` options and the behavior changed slightly\r\n```\r\n$> foreman-installer\r\nScenario was not selected, can not continue. Use --list-scenarios to list available options.\r\n```\r\n\r\nList of scenarios\r\n```\r\n$> foreman-installer --list-scenarios\r\nAvailable scenarios\r\n  Foreman (use: --scenario foreman-installer)\r\n        Basic and most generic installation of Foreman\r\n  Foreman Proxy (use: --scenario foreman-proxy)\r\n        Install Foreman proxy without Foreman\r\n```\r\n\r\nInstaller help\r\n```\r\n$> foreman-installer --scenario foreman-proxy -h\r\nUsage:\r\n    foreman-installer [OPTIONS]\r\n\r\nOptions:\r\n\r\n= Generic:\r\n     ...\r\n    -S, --scenario SCENARIO       Use installation scenario\r\n    --list-scenarios LIST_SCENARIOS List available installation scenaraios\r\n    ...\r\n```\r\n\r\nInstaller in interactive mode\r\n```\r\n$> foreman-installer -i\r\n\r\nSelect installation scenario\r\n\r\nPlease select one of the pre-set installation scenarios. You can customize your installtion later during the installtion.\r\n\r\nAvailable actions:\r\n1. Foreman: Basic and most generic installation of Foreman\r\n2. Foreman Proxy: Install Foreman proxy without Foreman\r\n3. Cancel Installation\r\nYour choice: \r\n```\r\n\r\nSample installer run\r\n```\r\n$> foreman-installer --scenario foreman-proxy\r\n /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[scenarios.my.lan]: Could not evaluate: Proxy scenarios.my.lan cannot be registered (401 Unauthorized): N/A\r\nInstalling             Done                                               [100%] [...............................................................................................................................]\r\n  Something went wrong! Check the log for ERROR-level output\r\n  * Foreman Proxy is running at https://scenarios.my.lan:8443\r\n  The full log is at /var/log/foreman-installer/foreman-installer.log\r\n```\r\n\r\n","created_at":"2015-08-19T13:01:09Z","updated_at":"2015-10-12T09:07:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3236f0e086d112ac2161e862b34fd7319bc9a797","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/theforeman/kafo/pulls/117/commits","review_comments_url":"https://api.github.com/repos/theforeman/kafo/pulls/117/comments","review_comment_url":"https://api.github.com/repos/theforeman/kafo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/theforeman/kafo/issues/117/comments","statuses_url":"https://api.github.com/repos/theforeman/kafo/statuses/68a2dd6cd253215506111cefcbf9eb93ef0de9be","head":{"label":"mbacovsky:10162_scenarios","ref":"10162_scenarios","sha":"68a2dd6cd253215506111cefcbf9eb93ef0de9be","user":{"login":"mbacovsky","id":1648174,"avatar_url":"https://avatars.githubusercontent.com/u/1648174?v=3","gravatar_id":"","url":"https://api.github.com/users/mbacovsky","html_url":"https://github.com/mbacovsky","followers_url":"https://api.github.com/users/mbacovsky/followers","following_url":"https://api.github.com/users/mbacovsky/following{/other_user}","gists_url":"https://api.github.com/users/mbacovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/mbacovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbacovsky/subscriptions","organizations_url":"https://api.github.com/users/mbacovsky/orgs","repos_url":"https://api.github.com/users/mbacovsky/repos","events_url":"https://api.github.com/users/mbacovsky/events{/privacy}","received_events_url":"https://api.github.com/users/mbacovsky/received_events","type":"User","site_admin":false},"repo":{"id":26009060,"name":"kafo","full_name":"mbacovsky/kafo","owner":{"login":"mbacovsky","id":1648174,"avatar_url":"https://avatars.githubusercontent.com/u/1648174?v=3","gravatar_id":"","url":"https://api.github.com/users/mbacovsky","html_url":"https://github.com/mbacovsky","followers_url":"https://api.github.com/users/mbacovsky/followers","following_url":"https://api.github.com/users/mbacovsky/following{/other_user}","gists_url":"https://api.github.com/users/mbacovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/mbacovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbacovsky/subscriptions","organizations_url":"https://api.github.com/users/mbacovsky/orgs","repos_url":"https://api.github.com/users/mbacovsky/repos","events_url":"https://api.github.com/users/mbacovsky/events{/privacy}","received_events_url":"https://api.github.com/users/mbacovsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mbacovsky/kafo","description":"A gem for making installations based on puppet user friendly","fork":true,"url":"https://api.github.com/repos/mbacovsky/kafo","forks_url":"https://api.github.com/repos/mbacovsky/kafo/forks","keys_url":"https://api.github.com/repos/mbacovsky/kafo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbacovsky/kafo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbacovsky/kafo/teams","hooks_url":"https://api.github.com/repos/mbacovsky/kafo/hooks","issue_events_url":"https://api.github.com/repos/mbacovsky/kafo/issues/events{/number}","events_url":"https://api.github.com/repos/mbacovsky/kafo/events","assignees_url":"https://api.github.com/repos/mbacovsky/kafo/assignees{/user}","branches_url":"https://api.github.com/repos/mbacovsky/kafo/branches{/branch}","tags_url":"https://api.github.com/repos/mbacovsky/kafo/tags","blobs_url":"https://api.github.com/repos/mbacovsky/kafo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbacovsky/kafo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbacovsky/kafo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbacovsky/kafo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbacovsky/kafo/statuses/{sha}","languages_url":"https://api.github.com/repos/mbacovsky/kafo/languages","stargazers_url":"https://api.github.com/repos/mbacovsky/kafo/stargazers","contributors_url":"https://api.github.com/repos/mbacovsky/kafo/contributors","subscribers_url":"https://api.github.com/repos/mbacovsky/kafo/subscribers","subscription_url":"https://api.github.com/repos/mbacovsky/kafo/subscription","commits_url":"https://api.github.com/repos/mbacovsky/kafo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbacovsky/kafo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbacovsky/kafo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbacovsky/kafo/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbacovsky/kafo/contents/{+path}","compare_url":"https://api.github.com/repos/mbacovsky/kafo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbacovsky/kafo/merges","archive_url":"https://api.github.com/repos/mbacovsky/kafo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbacovsky/kafo/downloads","issues_url":"https://api.github.com/repos/mbacovsky/kafo/issues{/number}","pulls_url":"https://api.github.com/repos/mbacovsky/kafo/pulls{/number}","milestones_url":"https://api.github.com/repos/mbacovsky/kafo/milestones{/number}","notifications_url":"https://api.github.com/repos/mbacovsky/kafo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbacovsky/kafo/labels{/name}","releases_url":"https://api.github.com/repos/mbacovsky/kafo/releases{/id}","created_at":"2014-10-31T09:00:07Z","updated_at":"2014-10-09T18:13:29Z","pushed_at":"2015-10-08T08:44:11Z","git_url":"git://github.com/mbacovsky/kafo.git","ssh_url":"git@github.com:mbacovsky/kafo.git","clone_url":"https://github.com/mbacovsky/kafo.git","svn_url":"https://github.com/mbacovsky/kafo","homepage":null,"size":614,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":false,"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":"theforeman:master","ref":"master","sha":"ee69985de455c05cd568d2b1be20d04be212e6d5","user":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"repo":{"id":12378385,"name":"kafo","full_name":"theforeman/kafo","owner":{"login":"theforeman","id":1439844,"avatar_url":"https://avatars.githubusercontent.com/u/1439844?v=3","gravatar_id":"","url":"https://api.github.com/users/theforeman","html_url":"https://github.com/theforeman","followers_url":"https://api.github.com/users/theforeman/followers","following_url":"https://api.github.com/users/theforeman/following{/other_user}","gists_url":"https://api.github.com/users/theforeman/gists{/gist_id}","starred_url":"https://api.github.com/users/theforeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theforeman/subscriptions","organizations_url":"https://api.github.com/users/theforeman/orgs","repos_url":"https://api.github.com/users/theforeman/repos","events_url":"https://api.github.com/users/theforeman/events{/privacy}","received_events_url":"https://api.github.com/users/theforeman/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/theforeman/kafo","description":"A gem for making installations based on puppet user friendly","fork":false,"url":"https://api.github.com/repos/theforeman/kafo","forks_url":"https://api.github.com/repos/theforeman/kafo/forks","keys_url":"https://api.github.com/repos/theforeman/kafo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/theforeman/kafo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/theforeman/kafo/teams","hooks_url":"https://api.github.com/repos/theforeman/kafo/hooks","issue_events_url":"https://api.github.com/repos/theforeman/kafo/issues/events{/number}","events_url":"https://api.github.com/repos/theforeman/kafo/events","assignees_url":"https://api.github.com/repos/theforeman/kafo/assignees{/user}","branches_url":"https://api.github.com/repos/theforeman/kafo/branches{/branch}","tags_url":"https://api.github.com/repos/theforeman/kafo/tags","blobs_url":"https://api.github.com/repos/theforeman/kafo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/theforeman/kafo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/theforeman/kafo/git/refs{/sha}","trees_url":"https://api.github.com/repos/theforeman/kafo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/theforeman/kafo/statuses/{sha}","languages_url":"https://api.github.com/repos/theforeman/kafo/languages","stargazers_url":"https://api.github.com/repos/theforeman/kafo/stargazers","contributors_url":"https://api.github.com/repos/theforeman/kafo/contributors","subscribers_url":"https://api.github.com/repos/theforeman/kafo/subscribers","subscription_url":"https://api.github.com/repos/theforeman/kafo/subscription","commits_url":"https://api.github.com/repos/theforeman/kafo/commits{/sha}","git_commits_url":"https://api.github.com/repos/theforeman/kafo/git/commits{/sha}","comments_url":"https://api.github.com/repos/theforeman/kafo/comments{/number}","issue_comment_url":"https://api.github.com/repos/theforeman/kafo/issues/comments{/number}","contents_url":"https://api.github.com/repos/theforeman/kafo/contents/{+path}","compare_url":"https://api.github.com/repos/theforeman/kafo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/theforeman/kafo/merges","archive_url":"https://api.github.com/repos/theforeman/kafo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/theforeman/kafo/downloads","issues_url":"https://api.github.com/repos/theforeman/kafo/issues{/number}","pulls_url":"https://api.github.com/repos/theforeman/kafo/pulls{/number}","milestones_url":"https://api.github.com/repos/theforeman/kafo/milestones{/number}","notifications_url":"https://api.github.com/repos/theforeman/kafo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/theforeman/kafo/labels{/name}","releases_url":"https://api.github.com/repos/theforeman/kafo/releases{/id}","created_at":"2013-08-26T12:18:43Z","updated_at":"2015-09-18T18:37:50Z","pushed_at":"2015-10-08T08:44:11Z","git_url":"git://github.com/theforeman/kafo.git","ssh_url":"git@github.com:theforeman/kafo.git","clone_url":"https://github.com/theforeman/kafo.git","svn_url":"https://github.com/theforeman/kafo","homepage":null,"size":2038,"stargazers_count":41,"watchers_count":41,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":4,"forks":23,"open_issues":4,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/117"},"html":{"href":"https://github.com/theforeman/kafo/pull/117"},"issue":{"href":"https://api.github.com/repos/theforeman/kafo/issues/117"},"comments":{"href":"https://api.github.com/repos/theforeman/kafo/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/theforeman/kafo/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/theforeman/kafo/statuses/68a2dd6cd253215506111cefcbf9eb93ef0de9be"}}}}