On Monday, 23 April 2018 17:18:59 UTC+3, Vlad wrote:
>
> Hi,
>
> I have multiple groups in inventory that use the same host. The idea is 
> that on the same hosts we want to install multiple applications, and the 
> name of the applications should be called as a group
>
> - inventories
>   - staging
>      - group_vars
>          - web.yml
>          - backend1.yml
>          - web1.yml
>      - hosts
>
> The hosts file contains:
>   [web]
>   host1
>   
>   [web1]
>   host1
>
>   [backend]
>   host1
>
> In group_vars every yml file contains variables and this variables are 
> used in templates. Every time when I run ansible-playbook I would like to 
> use only on yml file from group_vars not all of them, for example when I 
> run ansible-playbook for web1, I want to use group_vars/web1.yml variables 
> not from all files from group_vars.
>
> The playbook file:
> ---
> - hosts: "{{ application_name }}"
>   gather_facts: no
>   serial: 1
>
>   roles:
>     - role1
>     - role2
>     - role3
>
> The roles are dynamically and runs the tasks based on the variables from 
> inventory.
>
> Can somebody help ?
>       
>

After some research I used this steps from 
here https://github.com/ansible/ansible/issues/9065#issuecomment-379246209 
. A hateful hack

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6c1952f6-ee47-4321-9080-485e79581fb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to