below is my playbook ia m trying to add some variable in extra_vars: argument and based on the condition but its giving error can some guide me how can we mention this like if string 'oracle' is there in template_name variable i need to add some extra var otherwise it should not add.
- name: Run PPS Patch
template_run:
awx_url: "{{ awx_url }}"
username: "{{ username }}"
password: "{{ password }}"
scm_branch_for_agent: "{{ scm_branch_for_PPS }}"
project_name: "{{ project_name }}"
template_name: "{{ job_temp_name }}"
customEE_name: "{{ customEE_name }}"
inventory_name: "{{ inventory_name }}"
ip_add: "{{ vm_ipv4_address }}"
skip_tags: "{{ skip_tags }}"
extra_vars:
sat_client_id: "{{ sat_client_id }}"
sat_client_secret: "{{ sat_client_secret }}"
websec_prod_id: "{{ websec_prod_id }}"
websec_prod_secret: "{{ websec_prod_secret }}"
radius_secret: "{{ radius_secret }}"
{% if oracle in job_temp_name %}
ansible_distribution: "RedHat"
patch_enablerepo: "value"
standard_enablerepo: "value"
{% endif %}
playbook: "{{ patch_playbook }}"
when: not is_pps_template or ('FAILED' in status_check.tie_patch)
register: ppsstatus_check
until: "'patch.yml completed successfully' in ppsstatus_check.output"
retries: 3
delay: 10
tags:
- pps_update
- pps-patch