I have the following yml file:

# Kill RTS components
---
- hosts: realtime_system_components
  user: dataxu
  vars_files:
    - vars/globals.yml
    - vars/realtime_system.yml
    - rules/realtime_system/defaults/{{ host }}.yml
  tasks:
    - include: tasks/realtime_system/kill.yml

I have defined the child 'request_router' as part of hosts 
realtime_system_components:

  - name: realtime_system_components
    children: [request_router]

The file rules/realtime_system/defaults/request_router.yml contains:

---
component_script: 'requestrouter.sh'
process_identifier: 'log4j-dxad-web.xml'

tasks/realtime_system/kill.yml is the following:

# Kills the RTS Component

- name: Kill process if not stopped gracefully
  shell: echo process_identifier is {{ process_identifier }}
  ignore_errors: True

When I echo process_identifier in tasks/realtime_system/kill.yml I get:

TASK: [Kill process if not stopped gracefully] 
******************************** 
fatal: [router.releng.net] => One or more undefined variables: 
'process_identifier' is undefined

Why isn't process_identifier in 
rules/realtime_system/defaults/request_router.yml which is dynamically 
being defined, and found, here: "- rules/realtime_system/defaults/{{ host 
}}.yml" making it into the task?

Thanks.

Mike

-- 
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