This topic contains 4 replies, has 2 voices, and was last updated by
June 24, 2018 at 11:39 pm #103204
I have been working on setting up a build&test pipeline for a configuration of 5 server roles (app, web, database, etc.).
The pipeline runs in TFS. There is a build agent on a VM in azure in the same virtual network where the VMs are provisioned. The build agent server is also running a tug server. I also have a domain controller and certificate authority as 'persistent' vms to ease the process of remoting to the configured vms (no need to configure trustedhosts etc.)
- build and publish config to tug server in azure.
- provision vms in azure, and join them to the domain.
- apply LCM configuration with configuration names to the provisioned vms
- update-dscconfiguration on the provisioned vms
- execute pester test suite to confirm configuration is correct
- delete azure resource group where the vms were provisioned
The problem is the VMs seem to be immediately applying the configuration after the LCM is configured. I would like to be able to apply the configuration through update-dscconfiguration -verbose -wait -ComputerName $ComputerName so that I can see the result of applying the configuration in the build output. Is there a way to prevent the LCM from automatically pulling and applying configurations when configured?
June 25, 2018 at 4:10 am #103208KeymasterTopics: 13Replies: 4872Points: 1,811Rank: Community Hero
Nope. The LCM is designed to maintain a configuration. Not really an option to run on demand.
June 25, 2018 at 4:30 am #103211
Then it seems the only option for me is to not use pull server, but to publish configuration instead. The nice thing about pull server is it handles all the module installation for you, you don't need to install modules on the remote servers ahead of publishing the configuration (AFAIK)
The way I worked out for fixing my issue was to change order of operations a little bit:
register the lcms to pull server, then immediately queue jobs to update-dscconfiguration. The problem then becomes waiting for configuration to complete, after reboots which I think should be automatic.
June 25, 2018 at 12:37 pm #103231KeymasterTopics: 13Replies: 4872Points: 1,811Rank: Community Hero
Even when pushing a config the LCM can be configured to pull modules from a file server so that you don't have to pre stage them.
June 25, 2018 at 11:20 pm #103271
Cool! I didn't know that, thanks.
Found a blog post which describes how:
The topic ‘Configure LCM so that configuration only applies on demand’ is closed to new replies.