mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix determination if a few configurations change in the launch config
This commit is contained in:
parent
e905162571
commit
6a6faeb506
1 changed files with 16 additions and 5 deletions
|
@ -131,6 +131,8 @@ EXAMPLES = '''
|
||||||
register: asg
|
register: asg
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import base64
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pyrax
|
import pyrax
|
||||||
HAS_PYRAX = True
|
HAS_PYRAX = True
|
||||||
|
@ -261,14 +263,23 @@ def rax_asg(module, cooldown=300, disk_config=None, files={}, flavor=None,
|
||||||
if flavor != lc.get('flavor'):
|
if flavor != lc.get('flavor'):
|
||||||
lc_args['flavor'] = flavor
|
lc_args['flavor'] = flavor
|
||||||
|
|
||||||
if disk_config != lc.get('disk_config'):
|
disk_config = disk_config or 'AUTO'
|
||||||
|
if ((disk_config or lc.get('disk_config')) and
|
||||||
|
disk_config != lc.get('disk_config')):
|
||||||
lc_args['disk_config'] = disk_config
|
lc_args['disk_config'] = disk_config
|
||||||
|
|
||||||
if meta != lc.get('metadata'):
|
if (meta or lc.get('meta')) and meta != lc.get('metadata'):
|
||||||
lc_args['metadata'] = meta
|
lc_args['metadata'] = meta
|
||||||
|
|
||||||
if files != lc.get('personality'):
|
test_personality = []
|
||||||
lc_args['personality'] = files
|
for p in personality:
|
||||||
|
test_personality.append({
|
||||||
|
'path': p['path'],
|
||||||
|
'contents': base64.b64encode(p['contents'])
|
||||||
|
})
|
||||||
|
if ((test_personality or lc.get('personality')) and
|
||||||
|
test_personality != lc.get('personality')):
|
||||||
|
lc_args['personality'] = personality
|
||||||
|
|
||||||
if nics != lc.get('networks'):
|
if nics != lc.get('networks'):
|
||||||
lc_args['networks'] = nics
|
lc_args['networks'] = nics
|
||||||
|
@ -283,7 +294,7 @@ def rax_asg(module, cooldown=300, disk_config=None, files={}, flavor=None,
|
||||||
if config_drive != lc.get('config_drive'):
|
if config_drive != lc.get('config_drive'):
|
||||||
lc_args['config_drive'] = config_drive
|
lc_args['config_drive'] = config_drive
|
||||||
|
|
||||||
if user_data != lc.get('user_data'):
|
if base64.b64encode(user_data) != lc.get('user_data'):
|
||||||
lc_args['user_data'] = user_data
|
lc_args['user_data'] = user_data
|
||||||
|
|
||||||
if lc_args:
|
if lc_args:
|
||||||
|
|
Loading…
Reference in a new issue