title: key value pair mapping in ansible to pass run the role with the appropriate value
body: <p>I am new to ansible. I have a small scenario.
  So I pass the name of the branch using ansible when I run it.
  In my play book I have:</p>
  
  <pre><code># Deploy docker container
  - include_role:
      name: devops/deployment.docker
    vars:
      docker_name: "docker name is based on the branch id develop dev if UAT test if master then it should be prod"
    when: build_type in "develop master UAT"
  </code></pre>
  
  <p>and in devops/deployment.docker I have a role which deploy a docker image.</p>
  
  <pre><code>- name: push docker container
    docker_image:
      name: "{{ docker.registery }}/docker_name"
      source: build
      build: 
        nocache: true
        path: "{{ travis.base_build_path }}"
      tag: "{{ ucd.component_version }}"
      push: yes
  </code></pre>
  
  <p>So I send build_type as develop,UAT or master when I run the ansible this role will be called. Now there is an issue:</p>
  
  <p>I need to build my image based on the branch so the code needs to be intelligent and when I send develop it should go search for the key assigned to develop and get the related docker name and build it. something similar to this:</p>
  
  <pre><code>{
   develop: {
    dockerName:dev
   },
   master: {
    dockerName: prod
    },
   UAT: {
     dockerName: test
   }
  }
  </code></pre>
  
  <p>If anyone help me how to do it in ansible I really appreciate it</p>