-2

I am running ansible like so:

ansible-playbook -i hosts setup_my_host_name.yml

I am getting the error:

ERROR! the role 'zzet.rbenv' was not found in /Users/user_name/repo_name/roles:/Users/user_name/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/user_name/repo_name

The error appears to be in '/Users/user_name/repo_name/setup_my_host_name.yml': line 83, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - role: zzet.rbenv
      ^ here

The relevant lines from the yml file are:

  roles:
    - role: zzet.rbenv

How can I fix the error? Is there anything missing in my ansible installation?

Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47
  • Does this answer your question? [Ansible, role not found error](https://stackoverflow.com/questions/39873635/ansible-role-not-found-error) – β.εηοιτ.βε Jul 18 '22 at 19:11
  • @β.εηοιτ.βε: Thank you, it is similar, so I added this link to my answer! However, both my question **and** the solution in my answer are simpler, and it worked for me. – Timur Shtatland Jul 18 '22 at 19:16
  • A solution that do work for one person is not what StackOverflow Is thriving as a Q&A, otherwise it would be flooded with tons of similar questions to do the exact same to install package Z instead of package Y. Plus, the dupe actual raises the good way to do it in an overall manner: via a requirements file. – β.εηοιτ.βε Jul 18 '22 at 19:20

1 Answers1

1

Install the missing role:

ansible-galaxy install zzet.rbenv

Output:

Starting galaxy role install process
- downloading role 'rbenv', owned by zzet
- downloading role from https://github.com/zzet/rbenv/archive/3.6.0.tar.gz
- extracting zzet.rbenv to /Users/user_name/.ansible/roles/zzet.rbenv
- zzet.rbenv (3.6.0) was installed successfully

REFERENCES:

SEE ALSO:

Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47