mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add exclude option
This commit is contained in:
parent
56c0a42e12
commit
50bd76e206
1 changed files with 11 additions and 1 deletions
|
@ -117,7 +117,7 @@ def list_installed():
|
|||
return ret
|
||||
|
||||
|
||||
def install(feature, recurse=False, source=None, restart=False):
|
||||
def install(feature, recurse=False, source=None, restart=False, exclude=None):
|
||||
'''
|
||||
Install a feature
|
||||
|
||||
|
@ -140,6 +140,13 @@ def install(feature, recurse=False, source=None, restart=False):
|
|||
:param bool restart: Restarts the computer when installation is complete, if
|
||||
required by the role/feature installed. Default is False
|
||||
|
||||
:param str exclude: The name of the feature to exclude when installing the
|
||||
named feature.
|
||||
|
||||
..note:: As there is no exclude option for the ``Add-WindowsFeature``
|
||||
command, the feature will be installed with other sub-features and
|
||||
will then be removed.
|
||||
|
||||
:return: A dictionary containing the results of the install
|
||||
:rtype: dict
|
||||
|
||||
|
@ -173,6 +180,9 @@ def install(feature, recurse=False, source=None, restart=False):
|
|||
.format(_cmd_quote(feature), mgmt_tools, sub, src, rst)
|
||||
out = _pshell_json(cmd)
|
||||
|
||||
if exclude is not None:
|
||||
remove(exclude, restart=restart)
|
||||
|
||||
if out['FeatureResult']:
|
||||
return {'ExitCode': out['ExitCode'],
|
||||
'DisplayName': out['FeatureResult'][0]['DisplayName'],
|
||||
|
|
Loading…
Add table
Reference in a new issue