@ -86,8 +86,8 @@ options:
runnable_type :
description :
- vDirect runnable type .
- May be ConfigurationTemplate , WorkflowTemplate or a Workflow .
required : true
choices : [ ' ConfigurationTemplate ' , ' Workflow ' , ' WorkflowTemplate ' ]
runnable_name :
description :
- vDirect runnable name to run .
@ -99,7 +99,7 @@ options:
- Required if I ( runnable_type = Workflow ) .
parameters :
description :
- Action parameters dictionary . In case of C onfigurationTemplate runnable type ,
- Action parameters dictionary . In case of C ( C onfigurationTemplate) runnable type ,
- the device connection details should always be passed as a parameter .
requirements :
@ -143,15 +143,11 @@ WORKFLOW_CREATION_SUCCESS = 'Workflow created.'
WORKFLOW_ACTION_SUCCESS = ' Workflow action run completed. '
meta_args = dict (
vdirect_ip = dict (
required = True , fallback = ( env_fallback , [ ' VDIRECT_IP ' ] ) ,
default = None ) ,
vdirect_user = dict (
required = True , fallback = ( env_fallback , [ ' VDIRECT_USER ' ] ) ,
default = None ) ,
vdirect_ip = dict ( required = True , fallback = ( env_fallback , [ ' VDIRECT_IP ' ] ) ) ,
vdirect_user = dict ( required = True , fallback = ( env_fallback , [ ' VDIRECT_USER ' ] ) ) ,
vdirect_password = dict (
required = True , fallback = ( env_fallback , [ ' VDIRECT_PASSWORD ' ] ) ,
default= None , no_log= True , type = ' str ' ) ,
no_log = True , type = ' str ' ) ,
vdirect_secondary_ip = dict (
required = False , fallback = ( env_fallback , [ ' VDIRECT_SECONDARY_IP ' ] ) ,
default = None ) ,
@ -176,7 +172,7 @@ meta_args = dict(
runnable_type = dict (
required = True ,
choices = [ CONFIGURATION_TEMPLATE_RUNNABLE_TYPE , WORKFLOW_TEMPLATE_RUNNABLE_TYPE , WORKFLOW_RUNNABLE_TYPE ] ) ,
runnable_name = dict ( required = True , default = None ),
runnable_name = dict ( required = True ),
action_name = dict ( required = False , default = None ) ,
parameters = dict ( required = False , type = ' dict ' , default = { } )
)
@ -309,12 +305,12 @@ class VdirectRunnable(object):
def main ( ) :
if not HAS_REST_CLIENT :
raise ImportError ( " The python vdirect-client module is required " )
module = AnsibleModule ( argument_spec = meta_args ,
required_if = [ [ ' runnable_type ' , WORKFLOW_RUNNABLE_TYPE , [ ' action_name ' ] ] ] )
if not HAS_REST_CLIENT :
module . fail_json ( msg = " The python vdirect-client module is required " )
try :
vdirect_runnable = VdirectRunnable ( module . params )
result = vdirect_runnable . run ( )