I noticed the command provider in Pulumi. Is this ...
# getting-started
w
I noticed the command provider in Pulumi. Is this a good option for configuring virtual machines? I have some Powershell scripts I'd like to run, and can invoke via c#/this provider.
l
Yes, especially if you might want to run the same code in containers, locally, in VMs in other clouds, via SSH... etc. If you just want to configure a single VM the same way every time, and want to be able to support rebooting that machine, then user_data / SSM docs might be better suited.
w
This would be for configuring a bunch of Windows servers with some idempotent ps1 scripts.
l
If you want the script to run on demand from a Pulumi console, then Command is good. If you want the script to exist on the target machine and be run by the Windows scheduler or similar, then you can use Command, but probably only to copy the file and set up the scheduler.
And if you want the script to exist "in the cloud" and be run against the machine by AWS/Azure/GCP, then you need to find the appropriate service to do that (in AWS it'd be SSM).
w
I'm looking to trigger the pulumi commands via the pipeline everytime (Octopus). Would pulumi report any config drift/
l
Of software on the machine? No. It'll report if the command gets removed from state, but that's not going to be of any help.
Your script will have to be more than just idempotent, it'll have to log change-detected vs. no-change-detected steps.
You might consider Ansible? A simple Command to kick off Ansible would probably be perfect, if a bit heavyweight...
v
I’d probably look at using a user_data script or something similar to install some sort of config management tool such as Puppet, Ansible or Chef to do the OS-level configuration of the VMs.
l
Cloudinit is a good way to manage that. There's a Pulumi provider for it.
👍 1
w
The problem iwth Ansible is cost. I found a tool from Inedo called Otter whch is just what I need but a bit buggy. I've raised with them. For now, I will just run ps1 scripts from Octopus.
v
cost? ansible is open source mate
<https://www.ansible.com/for/windows>
w
ah i was referring to ansible tower.