I setup a Windows 2019 server 100% manually a little while ago (ServerA) and I need to also setup a copy of it (ServerB) that runs on the same OS. Since I am now using Ansible for provisioning I thought it would be nice create some playbooks that I can run against both servers. My assumption is that only the new server should change when I run these playbooks.
To start, I:
Made a list of all of the Modules and Features that were installed on ServerA and then…
Created a playbook that uses the ansible.windows.win_feature module to install all of the desired features explicitly. Here’s an example of one of the tasks:
some features that weren’t specified were installed
What were they ? And what makes you say that (playbook output, Get-WindowsFeature you ran afterwards, logs, etc…) ?
ansible.windows.win_feature is essentially an Install-WindowsFeature (for Windows 2012+ that is) wrapper, using these params. Also management tools and subfeatures install default to false.
I’m not very familiar with Install-WindowsFeature cmdlet as I don’t work much with Windows Server these days, but it seems to me it should only install specified features. If you could somehow rollback your machine state and try again with plain Install-WindowsFeature cmdlet, I’m curious how it would perform.
Also, is your example task representative of the one you ran against your server ? Same parameters (except name value perhaps) ?
I’d rather not list them in a public forum for security reasons.
That’s a really good idea. I’m going to try that in a few weeks when I can.
Yes it is.
I appreciate your help! I imagine that you’re correct, that i need to address what is happening at the Install-WindowsFeature, not the ansible level. However, I can’t test this for a few weeks so I will close this post. If I still have an issue I’ll open a bug.