I needed to test certain scenarios for a client against a Microsoft Active Directory Domain Controller and Intermediate Certificate Authority. The easiest way was to use Vagrant with the mwrock/Windows2012R2 box.
I wasn't able to automate the complete install, but did get it to a set of cut-and-paste lines.
Code is at [ https://github.com/awcoleman/vagrant_win_ad_dc_ca_test ]
Copy Vagrantfile into new directory
Follow directions in README.txt
The next iteration will probably use Ansible support for Windows (unfortunately there is no CA module)