I am using the following site.yml
playbook and calling it via
ansible-playbook site.yml
- hosts: some_hosts
vars:
pip_install_packages:
- name: docker
- tasks:
- name: Conditionally include bar vars
include_vars:
file: bar_vars.yml
when: some_condition == "bar"
- name: Conditionally include foo vars
include_vars:
file: foo_vars.yml
when: some_condition == "foo"
roles:
- role1
- role2
environment:
SOME_ENV_VAR: "{{ vault_some_env_var }}"
Call is failing as follows:
ERROR! the field 'hosts' is required but was not set
But as is apparent above, the hosts
field has been set!
Any suggestions?