Hi all ! is there any way of achieving the following ?no hosts matched ” )
monitor_group = “glance”
hosts: “{{ monitor_group }}” 
{ role: icinga2-check-commands, tags: [‘monitor-cloud’] } 
 
OR
monitor_group = glance
hosts: “{{ monitor_group }}” 
{ role: icinga2-check-commands, tags: [‘monitor-cloud’] } 
 
             
            
              
            
           
          
            
              
                Uwe_Sauter  
              
                  
                    November 13, 2015,  3:58pm
                   
                  2 
               
             
            
              What about:
- vars:
I'm not saying that this'll work as I am trying to figure out variables myself. But you could give it a try.
             
            
              
            
           
          
            
            
              Thank for the response, sorry that i didnt clarify this.
             
            
              
            
           
          
            
              
                Uwe_Sauter  
              
                  
                    November 13, 2015,  4:12pm
                   
                  4 
               
             
            
              I'm not sure I understand which variable troubles you. Is it "monitor_group" or "monitor-cloud" or "monitor_cloud"? Is there a
             
            
              
            
           
          
            
            
              My problem is that i cant use a variable for the "- host: " part to realize what servers to run on.
             
            
              
            
           
          
            
              
                Brian_Coca  
              
                  
                    November 15, 2015,  8:17pm
                   
                  7 
               
             
            
              group_vars/ are loaded AFTER -hosts: so you cannot use them to set the
ansible-playbook ... play.yml ... -e 'monitor_group=<hostname>'
             
            
              
            
           
          
            
            
              Genius Brian.