Hello here s contents of my hosts file. I have separate files for staging 
and vagrant. 

marko@FOX:~/iom/provision$ cat staging 
> [webservers]
> 192.168.0.173  ansible_hostname=webservers ansible_ssh_user=root
> [dbservers]
> 192.168.0.173  ansible_hostname=dbservers ansible_ssh_user=root
>


 

> marko@FOX:~/iom/provision$ cat vagrant 
> [vagrant]
> 33.33.33.14 ansible_hostname=vagrant
>


On Monday, December 16, 2013 8:37:58 AM UTC+1, Marko Lisica wrote:
>
> Hello, I am trying to make simple NGINX template. I have development 
> inventory (it is vagrant) and staging which is remote VPS. I want to make 
> different default root folder and different log location for  these two 
> environments. Ofcorse couldnt manage that :) .
> I have this in my template:
>
> {% if (inventory_hostname in groups['webservers']) %}
>> access_log /var/log/nginx/nginx-access.log;
>> error_log /var/log/nginx/nginx-error.log;
>> {% endif %}
>>
>>
> And for dev environment:
>
>
>
>> {% if (inventory_hostname in groups['vagrant']) %}
>>> access_log /vagrant/log/nginx/nginx-access.log;
>>> error_log /vagrant/log/nginx/nginx-error.log;
>>> {% endif %}
>>>
>>
> Whatever inventory I choose when depoying ansible-playbook I get BOTH of 
> cases created in nginx config file. I am obviously missing something here. 
> Any advice?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to