tls_machine is not mandatory
This commit is contained in:
parent
4bacf38188
commit
7f745b3609
1 changed files with 4 additions and 4 deletions
|
@ -154,7 +154,7 @@ def run_module():
|
|||
module_args = dict(
|
||||
state=dict(type='str', required=True),
|
||||
machines=dict(type='list', required=True),
|
||||
tls_machine=dict(type='str', required=True),
|
||||
tls_machine=dict(type='str', required=False),
|
||||
)
|
||||
|
||||
# seed the result dict in the object
|
||||
|
@ -184,10 +184,10 @@ def run_module():
|
|||
# manipulate or modify the state as needed (this is going to be the
|
||||
# part where your module will do what it needs to do)
|
||||
machines = module.params['machines']
|
||||
tls_machine = module.params['tls_machine']
|
||||
tls_machine = module.params.get('tls_machine')
|
||||
if module.params['state'] == 'stopped':
|
||||
if tls_machine and tls_machine not in machines:
|
||||
machines.append(tls_machine)
|
||||
if tls_machine and tls_machine in machines:
|
||||
machines.remove(tls_machine)
|
||||
bus = SystemBus()
|
||||
result['changed'], errors = stop(bus, machines)
|
||||
if errors:
|
||||
|
|
Loading…
Reference in a new issue