Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR! vars file vars not found on the Ansible Controller

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).

like image 219
kaushik Avatar asked Nov 02 '25 02:11

kaushik


1 Answers

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.

like image 164
Porzio Jonathan Avatar answered Nov 04 '25 04:11

Porzio Jonathan