---- name: Test hosts: localhost gather_facts: False connection: local tasks: - include_tasks: "{{ dynamic_variable }}.yml" tags: test
---- ping:
ansible-playbook playbook.ymlVault password:
PLAY [Test] ***********************************************************************************************************************************************************************************************************
TASK [include_tasks] **************************************************************************************************************************************************************************************************included: /etc/ansible/dynamic_variable.yml for localhost
TASK [ping] ***********************************************************************************************************************************************************************************************************ok: [localhost]
PLAY RECAP ************************************************************************************************************************************************************************************************************localhost : ok=2 changed=0 unreachable=0 failed=0
ansible-playbook playbook.yml -t testVault password:
PLAY [Test] ***********************************************************************************************************************************************************************************************************
TASK [include_tasks] **************************************************************************************************************************************************************************************************included: /etc/ansible/dynamic_variable.yml for localhost
PLAY RECAP ************************************************************************************************************************************************************************************************************localhost : ok=1 changed=0 unreachable=0 failed=0
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6368451d-ed81-47f6-b2d9-8946cfca3844%40googlegroups.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 ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
---- name: Test hosts: localhost gather_facts: False connection: local tasks: - set_fact: dynamic_variable: dynamic - import_tasks: "{{ dynamic_variable }}.yml"
ansible-playbook playbook.ymlVault password:ERROR! Error when evaluating variable in include name: {{ dynamic_variable }}.yml.
When using static includes, ensure that any variables used in their names are defined in vars/vars_filesor extra-vars passed in from the command line. Static includes cannot use variables from inventorysources like group or host vars.
--
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+unsubscribe@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/4d934acc-12a9-46d1-8023-4df47d4e78bc%40googlegroups.com.