On Friday, January 10, 2014 4:16:47 PM UTC-8, Brian Green wrote:
>
> How about keep your default variables in roles/vars/main.yml and then for 
> variables that would be considered special case or overrides you put them 
> elsewhere with higher precedence. For your RHEL 5 example, take a look at 
> http://docs.ansible.com/playbooks_variables.html#conditional-imports and 
> you could use something similar like
> vars/{{  ansible_lsb.id }}_{{ ansible_lsb.major_release }}.yml  where 
> you'd populate the RedHat_5.yml file with any of the variables you need 
> overridden (my variable names/values might need some checking though).
>
> Brian
>
>
I guess I wasn't as clear as I could have been...

I currently have a single task that updates the syslog configuration file 
and restarts the syslog daemon.  It works perfectly for AIX, RedHat 5 and 
RedHat 6.  This is one of many tasks I have written so far.  

The problem I have is that for most of my tasks I have differences between 
RedHat and AIX that require variables...  So I had two variables files that 
I am picking up, one for AIX and one for RedHat.  This is the one place 
that RedHat 5 and RedHat 6 differ in a way that can easily be fixed with 
variables (rsylog versus syslog)... But I either copy my RedHat variable 
file and create two almost identical files with a difference of two lines 
out of 11, or I find another way of doing this... 

For the moment I've copied the RedHat file into RedHat5 and RedHat6.  I was 
just wondering if there was a better way than treating RedHat 5 and RedHat 
6 as different operating systems.

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.

Reply via email to