ci: move keycloak+aio+csi jobs to zuul (#1043)

Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>
diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
new file mode 100644
index 0000000..f67102a
--- /dev/null
+++ b/zuul.d/jobs.yaml
@@ -0,0 +1,71 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- job:
+    name: atmosphere-molecule
+    parent: tox
+    abstract: true
+    pre-run: zuul.d/playbooks/molecule/pre.yml
+
+- job:
+    name: atmosphere-molecule-keycloak
+    parent: atmosphere-molecule
+    pre-run: zuul.d/playbooks/molecule-keycloak/pre.yml
+    vars:
+      tox_envlist: molecule-keycloak
+
+- job:
+    name: atmosphere-molecule-csi
+    parent: atmosphere-molecule
+    run: zuul.d/playbooks/molecule-csi/run.yml
+    abstract: true
+
+- job:
+    name: atmosphere-molecule-csi-local-path-provisioner
+    parent: atmosphere-molecule-csi
+    vars:
+      csi_driver: local-path-provisioner
+
+- job:
+    name: atmosphere-molecule-csi-rbd
+    parent: atmosphere-molecule-csi
+    vars:
+      csi_driver: rbd
+
+- job:
+    name: atmosphere-molecule-aio
+    parent: atmosphere-molecule
+    abstract: true
+    timeout: 7200
+    pre-run: zuul.d/playbooks/molecule-aio/pre.yml
+    run: zuul.d/playbooks/molecule-aio/run.yml
+    post-run: zuul.d/playbooks/molecule-aio/post.yml
+    roles:
+      - zuul: openstack/openstack-helm-infra
+    nodeset:
+      nodes:
+        - name: ubuntu-jammy
+          label: jammy-16c-64g
+
+- job:
+    name: atmosphere-molecule-aio-openvswitch
+    parent: atmosphere-molecule-aio
+    vars:
+      network_backend: openvswitch
+
+- job:
+    name: atmosphere-molecule-aio-ovn
+    parent: atmosphere-molecule-aio
+    vars:
+      network_backend: ovn
diff --git a/zuul.d/playbooks/molecule-aio/post.yml b/zuul.d/playbooks/molecule-aio/post.yml
new file mode 100644
index 0000000..d711edc
--- /dev/null
+++ b/zuul.d/playbooks/molecule-aio/post.yml
@@ -0,0 +1,26 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- hosts: all
+  become: true
+  vars:
+    work_dir: "{{ zuul.project.src_dir }}"
+    logs_dir: "/tmp/logs"
+  roles:
+    - gather-host-logs
+    - helm-release-status
+    - describe-kubernetes-objects
+    - gather-pod-logs
+    - gather-prom-metrics
+    - gather-selenium-data
diff --git a/zuul.d/playbooks/molecule-aio/pre.yml b/zuul.d/playbooks/molecule-aio/pre.yml
new file mode 100644
index 0000000..8443f26
--- /dev/null
+++ b/zuul.d/playbooks/molecule-aio/pre.yml
@@ -0,0 +1,21 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Prepare host for Molecule
+  hosts: all
+  tasks:
+    - name: Install "jq" for log collection
+      become: true
+      ansible.builtin.package:
+        name: jq
diff --git a/zuul.d/playbooks/molecule-aio/run.yml b/zuul.d/playbooks/molecule-aio/run.yml
new file mode 100644
index 0000000..92bdf0c
--- /dev/null
+++ b/zuul.d/playbooks/molecule-aio/run.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- hosts: all
+  become: true
+  roles:
+    - tox
+  vars:
+    tox_envlist: "molecule-aio-{{ network_backend }}"
diff --git a/zuul.d/playbooks/molecule-csi/run.yml b/zuul.d/playbooks/molecule-csi/run.yml
new file mode 100644
index 0000000..ce4465e
--- /dev/null
+++ b/zuul.d/playbooks/molecule-csi/run.yml
@@ -0,0 +1,20 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- hosts: all
+  become: true
+  roles:
+    - tox
+  vars:
+    tox_envlist: "molecule-csi-{{ csi_driver }}"
diff --git a/zuul.d/playbooks/molecule-keycloak/pre.yml b/zuul.d/playbooks/molecule-keycloak/pre.yml
new file mode 100644
index 0000000..ab0c6e1
--- /dev/null
+++ b/zuul.d/playbooks/molecule-keycloak/pre.yml
@@ -0,0 +1,18 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Prepare host for Keycloak tests
+  hosts: all
+  roles:
+    - ensure-docker
diff --git a/zuul.d/playbooks/molecule/pre.yml b/zuul.d/playbooks/molecule/pre.yml
new file mode 100644
index 0000000..447f05e
--- /dev/null
+++ b/zuul.d/playbooks/molecule/pre.yml
@@ -0,0 +1,27 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- name: Prepare host for Molecule tests
+  hosts: all
+  tasks:
+    - name: Disable swap
+      ansible.builtin.command: swapoff -a
+      ignore_errors: yes
+
+    # TODO(mnaser): Drop this when we can use https://github.com/vexxhost/atmosphere/pull/977
+    - name: Prefix all images for the job to point to mirror
+      ansible.builtin.shell: |
+        sed -i 's/  \(.*\): \(.*\)$/  \1: registry.atmosphere.dev\/\2/' roles/defaults/vars/main.yml
+      args:
+        chdir: "{{ zuul.project.src_dir }}"
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
new file mode 100644
index 0000000..a94f6dc
--- /dev/null
+++ b/zuul.d/project.yaml
@@ -0,0 +1,22 @@
+# Copyright (c) 2024 VEXXHOST, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+- project:
+    check:
+      jobs:
+        - atmosphere-molecule-aio-openvswitch
+        - atmosphere-molecule-aio-ovn
+        - atmosphere-molecule-csi-local-path-provisioner
+        - atmosphere-molecule-csi-rbd
+        - atmosphere-molecule-keycloak