[ec2] Use user_data if specified (#54494)
* Use user_data if specified * changelog
This commit is contained in:
parent
d53c3cd4f2
commit
ba8b5ec0d3
2 changed files with 6 additions and 2 deletions
3
changelogs/fragments/54494-ec2-user-data.yaml
Normal file
3
changelogs/fragments/54494-ec2-user-data.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- ec2 - Only use user_data if the user has specified a value.
|
||||
This prevents setting the instance's user data to b'None'.
|
|
@ -1070,8 +1070,9 @@ def create_instances(module, ec2, vpc, override_count=None):
|
|||
'placement': zone,
|
||||
'instance_type': instance_type,
|
||||
'kernel_id': kernel,
|
||||
'ramdisk_id': ramdisk,
|
||||
'user_data': to_bytes(user_data, errors='surrogate_or_strict')}
|
||||
'ramdisk_id': ramdisk}
|
||||
if user_data is not None:
|
||||
params['user_data'] = to_bytes(user_data, errors='surrogate_or_strict')
|
||||
|
||||
if ebs_optimized:
|
||||
params['ebs_optimized'] = ebs_optimized
|
||||
|
|
Loading…
Reference in a new issue