Roles Variables not being Parsed - Playbook vars being applied

Hi everyone - Looking for some guidance on what i am missing in relation to calling a role during a playbook.

The issue i am having is this:

I run the playbook fine it carries out the pre_tasks as expected, however when it gets to call the oracle role, it starts going through the oracle role tasks but it does not pick up the role specific variables in the roles/oracle_full_client/vars/main.yml file.
It still uses the initial vars as defined in the playbook rather than the roles var directory?

Can anyone tell me what i’m doing wrong? I use lvname and volgroup as a default variable name per role. So in this case lvname = apps-was but in the role its calling should be called apps-ora.
When this runs the playbook its passing apps-was instead of apps-ora!

Do i have to pass the location of the vars role directory somewhere?
Ansible version is 1.9.2.

Thanks

`

  • hosts: all
    become: true
    become_method: sudo

Variables

vars:
base_dir: “/share/bbscripts/PRD/”
volgroup: “VolGroup00”
lvname: “apps-was”
was_dir: “/apps/was”
vol_size: “2048m”

Include Vars Files

vars_files:

  • “vars/{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/vars.yml”

pre_tasks:

  • name: “echo_distrib”
    shell: echo “{{ ansible_distribution_major_version }}”

Create apps-was volume

  • name: “create_volume”
    lvol: vg=“{{ volgroup }}” lv=“{{ lvname }}” size=“{{ vol_size }}”

RUN ORACLE Role

roles:

  • role: oracle_full_client

post_tasks:

  • name: “create_limits.d/95-was.conf”
    copy: src=files/95-was.conf dest=/etc/security/limits.d/95-was.conf mode=0644 force=no

  • name: AND SO ON … >>>>

`

Ok so I have answered my own question this time

It is as simple as NOT Stating

vars:

at the beginning of your role/x/vars/main.yml file!

Can’t believe this wasnt in the documentation.

Sorted and playbook ran cool

PLAY RECAP ********************************************************************
ok=62 changed=39 unreachable=0 failed=0