0

We have configued GitLab and Ansible to trigger Windows Server creation, we implemented adding windows features, adding and removing windows features is configured in yaml;

Windows-Feature 
- SMTP-server 

We have successfully managed to create logic for Installing and uninstalling features using powershell, however, we see that whenever we uninstall, there are still alot of dependencies of spesific Windows Feature installed, For example; installing SMTP-server, installs dependencies; RSAT,RSAT-Feature-Tools,RSAT-SMTP,Web-WebServer etc etc. Removing 'SMTP-server' still keeps the dependencies installed, which is an issue.

Is there any lifecycle managent system or sollution that can manage Uninstallation of all dependencies for Windows Features for pipelines ?

We tried; (Get-WindowsFeature -Name 'SMTP-Server').DependsOn | Uninstall-WindowsFeature with while loops, issue is that (Get-WindowsFeature -Name 'SMTP-Server').DependsOn does not return all dependencies even if we try lopping through with while loop on nested DependsOn.

Graph theory, Dependencies Tree Implementation, but there are no clear techincal sollution for this in Powershell or Ansible.

We have looked at https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_feature_module.html but it is the same issue with the ansible module as well. If we use parameter state with value present, then change the parameter state to value absent, the dependencies is still installed.

Dnelre
  • 1
  • 2

1 Answers1

0

Figured out we can use Get-WindowsFeature and use properties Parent,DependsOn to create a matrix to remove all Features installed from one feature.

Dnelre
  • 1
  • 2