ERROR! vars file vars not found on the Ansible Controller

ansibleansible-2.xansible-role

ERROR! vars file vars not found on the Ansible Controller. If you are using a module and expect the file to exist on the remote, see the remote_src option.

---
# tasks file for user-management
- hosts: linux
  become: yes
  vars_files:
    - vars/active-users
    - vars/remove-users
  roles:
    - { role: user-management }
  tasks:
    - import_tasks: /tasks/user-accounts.yml
    - import_tasks: /tasks/authorized-key.yml

Trying to run the main.yml on a server to execute on remote hosts (linux). The vars playbook in the vars directory has two playbooks (active-users, remove-users).

Best Answer

Your vars folder should be at the same level than your playbook. If yes would it be possible that you missed .yml extension of your active-users and remove-users.

Related Topic