"It works well but introduces duplication as the first matching file is
selected and I need the non different parameters inside this file too..."

Not sure what you mean by "non-different parameters".

"*First question*, in the above example, common.yml parameter X will get
overidden by {{ansible_os_family}}.yml defined parameter X?"

Yes.  It comes later.

"*Second question*, I would like to separate parameters of OS commands to
one file, Application X to another and so..."

Then consider using group_vars/ variables for these application things.

See also "include_vars" for a module that makes this easy to accomodate
into roles.

- include_vars: "{{ ansible_os_family }}.yml", etc.









On Sun, Jul 13, 2014 at 2:52 PM, Leibo <[email protected]> wrote:

> I would gladly get some advice here.
>
> First, Ansible is so great - I replaced my Puppet proviosning for our UNIX
> hosts in a few days and everything is working so well and easy to maintain.
>
> We support *AIX, HP-UX, Solaris* and *Linux *(*RedHat, Suse, Ubuntu*) so
> I have a commands variance between OS and also between OS variants.
> *Windows *clients support is so so so so asked around here (simple zip
> extracting module, commands execution)
>
> I use roles and at the moment I took all different shared roles parameters
> and shell command paths into param files at playbooks/vars/AIX.yml,
> HP-UX.yml and so...
>
> For Linux - I have Linux.yml, Redhat_7.yml and Suse.yml for example as
> some commands are different between RHEL 5-6, RHEL 7, Ubuntu and Suse and
> some are the same.
>
> In my playbook I use the vars_files feature as I found in the docs example
> below to match for the specific OS version or OS type or Linux in general:
>
> vars_files:
>     - "vars/common.yml"
>     - [ "vars/{{ ansible_os_family }}.yml", "vars/os_defaults.yml" ]
>
>
> It works well but introduces duplication as the first matching file is
> selected and I need the non different parameters inside this file too...
>
> *First question*, in the above example, common.yml parameter X will get
> overidden by {{ansible_os_family}}.yml defined parameter X?
>
> *Second question*, I would like to separate parameters of OS commands to
> one file, Application X to another and so...
>
> I get a real big section of this vars_files that is very ugly to copy
> paste for each playbook...
>
> Can you suggest a better way to handle this please?
>
> Thanks
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/fbf3e9aa-82b0-4822-99c1-199e05c5b98e%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/fbf3e9aa-82b0-4822-99c1-199e05c5b98e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwdAvwzxTHxF3_WFUcaGnygvEVsamp8BGBiOw6C7_ko7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to