{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/76397101","id":76397101,"diff_hunk":"@@ -3169,8 +3169,44 @@ def populate(self):\n         return self.facts\n \n     def get_virtual_facts(self):\n-        self.facts['virtualization_type'] = ''\n-        self.facts['virtualization_role'] = ''\n+        sysctl_path = self.module.get_bin_path('sysctl', required=True)","path":"lib/ansible/module_utils/facts.py","position":6,"original_position":6,"commit_id":"1ce043fc710209dd1f312ed6e26ca70ef83c5dd5","original_commit_id":"1ce043fc710209dd1f312ed6e26ca70ef83c5dd5","user":{"login":"eest","id":306237,"avatar_url":"https://avatars.githubusercontent.com/u/306237?v=3","gravatar_id":"","url":"https://api.github.com/users/eest","html_url":"https://github.com/eest","followers_url":"https://api.github.com/users/eest/followers","following_url":"https://api.github.com/users/eest/following{/other_user}","gists_url":"https://api.github.com/users/eest/gists{/gist_id}","starred_url":"https://api.github.com/users/eest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eest/subscriptions","organizations_url":"https://api.github.com/users/eest/orgs","repos_url":"https://api.github.com/users/eest/repos","events_url":"https://api.github.com/users/eest/events{/privacy}","received_events_url":"https://api.github.com/users/eest/received_events","type":"User","site_admin":false},"body":"@bcoca: I tested what would happen if i removed the sysctl binary on a testbox, and noticed the setup-module will already fail, because there are some places where the tool path is hardcoded and this leads to the module erroring out. This means my required=True addition does not make anything worse than it already is.\r\n\r\nIf the real solution is to also replace other instances of hardcoded sysctl paths (which would have to be a separate PR imo), then my question is what the desired behaviour is when the tool is not found: setting the effected fact variables to the empty string, or not setting them at all.","created_at":"2016-08-26T10:18:33Z","updated_at":"2016-08-26T10:18:33Z","html_url":"https://github.com/ansible/ansible/pull/17227#discussion_r76397101","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/17227","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/76397101"},"html":{"href":"https://github.com/ansible/ansible/pull/17227#discussion_r76397101"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17227"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/17227","id":82601359,"html_url":"https://github.com/ansible/ansible/pull/17227","diff_url":"https://github.com/ansible/ansible/pull/17227.diff","patch_url":"https://github.com/ansible/ansible/pull/17227.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/17227","number":17227,"state":"open","locked":false,"title":"Add OpenBSD virtualization facts.","user":{"login":"eest","id":306237,"avatar_url":"https://avatars.githubusercontent.com/u/306237?v=3","gravatar_id":"","url":"https://api.github.com/users/eest","html_url":"https://github.com/eest","followers_url":"https://api.github.com/users/eest/followers","following_url":"https://api.github.com/users/eest/following{/other_user}","gists_url":"https://api.github.com/users/eest/gists{/gist_id}","starred_url":"https://api.github.com/users/eest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eest/subscriptions","organizations_url":"https://api.github.com/users/eest/orgs","repos_url":"https://api.github.com/users/eest/repos","events_url":"https://api.github.com/users/eest/events{/privacy}","received_events_url":"https://api.github.com/users/eest/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n - Feature Pull Request\r\n\r\n##### COMPONENT NAME\r\nfacts\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.2.0 (openbsd_vm_facts df66dc4acc) last updated 2016/08/24 18:15:04 (GMT +200)\r\n  lib/ansible/modules/core: (detached HEAD 2f26352e49) last updated 2016/08/24 18:02:24 (GMT +200)\r\n  lib/ansible/modules/extras: (detached HEAD 65eba72ee6) last updated 2016/08/24 18:02:24 (GMT +200)\r\n  config file = \r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\nAdd OpenBSD virtualization facts.\r\n\r\n<!-- Paste verbatim command output below, e.g. before and after your change -->\r\nBefore:\r\n```\r\n$ ansible -i hosts -u root 192.168.1.60 -m setup | grep ansible_virtual \r\n        \"ansible_virtualization_role\": \"\", \r\n        \"ansible_virtualization_type\": \"\", \r\n\r\n```\r\n\r\nAfter:\r\n```\r\n$ ansible -i hosts -u root 192.168.1.60 -m setup | grep ansible_virtual\r\n        \"ansible_virtualization_role\": \"guest\", \r\n        \"ansible_virtualization_type\": \"virtualbox\", \r\n```\r\n\r\nPatch written by @jasperla.\r\n\r\nTested by various people on:\r\n- virtualbox\r\n- vmware esx(i) + fusion\r\n- kvm (smartos + plain linux + a random cloud provider)\r\n\r\nThis patch is already present in the OpenBSD port of ansible.","created_at":"2016-08-24T19:19:43Z","updated_at":"2016-08-26T10:18:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36d109417b7c2eb8c9fb8762dc2e695528346fb5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/17227/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/17227/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17227/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/1ce043fc710209dd1f312ed6e26ca70ef83c5dd5","head":{"label":"eest:openbsd_vm_facts","ref":"openbsd_vm_facts","sha":"1ce043fc710209dd1f312ed6e26ca70ef83c5dd5","user":{"login":"eest","id":306237,"avatar_url":"https://avatars.githubusercontent.com/u/306237?v=3","gravatar_id":"","url":"https://api.github.com/users/eest","html_url":"https://github.com/eest","followers_url":"https://api.github.com/users/eest/followers","following_url":"https://api.github.com/users/eest/following{/other_user}","gists_url":"https://api.github.com/users/eest/gists{/gist_id}","starred_url":"https://api.github.com/users/eest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eest/subscriptions","organizations_url":"https://api.github.com/users/eest/orgs","repos_url":"https://api.github.com/users/eest/repos","events_url":"https://api.github.com/users/eest/events{/privacy}","received_events_url":"https://api.github.com/users/eest/received_events","type":"User","site_admin":false},"repo":{"id":66478561,"name":"ansible","full_name":"eest/ansible","owner":{"login":"eest","id":306237,"avatar_url":"https://avatars.githubusercontent.com/u/306237?v=3","gravatar_id":"","url":"https://api.github.com/users/eest","html_url":"https://github.com/eest","followers_url":"https://api.github.com/users/eest/followers","following_url":"https://api.github.com/users/eest/following{/other_user}","gists_url":"https://api.github.com/users/eest/gists{/gist_id}","starred_url":"https://api.github.com/users/eest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eest/subscriptions","organizations_url":"https://api.github.com/users/eest/orgs","repos_url":"https://api.github.com/users/eest/repos","events_url":"https://api.github.com/users/eest/events{/privacy}","received_events_url":"https://api.github.com/users/eest/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eest/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/eest/ansible","forks_url":"https://api.github.com/repos/eest/ansible/forks","keys_url":"https://api.github.com/repos/eest/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eest/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eest/ansible/teams","hooks_url":"https://api.github.com/repos/eest/ansible/hooks","issue_events_url":"https://api.github.com/repos/eest/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/eest/ansible/events","assignees_url":"https://api.github.com/repos/eest/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/eest/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/eest/ansible/tags","blobs_url":"https://api.github.com/repos/eest/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eest/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eest/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/eest/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eest/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/eest/ansible/languages","stargazers_url":"https://api.github.com/repos/eest/ansible/stargazers","contributors_url":"https://api.github.com/repos/eest/ansible/contributors","subscribers_url":"https://api.github.com/repos/eest/ansible/subscribers","subscription_url":"https://api.github.com/repos/eest/ansible/subscription","commits_url":"https://api.github.com/repos/eest/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/eest/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/eest/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/eest/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/eest/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/eest/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eest/ansible/merges","archive_url":"https://api.github.com/repos/eest/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eest/ansible/downloads","issues_url":"https://api.github.com/repos/eest/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/eest/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/eest/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/eest/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eest/ansible/labels{/name}","releases_url":"https://api.github.com/repos/eest/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/eest/ansible/deployments","created_at":"2016-08-24T16:00:11Z","updated_at":"2016-08-24T16:00:21Z","pushed_at":"2016-08-25T05:35:58Z","git_url":"git://github.com/eest/ansible.git","ssh_url":"git@github.com:eest/ansible.git","clone_url":"https://github.com/eest/ansible.git","svn_url":"https://github.com/eest/ansible","homepage":"http://ansible.com/","size":35836,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"27b0f3241b2b8397eb626f1770ba34439e121347","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2016-08-26T09:50:43Z","pushed_at":"2016-08-26T08:30:47Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"http://ansible.com/","size":62293,"stargazers_count":18502,"watchers_count":18502,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5613,"mirror_url":null,"open_issues_count":1546,"forks":5613,"open_issues":1546,"watchers":18502,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17227"},"html":{"href":"https://github.com/ansible/ansible/pull/17227"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/17227"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/17227/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17227/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/17227/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/1ce043fc710209dd1f312ed6e26ca70ef83c5dd5"}}}}
{"actor":{"display_login":"eest"}}