"{{ host }}" doesn't exist, but "{{ inventory_hostname }}" which is the
name of the host in the host loop and "{{ ansible_hostname }}" which is the
name of the discovered hostname of the the host, does exist.On Mon, Dec 16, 2013 at 2:24 PM, Mike Cavedon <[email protected]> wrote: > 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. > -- Michael DeHaan <[email protected]> CTO, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- 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.
