By all accounts that I can see, the following should work: --- - hosts: server01 remote_user: jlouthan vars: proddbhost: proddb01 tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true
- name: Get current datestamp local_action: command bash -c 'date +%Y-%m-%d' register: datestamp run_once: true - include: playbook-01.yml And within playbook-01.yml, I have: --- - hosts: "{{ proddbhost }}" Yet, I get: ERROR! 'proddbhost' is undefined Also, will the datestamp and timestamp I have registered pass on to the included playbook? -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e4b917de-7a05-4967-bd45-f35c24f18aca%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.