On Friday, January 10, 2014 8:11:24 PM UTC-8, Brian Green wrote:
>
> Would the following work? For the few variables that differ, substitute
> them at the beginning of the playbook. It could even allow you to use a
> single variable file if you extrapolate all your variables in this manner.
>
> vars:
> syslog_var: "{{ ansible_lsb.id }}_{{ ansible_lsb.major_release
> ))_syslog_var"
> syslog_var2: "{{ ansible_lsb.id }}_{{ ansible_lsb.major_release
> ))_syslog_var2"
> and use {{ syslog_var }} in the tasks/templates.
>
> Then in your RHEL vars file:
> RedHat_5_syslog_var: foo
> RedHat_6_syslog_var: bar
> RedHat_5_syslog_var2: foo2
> RedHat_6_syslog_var2: bar2
>
> And similar for the AIX vars file.
>
> You could use conditionals at the task level, or in templates, but if you
> only have a couple differences, I think this is a simpler method.
>
>
>
Indeed, and I think that that idea might expand further to help simplify
some of my other tasks. Of course I won't be able to resolve every issue
like that, RedHat Registration requires different modules on RedHat 5 and
RedHat 6 unfortunately, but I'm going to have to see how much I can improve
by changing variables around.
Thank you very much for the idea.
Adam
--
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.