Commit Graph

48 Commits (9d351f2ee7af41bc29a02b7d903b51943a628b9b)

Author SHA1 Message Date
Jordan Borean d0d4f2e406
win_setup: don't fail when running as non-admin and EAP is set to Stop (#46149) 2018-09-26 13:46:24 +10:00
Jordan Borean 881f3a599c
windows testing - changes to accomodate future behaviour changes (#45464) 2018-09-11 13:04:23 +10:00
Dag Wieers 95a1170908 Windows: Add "special" parameter types to docs (#42853)
* Windows: Add special parameter types

Adding explicit parameter types now exposes this information in the
module documentation, and proves really helpful.

We only do this for non-string types as strings, mostly because strings
are implicit.

PS We also make copyright statements consistent and use #Requires for
explicit library imports

* Type "string" must be type "str"

* A few more Copyright corrections

* More fixes

* Don't add file encoding to Powershell files

* Don't add missing interfacetypes parameter

Otherwise CI demands an incorrect version_added

* Small fix
2018-07-17 14:29:05 -07:00
Steve Jennings 57ea4cafff Add productType property as an ansible fact (#41139)
* Add productType property as an ansible fact

Suggest to add productType property from win32_operatingsystem CIM instance to differentiate between versions and add new fact.

* update code to display human-readable string

Commit added in response to nizmahone's suggestion to add humane-readable strings to the display. uses switch statement to evaluate and update $ansible_facts hash table with proper information

* remove string conversion, modify switch default

Adjusts line 202 to remove .String() conversion from uInt32.
Adjusts switch test values to integers
Uses switch default clause to handle null values

* formatting

fixed formatting issues, moved product_type into variable.
adjust ansible_fact hash table key to be consistent with the rest of the code.

* Moved product type within distribution
2018-06-26 12:03:50 +10:00
Jordan Borean 2fc3ac3516 win_setup: fix for machine sid to work in domains with lots of users (#38646) 2018-04-12 06:01:16 -04:00
Jordan Borean fd4d264253
win_setup: Added connection name to interfaces (#37327) 2018-04-06 07:36:38 +10:00
Matt Davis 06dc840b51
implement gather_subset on Windows setup (#35212) 2018-01-22 21:10:25 -08:00
Dag Wieers 7f6feca82f
Revert "win_setup: Add Product ID and Product Key in facts" (#35200)
* Revert "win_setup: Add Product ID and Product Key in facts (#34097)"

This reverts commit cf1f7b53df.
2018-01-22 22:32:23 +01:00
Dag Wieers cf1f7b53df win_setup: Add Product ID and Product Key in facts (#34097)
* win_setup: Add Product ID and Product Key in facts

So this is actually a very nice way to get product key information from
systems collected centrally.

Especially with systems that have been upgraded from Windows 7 or
Windows 8 to Windows 10 may not have a valid Windows 10 product
license key printed anywhere, it was a digital license.

If you ever have to reinstall the system, you may recover the system
from the recovery partition, or the original media, but cannot upgrade
to Windows 10 for free. By collecting the product key, one can always
reinstall your free Windows upgrade.

My only question is, do we want this to be part of the default facts, as
it may be considered important information. Or should we make a special
**win_product_key_facts** ?

* Add ACPI product key support
2018-01-22 16:00:45 -05:00
Barney Sowood 158cd59994 Add Windows AD Domain facts for membership and server type (#23500)
* Add Windows Domain facts for membership and server type

Adds additional facts to setup.ps1 for Windows hosts

 * ansible_windows_domain_member - returns true if machine is domain
   joined
 * ansible_windows_domain_role - indicates role of machine in domain

Roles list is taken from
https://technet.microsoft.com/en-us/library/ee198796.aspx and will
return sensible values for non domain joined machines too.

* Use $win32_cs rather than Get-CimInstance Win32_ComputerSystem for consistency
2018-01-01 20:20:06 -05:00
Jordan Borean f6858cdd4d windows facts: better way to get machine SID (#29821)
* windows facts: better way to get machine SID

* remove the substring and just get the property that contains the value we need
2017-09-12 13:00:28 -07:00
jhawkesworth a43af128cf Add mac address to windows facts (#25803) 2017-08-01 11:13:19 -07:00
Dag Wieers 1cc9e9f2a1 Clean up windows setup module (#21343)
The following items were implemented:
- Replace PSObject with normal hash
- Replace Set-Attr function with normal hash assignment
- Re-indent code (make sure everything uses 4 spaces)
- Remove trailing semi-colons
2017-02-20 11:49:52 +00:00
Dag Wieers 7be39ca553 Windows modules: Add -type "path" to path parameters (#20282)
This PR is based on #20164 functionality to specify the parameter type
(e.g. as done for python modules).

In this case only -type "path" has a specific meaning, as it will expand
environment variables for paths. Which is typically done on Windows.

So you can do:

  - win_copy:
      src: files/some.doc
      dest: '%UserProfile%\My Documents'
2017-01-16 11:39:58 -08:00
Matt Davis e2f66abe73 fixed windows setup to run in check_mode 2016-12-08 11:25:18 -05:00
Matt Davis 66a1b15f89 remove broken ansible_user_uid fact from Windows setup 2016-12-08 11:25:15 -05:00
Richard Levenberg 4943d329a4 handle multiple winrm listeners (#4142)
* handle multiple winrm listeners

* use the sorterd array
2016-12-08 11:24:43 -05:00
nitzmahone 1a4804cc60 fixes to windows setup
coerce multi-socket win32_processor to a single value
WindowsIdentity.Label doesn't exist on .NET 4.0
2016-12-08 11:24:40 -05:00
Dag Wieers df2ef26bc7 Comment out $win32_cs.SystemFamily, cfr. @nitzmahone
Since it fails on everything pre-10/2016
2016-12-08 11:24:40 -05:00
Dag Wieers 35b9810e39 Fix ansible_distribution and weekday locale (as hinted by @nitzmahone) 2016-12-08 11:24:40 -05:00
Dag Wieers 36d0bac0a3 Retain an important note regarding Win32_PhysicalMemory on virtual platforms 2016-12-08 11:24:40 -05:00
Dag Wieers efaaa79157 Ensure we are using an English locale for date formatting. (as hinted by @nitzmahone) 2016-12-08 11:24:40 -05:00
Dag Wieers 790adc126f Added CPU information comparable to Linux 2016-12-08 11:24:39 -05:00
Dag Wieers dc432c5697 Added more properties 2016-12-08 11:24:39 -05:00
Dag Wieers f8b0cf50b4 Format BIOS date string like on Linux 2016-12-08 11:24:39 -05:00
Dag Wieers 457ccc2e73 win_setup: Add missing properties
We add some basic properties for Windows that are available on other platforms.
2016-12-08 11:24:39 -05:00
nitzmahone e7075f3e93 rename ansible_winrm_certificate_expires fact to avoid collision with connection vars 2016-12-08 11:24:37 -05:00
Trond Hindenes 7747be71b4 Return reboot pending as true/false 2016-12-08 11:24:35 -05:00
davidobrien1 a874e1e25e Change fact invocation from dotsourcing to ampersand so that scripts do not execute in global scope. 2016-12-08 11:24:10 -05:00
David O'Brien ce7a86b4ce Add documentation to setup.py and remove use of $params.fact_path in setup.ps1 2016-12-08 11:24:09 -05:00
Hillel Antonov 8d5cebd597 Adding gathering environment variables to gather facts on Windows making similar in functionality to gather facts on Linux 2016-12-08 11:23:58 -05:00
Corwin Brown c075c000c8 Adding Facter 2016-12-08 11:23:57 -05:00
jhawkesworth@users.noreply.github.com 5453d1e959 Fix for 13315 - minute now included in ansible_date_time on windows hosts 2016-12-08 11:23:49 -05:00
nitzmahone 45fff5d939 fixed ansible_totalmem fact returning 0
Win32_PhysicalMemory CIM object is busted on some virtual environments, switched
to Win32_ComputerSystem.TotalPhysicalMemory
2016-12-08 11:23:47 -05:00
Michael Perzel 1fc2c8c324 Added date, year and month attributes 2016-12-08 11:23:40 -05:00
Michael Perzel 7ee0fa3b4b Add ansible_date_time to windows facts 2016-12-08 11:23:40 -05:00
Matt Calhoun 52f9c3468c The variable $uppercase_cert_thumbprint cannot be retrieved because it has not been set. 2016-12-08 11:23:38 -05:00
Matt Calhoun a9d954b087 The variable $winrm_cert_thumbprint cannot be retrieved because it has not been set. 2016-12-08 11:23:38 -05:00
Matt Calhoun 70f7f144e0 The variable $https_listener cannot be retrieved because it has not been set. 2016-12-08 11:23:38 -05:00
Matt Calhoun 72970ab7a8 The variable $winrm_https_listener_path cannot be retrieved because it has not been set 2016-12-08 11:23:38 -05:00
Chris Church c35d7304c9 Revert "Rename powershell versions of setup and slurp so they don't shadow the python versions of these modules."
This reverts commit d4e16b0c736081b7a41158063f3edef8f235adda.
2016-12-08 11:23:36 -05:00
Toshio Kuratomi 8ce7348d52 Rename powershell versions of setup and slurp so they don't shadow the python versions of these modules.
This change goes along with https://github.com/ansible/ansible/02502c5727753d02819cb32b94dc2035b65d81a7
2016-12-08 11:23:35 -05:00
Chris Church 9ed0a5a920 * Update core modules to fix strict mode errors. * Also fix creates parameter issue in win_msi as described in https://github.com/ansible/ansible-modules-core/issues/129, slightly different fix from https://github.com/ansible/ansible-modules-core/pull/1482 * Fix setup.ps1 module issue described in https://github.com/ansible/ansible-modules-core/issues/1927 2016-12-08 11:23:34 -05:00
nitzmahone 51154a6991 added windows facts ansible_lastboot, ansible_uptime_seconds
switched OS object to Get-CimInstance since we need a DateTime object for lastbootuptime
2016-12-08 11:23:32 -05:00
Pepe Barbe 5dc322b911 Add OS architecture and OS name to the Windows setup module 2016-12-08 11:23:07 -05:00
Michael DeHaan c7e9139a1b Fix filename error. 2016-12-08 11:22:22 -05:00
Michael DeHaan 213e518165 file extensions! 2016-12-08 11:22:22 -05:00
Michael DeHaan c7eec45b73 Restructuring. 2016-12-08 11:22:22 -05:00