Hi all,

I'm new to Ansible and a writing a few python network modules. I was 
wondering if it is possible to write a module that uses one of two 
different sets of parameters based on a version parameter. For example, I 
have the two tasks with slightly different parameters that do the same 
thing. I would like to call the same module for both.

Tasks Pseudocode:

- name: Task Version 1
  test_task:
    version: 1
    parameter1: test

- name: Task Version 2
  test_task:
    version: 2
    param_container:
      parameter1: test

So here the task does the same thing, but the arguments change slightly 
based on the version. The version must be passed in by the user somehow. Is 
it possible to write a module that uses different parameters based on 
another parameter? 

I have already tried creating multiple Ansible module objects and creating 
two separate modules with an abstraction layer, but nothing seems to be 
working.

Sorry if this is obvious, but I would really appreciate the help!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/0d3cf09e-2955-4a89-ac6f-4f03d000ca80o%40googlegroups.com.

Reply via email to