Add support for post_uri in SoftLayer cloud drivers

This commit is contained in:
rallytime 2015-09-18 16:24:51 -06:00
parent 2d6c75cbd7
commit aafb776808
3 changed files with 25 additions and 0 deletions

View file

@ -198,6 +198,19 @@ max_net_speed
Specifies the connection speed for the instance's network components. This
setting is optional. By default, this is set to 10.
post_uri
--------
Specifies the uri location of the script to be downloaded and run after the instance
is provisioned.
.. versionadded:: 2015.8.1
Example:
.. code-block:: yaml
base_softlayer_ubuntu:
post_uri: 'https://SOMESERVERIP:8000/myscript.sh'
public_vlan
-----------
If it is necessary for an instance to be created within a specific frontend

View file

@ -355,6 +355,12 @@ def create(vm_):
'maxSpeed': int(max_net_speed)
}]
post_uri = config.get_cloud_config_value(
'post_uri', vm_, __opts__, default=None
)
if post_uri:
kwargs['postInstallScriptUri'] = post_uri
salt.utils.cloud.fire_event(
'event',
'requesting instance',

View file

@ -293,6 +293,12 @@ def create(vm_):
)
kwargs['prices'].append({'id': bandwidth})
post_uri = config.get_cloud_config_value(
'post_uri', vm_, __opts__, default=None
)
if post_uri:
kwargs['prices'].append({'id': post_uri})
vlan_id = config.get_cloud_config_value(
'vlan', vm_, __opts__, default=False
)