salt.states.win_servermanager

Manage Windows features via the ServerManager powershell module

salt.states.win_servermanager.installed(name, recurse=False, force=False, restart=False, source=None, exclude=None)

Install the windows feature

Parameters:
  • name (str) -- Short name of the feature (the right column in win_servermanager.list_available)
  • recurse (Optional[bool]) -- install all sub-features as well
  • force (Optional[bool]) -- if the feature is installed but one of its sub-features are not installed set this to True to force the installation of the sub-features
  • source (Optional[str]) -- Path to the source files if missing from the target system. None means that the system will use windows update services to find the required files. Default is None
  • restart (Optional[bool]) -- Restarts the computer when installation is complete, if required by the role/feature installed. Default is False
  • exclude (Optional[str]) -- The name of the feature to exclude when installing the named feature.
restart:
Restarts the computer when installation is complete, if restarting is required by the role feature installed.

Note

Some features require reboot after un/installation. If so, until the server is restarted other features can not be installed!

Example

Run salt MinionName win_servermanager.list_available to get a list of available roles and features. Use the name in the right column. Do not use the role or feature names mentioned in the PKGMGR documentation. In this example for IIS-WebServerRole the name to be used is Web-Server.

ISWebserverRole:
  win_servermanager.installed:
    - force: True
    - recurse: True
    - name: Web-Server
salt.states.win_servermanager.removed(name, remove_payload=False, restart=False)

Remove the windows feature

Parameters:
  • name (str) -- Short name of the feature (the right column in win_servermanager.list_available)
  • remove_payload (Optional[bool]) -- True will case the feature to be removed from the side-by-side store
  • restart (Optional[bool]) -- Restarts the computer when uninstall is complete, if required by the role/feature removed. Default is False

Note

Some features require a reboot after uninstallation. If so the feature will not be completely uninstalled until the server is restarted.

Example

Run salt MinionName win_servermanager.list_installed to get a list of all features installed. Use the top name listed for each feature, not the indented one. Do not use the role or feature names mentioned in the PKGMGR documentation.

ISWebserverRole:
  win_servermanager.removed:
    - name: Web-Server