Uncomplicated, role not found error

I am trying to play the following playlist against a local host to provide a vagrant machine

---
- hosts: all
  become: yes
  roles:
    - base
    - jenkins

I cloned the necessary roles from github and they are in a relative way roles/{role name}

Executing the following command: ansible-playbook -i "localhost," -c local playbook.ymlthrows this error:

==> default: ERROR! the role 'geerlingguy.java' was not found in /home/vagrant/provisioning/roles:/home/vagrant/provisioning:/etc/ansible/roles:/home/vagrant/provisioning/roles
==> default:
==> default: The error appears to have been in '/home/vagrant/provisioning/roles/jenkins/meta/main.yml': line 3, column 5, but may
==> default: be elsewhere in the file depending on the exact syntax problem.
==> default:
==> default: The offending line appears to be:
==> default:
==> default: dependencies:
==> default:   - geerlingguy.java
==> default:     ^ here

I cloned a missing github dependency and tried to find it in a relative way roles/javaand roles/geerlingguy/javaeither didn’t solve the problem and the error remained the same.

I want all roles to be performed locally in a folder with synchronized settings without using runtime using ansible-galaxy to make the initialization method as autonomous as possible.

Here is the structure of the presentation palettes, as of now.

.
├── playbook.yml
└── roles
    ├── base
    │   └── tasks
    │       └── main.yml
    ├── java
    │   ├── defaults
    │   │   └── main.yml
    │   ├── meta
    │   │   └── main.yml
    │   ├── README.md
    │   ├── tasks
    │   │   ├── main.yml
    │   │   ├── setup-Debian.yml
    │   │   ├── setup-FreeBSD.yml
    │   │   └── setup-RedHat.yml
    │   ├── templates
    │   │   └── java_home.sh.j2
    │   ├── tests
    │   │   └── test.yml
    │   └── vars
    │       ├── Debian.yml
    │       ├── Fedora.yml
    │       ├── FreeBSD.yml
    │       ├── RedHat.yml
    │       ├── Ubuntu-12.04.yml
    │       ├── Ubuntu-14.04.yml
    │       └── Ubuntu-16.04.yml
    └── jenkins
        ├── defaults
        │   └── main.yml
        ├── handlers
        │   └── main.yml
        ├── meta
        │   └── main.yml
        ├── README.md
        ├── tasks
        │   ├── main.yml
        │   ├── plugins.yml
        │   ├── settings.yml
        │   ├── setup-Debian.yml
        │   └── setup-RedHat.yml
        ├── templates
        │   └── basic-security.groovy
        ├── tests
        │   ├── requirements.yml
        │   ├── test-http-port.yml
        │   ├── test-jenkins-version.yml
        │   ├── test-plugins-with-pinning.yml
        │   ├── test-plugins.yml
        │   ├── test-prefix.yml
        │   └── test.yml
        └── vars
            ├── Debian.yml
            └── RedHat.yml
+4
2

/roles ( )

ansible-galaxy install -p ROLES_PATH geerlingguy.java

.

requirements.yml, , ansible-galaxy .

- name: run ansible galaxy
  local_action: command ansible-galaxy install -r requirements.yml --ignore-errors
+1

: roles/geerlingguy.java/, roles/geerlingguy/java/

+1

Source: https://habr.com/ru/post/1656802/


All Articles