Add check for README + add missing README
diff --git a/roles/portworx/README.md b/roles/portworx/README.md
new file mode 100644
index 0000000..f456a3d
--- /dev/null
+++ b/roles/portworx/README.md
@@ -0,0 +1 @@
+# `portworx`
diff --git a/zuul.d/playbooks/build-collection/pre.yml b/zuul.d/playbooks/build-collection/pre.yml
index a9e076c..fca4d62 100644
--- a/zuul.d/playbooks/build-collection/pre.yml
+++ b/zuul.d/playbooks/build-collection/pre.yml
@@ -18,6 +18,28 @@
- name: Prepare for collection build
hosts: all
tasks:
+ - name: Find all roles
+ find:
+ paths: "{{ zuul.project.src_dir }}/roles/"
+ file_type: directory
+ register: role_dirs
+
+ - name: Check for README.md in each role
+ stat:
+ path: "{{ item.path }}/README.md"
+ register: readme_check
+ loop: "{{ role_dirs.files }}"
+ loop_control:
+ label: "{{ item.path }}"
+
+ - name: Fail if any role is missing README.md
+ fail:
+ msg: "Missing README.md in role {{ item.item.path }}"
+ when: not item.stat.exists
+ loop: "{{ readme_check.results }}"
+ loop_control:
+ label: "{{ item.item.path }}"
+
- name: Pin all image digests
ansible.builtin.include_role:
name: tox