Skip to content

Commit

Permalink
win_nssm: refactor to fix issues, support check mode and add more fea…
Browse files Browse the repository at this point in the history
…tures (ansible#45693)

* win_nssm: rename cmdlets to use approved verbs, rename service name parameters

* win_nssm: improve code style and cmdlets ordering

* win_nssm: always escape all command line parameters with Argv-ToString

fix error when the service name contains quotes

* win_nssm: use Fail-Json instead of exceptions and remove global try/catch

* win_nssm: small refactoring, inline some functions

* win_nssm: refactoring - add a generic cmdlet to idempotently set any nssm service parameter

* win_nssm: refactoring - inline some functions

To make the code more malleable for future changes

* win_nssm: change application, stdout_file and stderr_file options type to path

* win_nssm: deprecates app_parameters, rename app_parameters_free_form to arguments, and add support for list of parameters

* win_nssm: add support of check mode

* win_nssm: add working_directory option

* win_nssm: add display_name and description options

* win_nssm: minor changes

* win_nssm: remove some sanity exclusions

* win_nssm: avoid using aliases and minor style fixes

* win_nssm: doc and ui improvements

* win_nssm: remove sanity exclusions

* win_nssm: minor revision

* win_nssm: deprecates dependencies, start_mode, user and password parameters and some choices of state in favor of win_service

* win_nssm: fix style

* win_nssm: add executable option to specify the location of the NSSM utility

* win_nssm: add missing parameter types

* win_nssm: add diff mode support

* win_nssm: avoid displaying depreciation warning if default value is assigned

* win_nssm: fix variable scope

* win_nssm: use the explicit -LiteralPath parameter name instead of -Path

* win_nssm: fix documentation

* win_nssm: add porting guide entries

* win_nssm: add changelog fragment
  • Loading branch information
ksubileau authored and jborean93 committed Mar 31, 2019
1 parent eff1f88 commit 09979e8
Show file tree
Hide file tree
Showing 6 changed files with 602 additions and 614 deletions.
13 changes: 13 additions & 0 deletions changelogs/fragments/win_nssm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
minor_changes:
- win_nssm - Add the ``executable`` option to specify the location of the NSSM utility.
- win_nssm - Add the ``working_directory``, ``display_name`` and ``description`` options.
- win_nssm - Add support for check and diff modes.
- win_nssm - Change default value for ``state`` from ``start`` to ``present``.

bugfixes:
- win_nssm - Fix several escaping and quoting issues of paths and parameters.

deprecated_features:
- win_nssm - Deprecate ``dependencies``, ``start_mode``, ``user``, and ``password`` options, in favor of using the ``win_service`` module.
- win_nssm - Deprecate ``start``, ``stop``, and ``restart`` values for ``state`` option, in favor of using the ``win_service`` module.
- win_nssm - Deprecate ``app_parameters`` option in favor of ``arguments``.
18 changes: 18 additions & 0 deletions docs/docsite/rst/porting_guides/porting_guide_2.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,24 @@ Noteworthy module changes

* The ``win_psexec`` has deprecated the undocumented ``extra_opts`` module option. This will be removed in Ansible 2.10.

* The ``win_nssm`` module has deprecated the following options in favor of using the ``win_service`` module to configure the service after installing it with ``win_nssm``:
* ``dependencies``, use ``dependencies`` of ``win_service`` instead
* ``start_mode``, use ``start_mode`` of ``win_service`` instead
* ``user``, use ``username`` of ``win_service`` instead
* ``password``, use ``password`` of ``win_service`` instead
These options will be removed in Ansible 2.12.

* The ``win_nssm`` module has also deprecated the ``start``, ``stop``, and ``restart`` values of the ``status`` option.
You should use the ``win_service`` module to control the running state of the service. This will be removed in Ansible 2.12.

* The ``status`` module option for ``win_nssm`` has changed its default value to ``present``. Before, the default was ``start``.
Consequently, the service is no longer started by default after creation with ``win_nssm``, and you should use
the ``win_service`` module to start it if needed.

* The ``app_parameters`` module option for ``win_nssm`` has been deprecated; use ``argument`` instead. This will be removed in Ansible 2.12.

* The ``app_parameters_free_form`` module option for ``win_nssm`` has been aliased to the new ``arguments`` option.

* The ``win_dsc`` module will now validate the input options for a DSC resource. In previous versions invalid options
would be ignored but are now not.

Expand Down
Loading

0 comments on commit 09979e8

Please sign in to comment.