robertdebock / ansible-collection-roles

A collection of roles found on robertdebock.nl.
Apache License 2.0
36 stars 15 forks source link

UPDATING.sh: Use proper role FQCNs. #3

Closed gotmax23 closed 1 year ago

gotmax23 commented 2 years ago

Let me know if you have any suggestions on how to improve this. I tried to make this as narrow as possible to avoid false positives. Before this, the example playbooks didn't work properly and any role that had a dependency would fail.

For example, the PHP role fails to run, because the collection does not satisfy its dependencies in meta/main.yml.

# playbook.yml
---
- name: Prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.roles.bootstrap
    - role: robertdebock.roles.epel
    - role: robertdebock.roles.python_pip
    - role: robertdebock.roles.buildtools
    - role: robertdebock.roles.openssl
      openssl_items:
        - name: apache-httpd
          common_name: "{{ ansible_fqdn }}"
    - role: robertdebock.roles.httpd
- name: Converge
  hosts: all
  become: yes
  gather_facts: yes

  roles:
    - role: robertdebock.roles.php
# ansible-playbook -i 'localhost,' -c local ./playbook.yml
ERROR! the role 'robertdebock.httpd' was not found in robertdebock.roles:ansible.legacy:/pwd/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/root/.ansible/collections/ansible_collections/robertdebock/roles/roles:/pwd

The error appears to be in '/root/.ansible/collections/ansible_collections/robertdebock/roles/roles/php/meta/main.yml': line 35, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

dependencies:
  - robertdebock.httpd
    ^ here
csuka commented 2 years ago

Dang, almost 200 files changed, and the only thing added is a string 'role', for each role. Talking about making things over complicated. I guess this commit now has become outdated...

robertdebock commented 2 years ago

That's a lot of changes! I'll try a e pull, otherwise I'll steal the script and push myself.