diff options
author | Pepe Barbe <dev@antropoide.net> | 2015-06-07 13:18:33 -0500 |
---|---|---|
committer | Greg DeKoenigsberg <greg@eucalyptus.com> | 2015-06-16 11:33:15 -0400 |
commit | b5d22eb1ec6c7cd2cbef14554fc92c86c2e24452 (patch) | |
tree | 4b5fa0ad539b57020f3a2419fa3abc3b1b3507a2 /windows/win_chocolatey.py | |
parent | e633d9946fc9048e5ec258552fa018d8da27d18d (diff) | |
download | ansible-modules-extras-b5d22eb1ec6c7cd2cbef14554fc92c86c2e24452.tar.gz |
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)
Diffstat (limited to 'windows/win_chocolatey.py')
-rw-r--r-- | windows/win_chocolatey.py | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/windows/win_chocolatey.py b/windows/win_chocolatey.py index 63ec1ecd..fe00f2e0 100644 --- a/windows/win_chocolatey.py +++ b/windows/win_chocolatey.py @@ -53,42 +53,29 @@ options: - no default: no aliases: [] - version: + upgrade: description: - - Specific version of the package to be installed - - Ignored when state == 'absent' - required: false - default: null - aliases: [] - showlog: - description: - - Outputs the chocolatey log inside a chocolatey_log property. + - If package is already installed it, try to upgrade to the latest version or to the specified version required: false choices: - yes - no default: no aliases: [] - source: + version: description: - - Which source to install from - require: false - choices: - - chocolatey - - ruby - - webpi - - windowsfeatures - default: chocolatey + - Specific version of the package to be installed + - Ignored when state == 'absent' + required: false + default: null aliases: [] - logPath: + source: description: - - Where to log command output to + - Specify source rather than using default chocolatey repository require: false - default: c:\\ansible-playbook.log + default: null aliases: [] -author: - - '"Trond Hindenes (@trondhindenes)" <trond@hindenes.com>' - - '"Peter Mounce (@petemounce)" <public@neverrunwithscissors.com>' +author: Trond Hindenes, Peter Mounce, Pepe Barbe, Adam Keech ''' # TODO: @@ -111,10 +98,8 @@ EXAMPLES = ''' name: git state: absent - # Install Application Request Routing v3 from webpi - # Logically, this requires that you install IIS first (see win_feature) - # To find a list of packages available via webpi source, `choco list -source webpi` + # Install git from specified repository win_chocolatey: - name: ARRv3 - source: webpi + name: git + source: https://someserver/api/v2/ ''' |