{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/17854","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/17854/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/17854/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/17854/events","html_url":"https://github.com/ansible/ansible/issues/17854","id":180487858,"number":17854,"title":"Windows facts not gathered during check mode","user":{"login":"jborean93","id":8462645,"avatar_url":"https://avatars.githubusercontent.com/u/8462645?v=3","gravatar_id":"","url":"https://api.github.com/users/jborean93","html_url":"https://github.com/jborean93","followers_url":"https://api.github.com/users/jborean93/followers","following_url":"https://api.github.com/users/jborean93/following{/other_user}","gists_url":"https://api.github.com/users/jborean93/gists{/gist_id}","starred_url":"https://api.github.com/users/jborean93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jborean93/subscriptions","organizations_url":"https://api.github.com/users/jborean93/orgs","repos_url":"https://api.github.com/users/jborean93/repos","events_url":"https://api.github.com/users/jborean93/events{/privacy}","received_events_url":"https://api.github.com/users/jborean93/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-02T00:30:03Z","updated_at":"2016-10-02T00:30:03Z","closed_at":null,"body":"##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\nHost fact gathering for Windows\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.2.0 (devel 7e0074263d) last updated 2016/10/02 10:15:29 (GMT +1100)\r\n  lib/ansible/modules/core: (detached HEAD 18f710fe32) last updated 2016/10/02 10:15:41 (GMT +1100)\r\n  lib/ansible/modules/extras: (detached HEAD a58e1d59c0) last updated 2016/10/02 10:15:53 (GMT +1100)\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = ['/usr/share/ansible']\r\n```\r\n\r\n##### CONFIGURATION\r\nNothing custom\r\n\r\n##### OS / ENVIRONMENT\r\nRunning: Bash for Ubuntu on Windows\r\nManaging: Windows Server 2012 R2\r\n\r\n##### SUMMARY\r\nWhen running a playbook in --check mode facts about the host is not gathered like it would with unix hosts in check mode.\r\n\r\n##### STEPS TO REPRODUCE\r\n```\r\nansible-playbook -i inventory.ini windows-facts.yml --check\r\n\r\n- name: debug windows host vars\r\n  hosts: windows\r\n  gather_facts: yes\r\n\r\n  tasks:\r\n    - name: output host facts\r\n      debug:\r\n        var: hostvars[inventory_hostname]\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n```\r\nTASK [output host facts] *******************************************************\r\ntask path: /home/jordan/dev/windows/windows-facts.yml:6\r\nok: [192.168.1.13] => {\r\n    \"hostvars[inventory_hostname]\": {\r\n        \"ansible_architecture\": \"64-bit\",\r\n        \"ansible_bios_date\": \"11/26/2012\",\r\n        \"ansible_bios_version\": \"Hyper-V UEFI Release v1.0\",\r\n        \"ansible_check_mode\": false,\r\n        \"ansible_connection\": \"winrm\",\r\n        \"ansible_date_time\": {\r\n            \"date\": \"2016-10-02\",\r\n            \"day\": \"02\",\r\n            \"epoch\": \"1475407640.25085\",\r\n            \"hour\": \"11\",\r\n            \"iso8601\": \"2016-10-02T00:27:20Z\",\r\n            \"iso8601_basic\": \"20161002T112720235192\",\r\n            \"iso8601_basic_short\": \"20161002T112720\",\r\n            \"iso8601_micro\": \"2016-10-02T00:27:20.235192Z\",\r\n            \"minute\": \"27\",\r\n            \"month\": \"10\",\r\n            \"second\": \"20\",\r\n            \"time\": \"11:27:20\",\r\n            \"tz\": \"AUS Eastern Standard Time\",\r\n            \"tz_offset\": \"+11:00\",\r\n            \"weekday\": \"Sunday\",\r\n            \"weekday_number\": \"0\",\r\n            \"weeknumber\": \"39\",\r\n            \"year\": \"2016\"\r\n        },\r\n        \"ansible_distribution\": \"Microsoft Windows Server 2012 R2 Datacenter\",\r\n        \"ansible_distribution_major_version\": \"6\",\r\n        \"ansible_distribution_version\": \"6.3.9600.0\",\r\n        \"ansible_domain\": \"\",\r\n        \"ansible_env\": {\r\n            \"ALLUSERSPROFILE\": \"C:\\\\ProgramData\",\r\n            \"APPDATA\": \"C:\\\\Users\\\\User\\\\AppData\\\\Roaming\",\r\n            \"COMPUTERNAME\": \"WINRM-TEST\",\r\n            \"ComSpec\": \"C:\\\\Windows\\\\system32\\\\cmd.exe\",\r\n            \"CommonProgramFiles\": \"C:\\\\Program Files\\\\Common Files\",\r\n            \"CommonProgramFiles(x86)\": \"C:\\\\Program Files (x86)\\\\Common Files\",\r\n            \"CommonProgramW6432\": \"C:\\\\Program Files\\\\Common Files\",\r\n            \"FP_NO_HOST_CHECK\": \"NO\",\r\n            \"LOCALAPPDATA\": \"C:\\\\Users\\\\User\\\\AppData\\\\Local\",\r\n            \"MODULE_COMPLEX_ARGS\": \"{\\\"_ansible_version\\\": \\\"2.2.0\\\", \\\"_ansible_selinux_special_fs\\\": [\\\"fuse\\\", \\\"nfs\\\", \\\"vboxsf\\\", \\\"ramfs\\\"], \\\"_ansible_no_log\\\": false, \\\"gather_timeout\\\": 10, \\\"_ansible_module_name\\\": \\\"setup\\\", \\\"_ansible_verbosity\\\": 4, \\\"_ansible_syslog_facility\\\": \\\"LOG_USER\\\", \\\"gather_subset\\\": \\\"all\\\", \\\"_ansible_diff\\\": false, \\\"_ansible_debug\\\": false, \\\"_ansible_check_mode\\\": false}\",\r\n            \"NUMBER_OF_PROCESSORS\": \"1\",\r\n            \"OS\": \"Windows_NT\",\r\n            \"PATHEXT\": \".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL\",\r\n            \"PROCESSOR_ARCHITECTURE\": \"AMD64\",\r\n            \"PROCESSOR_IDENTIFIER\": \"Intel64 Family 6 Model 60 Stepping 3, GenuineIntel\",\r\n            \"PROCESSOR_LEVEL\": \"6\",\r\n            \"PROCESSOR_REVISION\": \"3c03\",\r\n            \"PROMPT\": \"$P$G\",\r\n            \"PSExecutionPolicyPreference\": \"Unrestricted\",\r\n            \"PSModulePath\": \"C:\\\\Users\\\\User\\\\Documents\\\\WindowsPowerShell\\\\Modules;C:\\\\Program Files\\\\WindowsPowerShell\\\\Modules;C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules\",\r\n            \"PUBLIC\": \"C:\\\\Users\\\\Public\",\r\n            \"Path\": \"C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\",\r\n            \"ProgramData\": \"C:\\\\ProgramData\",\r\n            \"ProgramFiles\": \"C:\\\\Program Files\",\r\n            \"ProgramFiles(x86)\": \"C:\\\\Program Files (x86)\",\r\n            \"ProgramW6432\": \"C:\\\\Program Files\",\r\n            \"SystemDrive\": \"C:\",\r\n            \"SystemRoot\": \"C:\\\\Windows\",\r\n            \"TEMP\": \"C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\Temp\",\r\n            \"TMP\": \"C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\Temp\",\r\n            \"USERDOMAIN\": \"WINRM-TEST\",\r\n            \"USERNAME\": \"User\",\r\n            \"USERPROFILE\": \"C:\\\\Users\\\\User\",\r\n            \"windir\": \"C:\\\\Windows\"\r\n        },\r\n        \"ansible_fqdn\": \"WINRM-TEST.\",\r\n        \"ansible_hostname\": \"WINRM-TEST\",\r\n        \"ansible_interfaces\": [\r\n            {\r\n                \"default_gateway\": \"192.168.1.1\",\r\n                \"dns_domain\": null,\r\n                \"interface_index\": 12,\r\n                \"interface_name\": \"Microsoft Hyper-V Network Adapter\"\r\n            }\r\n        ],\r\n        \"ansible_ip_addresses\": [\r\n            \"192.168.1.13\",\r\n            \"fe80::8db0:a472:474c:f75b\"\r\n        ],\r\n        \"ansible_kernel\": \"6.3.9600.0\",\r\n        \"ansible_lastboot\": \"2016-10-02 10:17:50Z\",\r\n        \"ansible_machine_id\": \"S-1-5-21-2732837601-1769857152-38749877\",\r\n        \"ansible_memtotal_mb\": 2047,\r\n        \"ansible_nodename\": \"WINRM-TEST.\",\r\n        \"ansible_os_family\": \"Windows\",\r\n        \"ansible_os_name\": \"Microsoft Windows Server 2012 R2 Datacenter\",\r\n        \"ansible_owner_contact\": \"\",\r\n        \"ansible_owner_name\": \"Windows User\",\r\n        \"ansible_password\": \"Password01\",\r\n        \"ansible_port\": 5986,\r\n        \"ansible_powershell_version\": 4,\r\n        \"ansible_processor\": [\r\n            \"GenuineIntel\",\r\n            \"Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz\"\r\n        ],\r\n        \"ansible_processor_cores\": 1,\r\n        \"ansible_processor_count\": 1,\r\n        \"ansible_processor_threads_per_core\": 1,\r\n        \"ansible_processor_vcpus\": 1,\r\n        \"ansible_product_name\": \"Virtual Machine\",\r\n        \"ansible_product_serial\": \"8001-4993-1966-2051-9875-4214-12\",\r\n        \"ansible_reboot_pending\": false,\r\n        \"ansible_swaptotal_mb\": 0,\r\n        \"ansible_system\": \"Win32NT\",\r\n        \"ansible_system_description\": \"\",\r\n        \"ansible_system_vendor\": \"Microsoft Corporation\",\r\n        \"ansible_uptime_seconds\": 4169,\r\n        \"ansible_user\": \".\\\\User\",\r\n        \"ansible_user_dir\": \"C:\\\\Users\\\\User\",\r\n        \"ansible_user_gecos\": \"\",\r\n        \"ansible_user_id\": \"User\",\r\n        \"ansible_user_sid\": \"S-1-5-21-2732837601-1769857152-38749877-1001\",\r\n        \"ansible_version\": {\r\n            \"full\": \"2.2.0\",\r\n            \"major\": 2,\r\n            \"minor\": 2,\r\n            \"revision\": 0,\r\n            \"string\": \"2.2.0\"\r\n        },\r\n        \"ansible_win_rm_certificate_expires\": \"2017-08-22 18:36:09\",\r\n        \"ansible_windows_domain\": \"WORKGROUP\",\r\n        \"ansible_winrm_server_cert_validation\": \"ignore\",\r\n        \"ansible_winrm_transport\": \"ntlm\",\r\n        \"group_names\": [\r\n            \"windows\"\r\n        ],\r\n        \"groups\": {\r\n            \"all\": [\r\n                \"192.168.1.13\"\r\n            ],\r\n            \"ungrouped\": [],\r\n            \"windows\": [\r\n                \"192.168.1.13\"\r\n            ]\r\n        },\r\n        \"inventory_dir\": \"/home/jordan/dev/windows\",\r\n        \"inventory_file\": \"inventory.ini\",\r\n        \"inventory_hostname\": \"192.168.1.13\",\r\n        \"inventory_hostname_short\": \"192\",\r\n        \"module_setup\": true,\r\n        \"omit\": \"__omit_place_holder__ccdf8449d1fe534ea7e8cf972a46d14c4adfa665\",\r\n        \"playbook_dir\": \"/home/jordan/dev/windows\"\r\n    }\r\n}\r\n```\r\n\r\n##### ACTUAL RESULTS\r\n```\r\nTASK [output host facts] *******************************************************\r\ntask path: /home/jordan/dev/windows/windows-facts.yml:6\r\nok: [192.168.1.13] => {\r\n    \"hostvars[inventory_hostname]\": {\r\n        \"ansible_check_mode\": true,\r\n        \"ansible_connection\": \"winrm\",\r\n        \"ansible_password\": \"Password01\",\r\n        \"ansible_port\": 5986,\r\n        \"ansible_user\": \".\\\\User\",\r\n        \"ansible_version\": {\r\n            \"full\": \"2.2.0\",\r\n            \"major\": 2,\r\n            \"minor\": 2,\r\n            \"revision\": 0,\r\n            \"string\": \"2.2.0\"\r\n        },\r\n        \"ansible_winrm_server_cert_validation\": \"ignore\",\r\n        \"ansible_winrm_transport\": \"ntlm\",\r\n        \"group_names\": [\r\n            \"windows\"\r\n        ],\r\n        \"groups\": {\r\n            \"all\": [\r\n                \"192.168.1.13\"\r\n            ],\r\n            \"ungrouped\": [],\r\n            \"windows\": [\r\n                \"192.168.1.13\"\r\n            ]\r\n        },\r\n        \"inventory_dir\": \"/home/jordan/dev/windows\",\r\n        \"inventory_file\": \"inventory.ini\",\r\n        \"inventory_hostname\": \"192.168.1.13\",\r\n        \"inventory_hostname_short\": \"192\",\r\n        \"omit\": \"__omit_place_holder__885e8a5dace7fc4ba55ad72b20ed5f5e6e74238c\",\r\n        \"playbook_dir\": \"/home/jordan/dev/windows\"\r\n    }\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"jborean93"}}