I've got a variable in Ansible that I use to pass environment variables to a task. However, I've got another playbook that uses the role, and I'd like to tack more values onto the variable. How can I accomplish this? For example, I want to have a different ORACLE_HOME depending on which type of server I'm running the playbook against.
--- group_vars/application.yml
environment_vars:
PIP_EXTRA_INDEX_URL=https://my.local.repo/pypi
--- group_vars/ubuntu.yml
environment_vars:
ORACLE_HOME: '/usr/lib/oracle/instantclient_11_2'
--- group_vars/centos.yml
environment_vars:
ORACLE_HOME: '/opt/oracle/instantclient_11_2'
--- roles/test_role/tasks/main.yml
- name: Install Python Requirements
pip:
name: my_app==1.0
environment: environment_vars
--- main.yml
- hosts: application
roles:
- role: test_role
--- inventory
[application:children]
ubuntu
centos