title: Invoke multiple roles in Ansible with where condition
body: <p>Is there a possibility to invoke roles depends on the when condition OR may be use Ansible handlers?</p>
  
  <p>I have a below playbook which gets the current status of deployment on remote host and if and only required then perform the next steps. Below is the validation.yml from validations role (1st one to invoke) which does the validations -</p>
  
  <pre><code>---
   - name: Getting the status of current deployment
     stat:
       path: "{{ tomcat_symlink_path }}"
     register: p
  
   - set_fact:
       current_release: "{{ p.stat.lnk_target.split('/')[4] | regex_replace('^Release(.*)$', '\\1') }}"
  
   - debug:
       msg: "The currently deployed release is : {{ p.stat.lnk_target.split('/')[4] | regex_replace('^Release(.*)$', '\\1') }}"
  
   - name: Copying Application Configuration files and get the checksum
     template:
        src: "{{ item }}"
        dest: "{{config_location}}/{{ item | basename | regex_replace('.j2$', '') }}"
        mode: 0755
     with_fileglob:
      - /temp/env/*.j2
     register: config_var
  
   - block:
      - name: "Exit the deployment if no changes required...."
        debug:
          msg: "Target Release and currently deployed release is same OR no configuration changed required.. so Exiting the Deployment!!!!"
  
      - meta: end_play
     when: myvm_release_version == current_release and  config_var.changed  == false
  </code></pre>
  
  <p>Now depends on the above 2 variables. I need to invoke roles. For example -</p>
  
  <ol>
  <li><p>if  <code>config_var.changed  == true</code> and <code>myvm_release_version == current_release</code>  then invoke only roles <strong>stoptomcat</strong> and <strong>starttomcat</strong> and exit the deployment because it is just the config change so only restart tomcat is required.</p></li>
  <li><p>if only <code>config_var.changed  == false</code> and <code>myvm_release_version != current_release</code>  then continue with the playbook which will execute everything and all the roles</p></li>
  </ol>
  
  <p>This may be a weird requirement but may be someone expert can throw some light on it.</p>