title: Set additional ansible module parameter only if variable is defined
body: <p>I have a custom ansible module.</p>
  
  <pre><code> 10 def main():                                                                                                                                          
   11     module = AnsibleModule(                                                                                                                          
   12             argument_spec = dict(                                                                                                                    
   13                 server = dict(required=True, type='str'),                                                                                            
   14                 max_offset = dict(required=False, default=0.100, type='float')                                                                       
   15             ),                                                                                                                                       
   16             supports_check_mode = False                                                                                                              
   17         )                                                                                                                                            
   18                                                                                                                                                      
   19     # Write params into normal variables                                                                                                             
   20     max_offset = module.params['max_offset']                                                                                                         
   21     server = module.params.get('server') 
  </code></pre>
  
  <p>I want to call it with additional parameter only if a variable <code>ntp.max_offset</code> is defined.
  I dont know how to do this.
  So I tried this code: </p>
  
  <pre><code>- name: GROUP::TEST                                                                                                                                 
    ntptest: server="{{ hostvars[item][eth]['ipv4']['address'] }}"                                                                                    
    parameter:                                                                                                                                        
      name: "max_offset"                                                                                                                              
      value: ntp.max_offset                                                                                                                           
      when: ntp.max_offset is defined                                                                                                                 
    register: modules_output                                                                                                                          
    with_items: "{{groups['ntp_servers']}}"                                                                                                           
    when: server is not defined     
  </code></pre>
  
  <p>But unfortunately.</p>