Open mthibaut opened 1 year ago
I don't think that salt-cloud in general or rather cloud providers should be idempotent. What should be idempotent is the use of the Cloud Map File in salt-cloud.
Cloud maps let you define a map of your infrastructure and quickly provision any number of VMs. On subsequent runs, any VMs that do not exist are created, and VMs that are already configured are left unmodified.
I did not find such a definition anywhere for the creation of VMs via salt-cloud -p
.
So my answers to your questions are:
salt-cloud -p
should fail.salt-cloud -p
should fail.True idempotence likely won't be achieved in the cloud module without changes to the underlying salt-cloud code. Currently, salt-cloud will create any instances where the name is not found in the cloud. If the name is found, it will not be created. If the configuration is changed for a given instance, the instance will need to be destroyed and created again for the change to take effect. Instance configuration cannot be enforced with salt-cloud.
That said, there's no reason that we can't create execution and state modules for idempotent creation and maintenance of cloud instances. There was a push toward this in a recent release of the Azure Extension.
Decide on semantics
Describe the solution you'd like Unsure.
Additional context Calling
salt-cloud -p myprofile myguest
fails ifmyguest
exists. Is this expected behavior?