salt-cloud: allow map nodes to override provider #47648
What does this PR do?
due to the way salt-cloud was previously pulling provider from only the profile,
What issues does this PR fix or reference?
provider in map files were ignored
provider override in map file works as expected
Commits signed with GPG?
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.
The text was updated successfully, but these errors were encountered:
@gtmanfred I'm pretty sure that bug is caused by https://github.com/bloomberg/salt/blob/4b8707054a8986899bc4530c843ad1f9e8fb8150/salt/cloud/__init__.py#L1951 not using salt.utils.dictupdate.update. I'll try to confirm/test tomorrow if I can find some spare cycles.
due to the way salt-cloud was previously pulling provider from only the profile, it made it impossible to use map node overrides to override a provider. This patch makes that possible. The main usecase for this is having profiles that model your node type (db, webapp, etc), without having to duplicate across providers. Your map can then specify provider specific overrides whilst keeping profiles unique and DRY: webapp: - node1: provider: ny:openstack - node2: provider: nj:openstack - node3: provider: toronto:openstack etc.
shallow copy was blasting things like minion_master in provider when grains were provided in map and profile. additionally noticed a bug while adding tests that map_data() is destructive on self.rendered_map; we now deepcopy before map_data does its thing.