Commit Graph

199 Commits (8702ead0a7c99e2f6534ea780e4fa8684b9be7fe)

Author SHA1 Message Date
Hans-Joachim Kliemeck b2f666a2dd strict variables fix 2016-12-08 11:33:32 -05:00
Hans-Joachim Kliemeck 349c4a2a48 added dependency and user settings 2016-12-08 11:33:32 -05:00
nitzmahone 51b1cd061a Strict-Mode fixes
Changes to missing member handling to support running top-level script under Strict-Mode v2 (as Ansible 2.0.0 does now)
2016-12-08 11:33:32 -05:00
Brian Geihsler 92cbe5be0e Fix #1107: Prepend registry type on key path 2016-12-08 11:33:31 -05:00
Brian Geihsler 6fed60c1bd Fix #1107: Use Get-Attr in win_regedit 2016-12-08 11:33:31 -05:00
Trond Hindenes d90f91e802 Various improvements to win_package 2016-12-08 11:33:31 -05:00
Corwin Brown 8e557dfc45 Made win_iis_webapppool Strict Compliant 2016-12-08 11:33:30 -05:00
Brian Geihsler 2f6f6cedf8 Fix #1099: Only populate site result when it is there 2016-12-08 11:33:28 -05:00
Toshio Kuratomi 60c495f18c Fix win_acl docs build 2016-12-08 11:33:28 -05:00
Phil 0524904dda fixes examples in docs to use updated param name 2016-12-08 11:33:28 -05:00
Phil 43074a736d changes param src to path, and updates docs accordingly 2016-12-08 11:33:27 -05:00
Phil 00a4ec5e3b updates user search verification for local/domain - Thanks to @trondhindenes for implementing this strategy - also updated documentation 2016-12-08 11:33:27 -05:00
Phil 9ad30acd96 changes check for src 2016-12-08 11:33:27 -05:00
Phil 6abfcffc70 check if the rule exists or not before allow/deny rules are added/removed, and fixes where result changed would be true on all executions. 2016-12-08 11:33:27 -05:00
schwartzmx 25a3793a49 inital commit win_acl 2016-12-08 11:33:27 -05:00
Trond Hindenes 15ac8e9141 turned out strict msi code checking 2016-12-08 11:33:27 -05:00
Nicolas Landais 4fc4030c58 Adding fix to get around bug found with the New-Webstire command when running playbook on a vanilla machine. 2016-12-08 11:33:27 -05:00
Dreamcat4 40a1bd1962 fix: Add 'enable:' flag for enabling existing rules which are disabled by default.
This is a very much needed flag. To turn on/off existing firewall rules. And like the recent fix of the 'Profile' key, the netsh cmd prints 'Enabled' in the textual output. (at least on win10 it does). So again a similar small code added for the necessary exception handling when the difference check happens.

Please merge / push upstream like the other fixes. Many thanks. This is the last fix I have put together for this patch set. So I will raise my PR now.

But if you want to fix more bugs, it seems there may be others. In terms of the control code. Sometimes it will delete a rule under 'force' condition (when found difference) - but instead it is supposed to just modify the existing rule. Some weird behaviour regarding that. The other problem is that ansible does not return the error text printed by 'netsh' cmd verbatim... but it should as that makes debugging these errors a *lot* easier.
2016-12-08 11:33:27 -05:00
Dreamcat4 e0da4a3362 fix: update documentation with new module name "win_firewall_rule" 2016-12-08 11:33:27 -05:00
Dreamcat4 7188ae4fe1 fix: The names of firewall profiles are different on win10 & win2008r2
Hi again. This commit removes a small portion of your script's own internal error checking. In specific: for the value of the profile: key. This is essential to avoid errors on other verisons of the windows operating system which are not win2008r2 (your version).

For example: on win10 (and most likely win8x too), the names of the profiles don't include the values 'current' and 'all'. But instead the values are 'Public' 'Private' 'Domain' and 'Any. But in addition, there are also certain combinatorial values, such as profile=Public,Private etc. Which is too many to error check yourself.

Yet removing the error checking here should not cause any ill effects however: since the netsh advfirewall ... cmds themselves to add / remove / modify actually to their own error checking of the profile=value. So when the cmd is run, it will error out itself with an appropriate / informative error msg. No harm done.

Therefore please remove the highlighed portions from your own script. It is essential for interoperability with win10 and win8x. Many thanks.
2016-12-08 11:33:27 -05:00
Dreamcat4 f64e438150 fix: win10 - Add exception handling for 'Profiles:' textual output key name mismatch.
In win10 (and pribably win8x also):

The output of 'show rule' key includes the line "Profiles:<TAB>Public,Private".
Yet your script expects the key name printed out to be "Profile:<TAB>value".

This commit added the necessary exception handling to avoid flagging 'different=true' under the false circumstance. The key name to SET a firewall rule is still "profile=" and not "profiles=".

There is coming up another commit to fix the value handling for win10/win8. Which is another (different) error with the profile: key.
2016-12-08 11:33:26 -05:00
Dreamcat4 b9dd3568f3 fix: fw rule names must always be quoted, to permit spaces ' ' and brackets '()'
Without this fix, the 'netsh' command gets name=Firewall Rule Name instead of name="Firewall Rule Name". Thus causing all sorts of havoc. Basic shell quoting rules seems to apply to Windows Powershell too. This is very much needed as many of windows 10's default firewall rules contain spaces and brackets () characters.
2016-12-08 11:33:26 -05:00
jhawkesworth@users.noreply.github.com 17d1c8916d Document module limitations to resolve https://github.com/ansible/ansible-modules-extras/issues/908 2016-12-08 11:33:25 -05:00
Brian Coca 4134b7a04d doc formatting fixes 2016-12-08 11:33:25 -05:00
nitzmahone bf59d1cc1e win_updates rewrite for 2.0
uses scheduled job to run under a local token (required for WU client)
supports check mode
no external PS module deps
2016-12-08 11:33:24 -05:00
Trond Hindenes 86be6b1dba added module author 2016-12-08 11:33:24 -05:00
Trond Hindenes 6890cc81be fixes #984 2016-12-08 11:33:24 -05:00
Toshio Kuratomi 07af4c3627 Fix doc build 2016-12-08 11:33:24 -05:00
Trond Hindenes cb88c17856 win_chocolatey bugfixes 2016-12-08 11:33:23 -05:00
gfrank 3ea3b9efc9 Move comments to the documentation 2016-12-08 11:33:22 -05:00
gfrank 6fa4292bed Remove unnecessary aliases arrays 2016-12-08 11:33:22 -05:00
gfrank ebbe086d3a Clean up unneeded comment and comma 2016-12-08 11:33:22 -05:00
gfrank fbf6c2ddc3 Adding nssm requirement note 2016-12-08 11:33:22 -05:00
gfrank d6c42c0e6f Adding win_nssm module 2016-12-08 11:33:22 -05:00
Michael Perzel 9fd59bde6d Remove duplicate action declaration. 2016-12-08 11:33:22 -05:00
Michael Perzel 6f752a871b Note parameters that are not idempotent 2016-12-08 11:33:22 -05:00
Michael Perzel 141b3ce41f Fix logging of error message 2016-12-08 11:33:22 -05:00
Michael Perzel 0f9c81a8c2 Add support for specifying user for scheduled task to run as 2016-12-08 11:33:22 -05:00
Michael Perzel 7ea34369f7 Add support for command arguments 2016-12-08 11:33:22 -05:00
Michael Perzel f1e8de2f67 Show order of operations with parenthesis 2016-12-08 11:33:22 -05:00
Michael Perzel 0d78c01d32 Use helper methods to validate vars. Cleanup logic. 2016-12-08 11:33:22 -05:00
Michael Perzel dae8cfe0a9 Remove accidental newlines 2016-12-08 11:33:22 -05:00
Michael Perzel e3c6dbf14e Cleanup enable/disable logic 2016-12-08 11:33:22 -05:00
Michael Perzel 66d9d896e4 Update method to determine if task exists, add days of week parameter to weekly triggers 2016-12-08 11:33:22 -05:00
Michael Perzel 28164d2ae4 Ability to add/remove scheduled task 2016-12-08 11:33:21 -05:00
TimothyVandenbrande 8cb80ce7bf upon request, added the license 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande 12a26a8f81 add version_added: "2.0" 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande 8aa14ac4aa renamed profile var 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande c7fb582b9c windows default to current instead of all 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande 3511497dc1 renamed the module 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande 115fb59136 added the profile option + updated the docs for it 2016-12-08 11:33:20 -05:00
Timothy Vandenbrande d8663132ad windows firewall control 2016-12-08 11:33:20 -05:00
Toshio Kuratomi ba8cc9493a correct documentation formatting 2016-12-08 11:33:17 -05:00
Trond Hindenes bc19cceb8e Added module win_package 2016-12-08 11:33:16 -05:00
Chris Church eaf6d6fb4d Workaround for bug in PowerShell Get-Website cmdlet. 2016-12-08 11:33:07 -05:00
Brian Coca cff83ca72a more doc fixes 2016-12-08 11:33:05 -05:00
Peter Mounce 9660b1f887 version -> 2, remove unnecessary doc attributes 2016-12-08 11:33:03 -05:00
Peter Mounce ded61f5a49 fix license boilerplate 2016-12-08 11:33:02 -05:00
Peter Mounce e193215d12 win_webpicmd module for IIS module installation
Chocolatey 0.9.9+ deprecated support for the `webpi` custom source, so I needed to write this.

[Windows Web Platform Installer](http://www.microsoft.com/web/downloads/platform.aspx) is a way of installing products and applications for Microsoft IIS on Windows. It has a [command line](http://www.iis.net/learn/install/web-platform-installer/web-platform-installer-v4-command-line-webpicmdexe-rtw-release); this ansible module allows IIS modules to be installed via this means.

To find out names of modules, use `webpicmd /list /listoption:available`.

Notes:
* `webpicmd` must be installed and on `PATH` first (see `win_chocolatey` module; package is `webpicmd`)
* `webpicmd` does not allow modules to be uninstalled
* IIS must be installed first (see `win_feature` module; package is `Web-Server`)
* Installations will
  * accept EULA (which otherwise requires user input)
  * suppress reboots (so you have to manage those; see `win_reboot` module)
2016-12-08 11:33:02 -05:00
Peter Mounce 761197707b use the notes property 2016-12-08 11:33:02 -05:00
Peter Mounce e00089986a version -> 2, quote doc strings with colons 2016-12-08 11:33:02 -05:00
Peter Mounce 490c8fa0ca Add documentation note 2016-12-08 11:33:02 -05:00
Peter Mounce 1c6e252ca0 Create win_dotnet_ngen module
When .NET is installed or updated, ngen is triggered to optimise the installation. This triggers high CPU while it's happening, and usually happens at an inconvenient time.

This allows you to trigger it when you like. Full details and background in doc.

I don't know a way to figure out whether this is required without actually running it.
2016-12-08 11:33:02 -05:00
Peter Mounce a9978b5283 re-submit @adematte's PR #278 against HEAD 2016-12-08 11:33:02 -05:00
Phil f6d66bb3db minor doc fixes that had lingering description of deprecated functions 2016-12-08 11:33:00 -05:00
Phil 01b36130a8 use convertto-bool for rm and recurse params 2016-12-08 11:32:59 -05:00
Phil 2d1189dee8 removes restart functionality, and added creates param for idempotency 2016-12-08 11:32:59 -05:00
Phil af660c38fa fixes typo 2016-12-08 11:32:59 -05:00
Phil 8d9697e7fe update to not auto-install PSCX - will use built-in powershell method instead for .zip files - added example for installing pscx as a pretask 2016-12-08 11:32:59 -05:00
schwartzmx 97744b2dc0 fixes unzip bug for zip files, thanks to @ryanwalls - also fixes possible import errors, and switches to use Start-Process on install to correctly wait 2016-12-08 11:32:59 -05:00
schwartzmx 6439c96b2b updates docs, adds unzip func for bz2 gz tar msu¬ - Added functionality for unzipping/decompressing bzip gzip tar exe (self extracting) and msu (ms update) files to coincide with added functionality to win_zip¬ - Added functionality requires PSCX (it will be installed if it can't be imported)¬¬ - First try with chocolatey, if fail, direct install from msi - Added recurse param to recursively unzip files from a compressed folder¬ - useful for example: unzipping a Log.zip file that contains a load of .gz files¬ - setting rm param to true will remove all compressed files after decompressing¬ 2016-12-08 11:32:59 -05:00
Phil Schwartz c5770b9fe0 fixes rm & restart param checks 2016-12-08 11:32:59 -05:00
Phil Schwartz 17f160244f edit check for extension to use library func 2016-12-08 11:32:59 -05:00
Phil Schwartz 074305a67d specifies creation of directory if !exists - added try catch for creation of directory, in case of an invalid path specified - added specification to documentation 2016-12-08 11:32:59 -05:00
Phil Schwartz 6f7835a73f init commit 2016-12-08 11:32:59 -05:00
Adam Keech b365b83906 Adding functionality to not only edit Values, but also Keys. 2016-12-08 11:32:58 -05:00
Adam Keech 1710d1aa0c Renaming variables in win_regedit module to make more sense with actions that are happening. 2016-12-08 11:32:58 -05:00
Adam Keech 907fa20035 Adding win_regedit module 2016-12-08 11:32:58 -05:00
Peter Mounce 08bf656309 Code-review
Swap state enabled/disabled -> enabled yes/no
2016-12-08 11:32:55 -05:00
Peter Mounce 8f74e4acdf no default, remove it 2016-12-08 11:32:55 -05:00
Peter Mounce e518672a75 version_added -> 2, remove empty aliases 2016-12-08 11:32:55 -05:00
Peter Mounce c2ba569bf4 caught out by syntax 2016-12-08 11:32:55 -05:00
Peter Mounce 2fc0cec990 correct variable name 2016-12-08 11:32:55 -05:00
Peter Mounce be2ca80c2b win_scheduled_task module for windows
Fledgling module to allow scheduled tasks to be managed.
At present, I only need enabled/disabled support. There's lots of scope for more features.
2016-12-08 11:32:54 -05:00
Toshio Kuratomi 4078e0905c Fix up docs 2016-12-08 11:32:54 -05:00
Toshio Kuratomi 9aaf6ee05c These modules were added to version 2.0, not 1.9 2016-12-08 11:32:54 -05:00
Henrik Wallström c241fb78a8 Modules to manage IIS
Wraps the Web Server Administration module for PowerShell into Ansible modules.
2016-12-08 11:32:53 -05:00
Greg DeKoenigsberg c65a612d1f Changes to author formatting, remove emails 2016-12-08 11:32:51 -05:00
Greg DeKoenigsberg 313352c845 Add author data 2016-12-08 11:32:50 -05:00
Pepe Barbe 45fe29b248 Refactor win_chocolatey module
* Refactor code to be more robust. Run main logic inside a try {} catch {}
  block. If there is any error, bail out and log all the command output
  automatically.
* Rely on error code generated by chocolatey instead of scraping text
  output to determine success/failure.
* Add support for unattended installs: (`-y` flag is a requirement by
  chocolatey)
* Before (un)installing, check existence of files.
* Use functions to abstract logic
* The great rewrite of 0.9.9, the `choco` interface has changed, check
  if chocolatey is installed and an older version. If so upgrade to
  latest.
* Allow upgrading packages that are already installed
* Use verbose logging for chocolate actions
* Adding functionality to specify a source for a chocolatey repository.
  (@smadam813)
* Removing pre-determined sources and adding specified source url in
  it's place. (@smadam813)

Contains contributions from:
*  Adam Keech  <akeech@chathamfinancial.com> (@smadam813)
2016-12-08 11:32:50 -05:00
Ernst Kuschke f7d6b2a7e8 Allow any custom chocolatey source
This is to allow for a local source (for instance in the form of artifactory)
2016-12-08 11:32:45 -05:00
Jon Hawkesworth 4598ae5376 Update attribution 2016-12-08 11:32:42 -05:00
Jon Hawkesworth d2ed2c935b Add win_environment module 2016-12-08 11:32:42 -05:00
Toshio Kuratomi 4f07e8b256 Many more doc fixes 2016-12-08 11:32:40 -05:00
net 64b53937ee package file 2016-12-08 11:32:22 -05:00
Brian Coca 9057295065 changed to use ansible standard 'name' instead of 'package' 2016-12-08 11:32:21 -05:00
Toshio Kuratomi 79bd23da3e Fixes to documentation 2016-12-08 11:32:21 -05:00
Peter Mounce 71d2faab18 Windows package management with Chocolatey 2016-12-08 11:32:21 -05:00
Peter Mounce f408ac2d82 Add module to install windows updates
Supports specifying which category to install all updates from.
NEEDS: `choco install PSWindowsUpdate` beforehand - does not attempt to install it (or detect it's missing, yet)
PSWindowsUpdate: http://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc#content
2016-12-08 11:32:21 -05:00