Skip to content

Instantly share code, notes, and snippets.

@halkyon
Last active September 7, 2020 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halkyon/07d4dd932d567ff6a1571dec4afc817e to your computer and use it in GitHub Desktop.
Save halkyon/07d4dd932d567ff6a1571dec4afc817e to your computer and use it in GitHub Desktop.
Patch for salt-cloud digitalocean integration to support setting VPC for private networking
--- /usr/lib/python3/dist-packages/salt/cloud/clouds/digitalocean.py 2020-09-07 11:02:31.000000000 +1200
+++ /usr/lib/python3/dist-packages/salt/cloud/clouds/digitalocean_new.py 2020-09-07 11:04:47.000000000 +1200
@@ -357,6 +357,11 @@
if not isinstance(private_networking, bool):
raise SaltCloudConfigError("'private_networking' should be a boolean value.")
kwargs['private_networking'] = private_networking
+ vpc_uuid = config.get_cloud_config_value(
+ "vpc_uuid", vm_, __opts__, search_global=False, default=None,
+ )
+ if vpc_uuid is not None:
+ kwargs["vpc_uuid"] = vpc_uuid
if not private_networking and ssh_interface == 'private':
raise SaltCloudConfigError(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment