diff --git a/ci/config/molecule.yaml b/ci/config/molecule.yaml index c19acf33f1..8555b7e6b4 100644 --- a/ci/config/molecule.yaml +++ b/ci/config/molecule.yaml @@ -42,9 +42,6 @@ - job: name: cifmw-molecule-ci_nmstate parent: cifmw-molecule-base-crc -- job: - name: cifmw-molecule-ci_metallb - parent: cifmw-molecule-base-crc - job: name: cifmw-molecule-install_openstack_ca parent: cifmw-molecule-base-crc diff --git a/roles/ci_metallb/README.md b/roles/ci_metallb/README.md deleted file mode 100644 index e1dcd524bc..0000000000 --- a/roles/ci_metallb/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# ci_metallb - -Installs metallb operator and deploys metallb with the configuration generated -from the content of the CI network definitions like `cifmw_network_layout` or -`crc_ci_bootstrap_networks_out`. - -## Parameters -* `cifmw_ci_metallb_basedir`: (String) Base directory. Defaults to -`cifmw_basedir` which defaults to `~/ci-framework-data`. -* `cifmw_ci_metallb_manifests_dir`: (String) Directory in where OCP manifests -will be placed. Defaults to `"{{ cifmw_manifests -| default(cifmw_ci_metallb_basedir ~ '/artifacts/manifests') }}"`. -* `cifmw_ci_metallb_namespace`: (String) The namespace where OCP resources will -be installed. Defaults to `metallb-system`. -* `cifmw_ci_metallb_crc_hostname`: (String) The CRC inventory hostname. -Used to gather network information specific to those nodes, mostly the -interfaces. Defaults to `crc`. -* `cifmw_ci_metallb_olm_operator_group`: (Dict) The `OperatorGroup` resource to -be used to install the metallb operator. -* `cifmw_ci_metallb_olm_subscription`: (Dict) The `Subscription` resource to be -used to install the metallb operator. -* `cifmw_ci_metallb_subscription_source`: (String) The Source of -`Subscription` resource to pull metallb operator content. -* `cifmw_ci_metallb_subscription_sourcenamespace`: (String) The Source -namespace of `Subscription` resource to pull metallb operator content. -* `cifmw_ci_metallb_operator_config`: (Dict) The `MetalLB` resource to be used -to configure the installed metallb operator. - -## Examples -```YAML - - name: Configure the load balancer for two networks using ci_metallb - vars: - cifmw_network_layout: - networks: - osp_trunk: - metallb: - ranges: - - 192.168.122.80-192.168.122.90 - test-vlan-connection: - metallb: - ranges: - - 172.18.0.80-172.18.0.90 - controller: - osp_trunk: - connection: ci-private-network - gw: 192.168.122.1 - iface: eth1 - ip: 192.168.122.11/24 - mac: fa:16:3e:45:c1:b1 - mtu: 1500 - internal-api: - connection: ci-private-network-20 - iface: eth1.20 - ip: 172.17.0.4/24 - mac: 52:54:00:30:d2:36 - mtu: 1496 - parent_iface: eth1 - vlan: 20 - crc: - osp_trunk: - connection: ci-private-network - gw: 192.168.122.1 - iface: eth2 - ip4: 192.168.122.22/24 - mtu: 1500 - test-vlan-connection: - connection: test-network-20 - iface: "eth2.20" - ip4: 172.17.0.5/24 - mtu: 1496 - parent_iface: "eth2" - vlan: 20 - - ansible.builtin.include_role: - name: "ci_metallb" -``` diff --git a/roles/ci_metallb/defaults/main.yml b/roles/ci_metallb/defaults/main.yml deleted file mode 100644 index 0d3099ba36..0000000000 --- a/roles/ci_metallb/defaults/main.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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. - - -# All variables intended for modification should be placed in this file. -# All variables within this role should have a prefix of "cifmw_ci_metallb" -cifmw_ci_metallb_basedir: "{{ cifmw_basedir | default(ansible_user_dir ~ '/ci-framework-data') }}" -cifmw_ci_metallb_manifests_dir: "{{ cifmw_manifests | default(cifmw_ci_metallb_basedir ~ '/artifacts/manifests') }}/metallb" -cifmw_ci_metallb_namespace: metallb-system -cifmw_ci_metallb_crc_hostname: "{{ cifmw_crc_hostname | default('crc') }}" - -cifmw_ci_metallb_olm_operator_group: - apiVersion: operators.coreos.com/v1 - kind: OperatorGroup - metadata: - name: metallb-operator - namespace: "{{ cifmw_ci_metallb_namespace }}" - -cifmw_ci_metallb_subscription_source: redhat-operators -cifmw_ci_metallb_subscription_sourcenamespace: openshift-marketplace - -cifmw_ci_metallb_olm_subscription: - apiVersion: operators.coreos.com/v1alpha1 - kind: Subscription - metadata: - name: metallb-operator-sub - namespace: "{{ cifmw_ci_metallb_namespace }}" - spec: - channel: stable - name: metallb-operator - source: "{{ cifmw_ci_metallb_subscription_source }}" - sourceNamespace: "{{ cifmw_ci_metallb_subscription_sourcenamespace }}" - -cifmw_ci_metallb_operator_config: - apiVersion: metallb.io/v1beta1 - kind: MetalLB - metadata: - name: metallb - namespace: "{{ cifmw_ci_metallb_namespace }}" - spec: - logLevel: debug - nodeSelector: - node-role.kubernetes.io/worker: "" diff --git a/roles/ci_metallb/meta/main.yml b/roles/ci_metallb/meta/main.yml deleted file mode 100644 index e7d29f3407..0000000000 --- a/roles/ci_metallb/meta/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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. - - -galaxy_info: - author: CI Framework - description: CI Framework Role -- ci_metallb - company: Red Hat - license: Apache-2.0 - min_ansible_version: "2.14" - namespace: cifmw - galaxy_tags: - - cifmw - -# List your role dependencies here, one per line. Be sure to remove the '[]' above, -# if you add dependencies to this list. -dependencies: [] diff --git a/roles/ci_metallb/molecule/default/converge.yml b/roles/ci_metallb/molecule/default/converge.yml deleted file mode 100644 index ea1e6a189a..0000000000 --- a/roles/ci_metallb/molecule/default/converge.yml +++ /dev/null @@ -1,198 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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: Converge - hosts: all - gather_facts: true - vars: - cifmw_path: "{{ ansible_user_dir }}/.crc/bin:{{ ansible_user_dir }}/.crc/bin/oc:{{ ansible_user_dir }}/bin:{{ ansible_env.PATH }}" - cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig" - cifmw_ci_metallb_namespace: "metallb-system" - tasks: - - name: Add crc hostname with it's IP to /etc/hosts - become: true - ansible.builtin.lineinfile: - path: /etc/hosts - line: "192.168.130.11 crc" - - - name: Add the crc host dynamically - ansible.builtin.add_host: - name: crc - ansible_ssh_private_key_file: "{{ ansible_user_dir }}/.crc/machines/crc/id_ecdsa" - ansible_ssh_user: core - - - name: Fetch crc network facts - ansible.builtin.setup: - gather_subset: network - delegate_to: crc - delegate_facts: true - - - name: Prepare the networking var for the ci_nmstate role - ansible.builtin.set_fact: - cifmw_network_layout: - networks: - osp-trunk: - metallb: - ranges: - - 192.168.122.80-192.168.122.90 - test-vlan-connection: - metallb: - ranges: - - 172.18.0.80-172.18.0.90 - controller: - osp-trunk: - connection: ci-private-network - gw: 192.168.122.1 - iface: eth1 - ip: 192.168.122.11/24 - mac: fa:16:3e:45:c1:b1 - mtu: 1500 - internal-api: - connection: ci-private-network-20 - iface: eth1.20 - ip: 172.17.0.4/24 - mac: 52:54:00:30:d2:36 - mtu: '1496' - parent_iface: eth1 - vlan: 20 - crc: - osp-trunk: - connection: ci-private-network - gw: "{{ hostvars.crc.ansible_default_ipv4.gateway }}" - iface: "{{ hostvars.crc.ansible_default_ipv4.interface }}" - ip4: >- - {{ - hostvars.crc.ansible_default_ipv4.address + - '/' + hostvars.crc.ansible_default_ipv4.prefix - }} - mtu: "{{ hostvars.crc.ansible_default_ipv4.mtu }}" - test-vlan-connection: - connection: test-network-20 - iface: "{{ hostvars.crc.ansible_default_ipv4.interface }}.20" - ip4: 172.17.0.5/24 - mtu: "{{ hostvars.crc.ansible_default_ipv4.mtu | string }}" - parent_iface: "{{ hostvars.crc.ansible_default_ipv4.interface }}" - vlan: 20 - - - name: Call the role under test - ansible.builtin.include_role: - name: "ci_metallb" - - # Verify the run - - name: Fetch files stat results - ansible.builtin.stat: - path: >- - {{ - [ - ansible_user_dir, - 'ci-framework-data', - 'artifacts', - 'manifests', - 'metallb', - item - ] | ansible.builtin.path_join - }} - register: _ci_metallb_molecule_stat_out - loop: - - metallb-operatorgroup-olm.yaml - - metallb-subscription-olm.yaml - - ipaddresspools.yaml - - l2advertisements.yaml - - - name: Assert that all expected files exist - ansible.builtin.assert: - that: >- - _ci_metallb_molecule_stat_out.results | - map(attribute="stat.exists") | - select("equalto", true) | - length == (_ci_metallb_molecule_stat_out.results | length) - - name: Fetch all files content - ansible.builtin.slurp: - path: "{{ item }}" - register: _ci_metallb_molecule_slurp_out - loop: >- - {{ - _ci_metallb_molecule_stat_out.results | - map(attribute="stat.path") - }} - - name: Assert that all files contains proper YAML data - ansible.builtin.assert: - that: "item.content | b64decode | from_yaml_all | length > 0" - loop: "{{ _ci_metallb_molecule_slurp_out.results }}" - loop_control: - label: "{{ item.source }}" - - - name: Ensure that IPAddressPools are created with the right parameters - kubernetes.core.k8s_info: - api_version: metallb.io/v1beta1 - kind: IPAddressPool - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - name: "{{ item.name }}" - namespace: "{{ cifmw_ci_metallb_namespace }}" - register: _ci_metallb_default_ipaddresspool_out - failed_when: >- - (_ci_metallb_default_ipaddresspool_out is not defined) or - (_ci_metallb_default_ipaddresspool_out is failed) or - (_ci_metallb_default_ipaddresspool_out.resources | length == 0) or - not (_ci_metallb_default_ipaddresspool_out.resources[0].spec.addresses == item.ranges) - loop: - - name: "osp-trunk" - ranges: ["192.168.122.80-192.168.122.90"] - - name: "test-vlan-connection" - ranges: ["172.18.0.80-172.18.0.90"] - - - name: Ensure that L2Advertisements are created with the right parameters - kubernetes.core.k8s_info: - api_version: metallb.io/v1beta1 - kind: L2Advertisement - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - name: "{{ item.name }}" - namespace: "{{ cifmw_ci_metallb_namespace }}" - register: _ci_metallb_test_vlan_l2advertisement_out - failed_when: >- - (_ci_metallb_test_vlan_l2advertisement_out is not defined) or - (_ci_metallb_test_vlan_l2advertisement_out is failed) or - (_ci_metallb_test_vlan_l2advertisement_out.resources | length == 0) or - not (_ci_metallb_test_vlan_l2advertisement_out.resources[0].spec.ipAddressPools == [item.name]) or - not (_ci_metallb_test_vlan_l2advertisement_out.resources[0].spec.interfaces == [item.interface]) - loop: - - name: "osp-trunk" - interface: "{{ hostvars.crc.ansible_default_ipv4.interface }}" - - name: "test-vlan-connection" - interface: "{{ hostvars.crc.ansible_default_ipv4.interface }}.20" - - - name: Call ci_metallb cleanup - ansible.builtin.import_role: - name: ci_metallb - tasks_from: cleanup.yml - - - name: Fetch namespaces - kubernetes.core.k8s_info: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - kind: "namespaces" - register: _ci_metallb_molecule_ns_out - - - name: Assert that the metallb ns is gone - vars: - ns_names: >- - {{ - _ci_metallb_molecule_ns_out.resources | - default([]) | - map(attribute='metadata.name') - }} - ansible.builtin.assert: - that: "cifmw_ci_metallb_namespace not in ns_names" diff --git a/roles/ci_metallb/molecule/default/molecule.yml b/roles/ci_metallb/molecule/default/molecule.yml deleted file mode 100644 index fda947cafe..0000000000 --- a/roles/ci_metallb/molecule/default/molecule.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# Mainly used to override the defaults set in .config/molecule/ -# By default, it uses the "config_podman.yml" - in CI, it will use -# "config_local.yml". -log: true - -provisioner: - name: ansible - log: true - env: - ANSIBLE_STDOUT_CALLBACK: yaml diff --git a/roles/ci_metallb/molecule/default/prepare.yml b/roles/ci_metallb/molecule/default/prepare.yml deleted file mode 100644 index d3594acc41..0000000000 --- a/roles/ci_metallb/molecule/default/prepare.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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 - hosts: all - roles: - - role: test_deps diff --git a/roles/ci_metallb/tasks/cleanup.yml b/roles/ci_metallb/tasks/cleanup.yml deleted file mode 100644 index d0ed689085..0000000000 --- a/roles/ci_metallb/tasks/cleanup.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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: Remove the metallb namespace, which contains all metallb resources - when: cifmw_openshift_kubeconfig is defined - kubernetes.core.k8s: - state: absent - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit) }}" - context: "{{ cifmw_openshift_context | default(omit) }}" - kind: Namespace - name: "{{ cifmw_ci_metallb_namespace }}" - wait: true diff --git a/roles/ci_metallb/tasks/main.yml b/roles/ci_metallb/tasks/main.yml deleted file mode 100644 index f9545d2b06..0000000000 --- a/roles/ci_metallb/tasks/main.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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: Create role needed directories - ansible.builtin.file: - path: "{{ cifmw_ci_metallb_manifests_dir }}" - state: directory - -- name: Extract data from network env file if available - when: - - cifmw_network_layout is not defined - - crc_ci_bootstrap_networks_out is not defined - block: - - name: Check for CI env directory - when: crc_ci_bootstrap_networks_out is not defined - register: _cifmw_ci_metallb_ci_env_stat - ansible.builtin.stat: - path: /etc/ci/env - - - name: Load network env file - when: _cifmw_ci_metallb_ci_env_stat.stat.exists - ansible.builtin.include_vars: - dir: /etc/ci/env/ - -- name: Gather crc network layout to build metallb configuration - ansible.builtin.set_fact: - cifmw_ci_metallb_network_layout: >- - {{ - cifmw_network_layout[cifmw_ci_metallb_crc_hostname] | default({}) | - combine( cifmw_network_layout['networks'], recursive=true) - if cifmw_network_layout is defined else - (crc_ci_bootstrap_networks_out[cifmw_ci_metallb_crc_hostname] | default({})| - combine( crc_ci_bootstrap_networks_out['networks'], recursive=true) - ) - }} - cacheable: true - -- name: Prepare and install MetalLB - ansible.builtin.include_tasks: metallb_k8s_install.yml - -- name: Collect config to build IPAddressPool CR - vars: - _cifmw_ci_metallb_ipaddresspools: [] - ansible.builtin.set_fact: - _cifmw_ci_metallb_ipaddresspools: >- - {{ - _cifmw_ci_metallb_ipaddresspools + - [{ - 'name': item.key, - 'addresses': item.value.metallb.ranges - }] - }} - loop: "{{ cifmw_ci_metallb_network_layout | dict2items }}" - -- name: Create IPAddressPool CR and save it in the manifests dir - ansible.builtin.template: - src: "ipaddresspools.yaml.j2" - dest: "{{ cifmw_ci_metallb_manifests_dir }}/ipaddresspools.yaml" - -- name: Apply IPAddressPool CR - kubernetes.core.k8s: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit) }}" - context: "{{ cifmw_openshift_context | default(omit) }}" - state: present - definition: "{{ lookup('file', cifmw_ci_metallb_manifests_dir+'/ipaddresspools.yaml') | from_yaml_all }}" - -- name: Collect config to build L2Advertisement CR - vars: - _cifmw_ci_metallb_l2advertisements: [] - ansible.builtin.set_fact: - _cifmw_ci_metallb_l2advertisements: >- - {{ - _cifmw_ci_metallb_l2advertisements + - [{ - 'name': item.key, - 'interface': item.value.iface - }] - }} - loop: "{{ cifmw_ci_metallb_network_layout | dict2items }}" - -- name: Create L2Advertisement CR and save it in the manifests dir - ansible.builtin.template: - src: "l2advertisements.yaml.j2" - dest: "{{ cifmw_ci_metallb_manifests_dir }}/l2advertisements.yaml" - -- name: Apply L2Advertisement CR - kubernetes.core.k8s: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit) }}" - context: "{{ cifmw_openshift_context | default(omit) }}" - state: present - definition: "{{ lookup('file', cifmw_ci_metallb_manifests_dir+'/l2advertisements.yaml') | from_yaml_all }}" diff --git a/roles/ci_metallb/tasks/metallb_k8s_install.yml b/roles/ci_metallb/tasks/metallb_k8s_install.yml deleted file mode 100644 index f841c9f98c..0000000000 --- a/roles/ci_metallb/tasks/metallb_k8s_install.yml +++ /dev/null @@ -1,114 +0,0 @@ ---- -# Copyright Red Hat, Inc. -# All Rights Reserved. -# -# 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: Create the metallb namespace - kubernetes.core.k8s: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit)}}" - context: "{{ cifmw_openshift_context | default(omit) }}" - name: "{{ cifmw_ci_metallb_namespace }}" - kind: Namespace - state: present - -- name: Save k8s metallb OLM manifests as artifacts - ansible.builtin.copy: - mode: "0644" - dest: "{{ cifmw_ci_metallb_manifests_dir }}/metallb-{{ item.kind | lower }}-olm.yaml" - content: "{{ item | to_nice_yaml }}" - loop: - - "{{ cifmw_ci_metallb_olm_operator_group }}" - - "{{ cifmw_ci_metallb_olm_subscription }}" - loop_control: - label: "{{ item.metadata.name }}" - -- name: Create the OLM subscription resources - kubernetes.core.k8s: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit)}}" - context: "{{ cifmw_openshift_context | default(omit) }}" - definition: "{{ item }}" - state: present - loop: - - "{{ cifmw_ci_metallb_olm_operator_group }}" - - "{{ cifmw_ci_metallb_olm_subscription }}" - loop_control: - label: "{{ item.metadata.name }}" - -- name: Wait for metallb operator to be intalled - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path }}" - ansible.builtin.command: - cmd: >- - oc get ClusterServiceVersion - -n "{{ cifmw_ci_metallb_namespace }}" - -o jsonpath='{.items[*].status.phase}' - changed_when: false - register: _metallb_csv_out - retries: 12 - delay: 10 - until: - - _metallb_csv_out is defined - - _metallb_csv_out.failed is false - - _metallb_csv_out.stdout_lines | length > 0 - - "(_metallb_csv_out.stdout_lines[0] | lower) == 'succeeded'" - - -- name: Trigger metallb operator to install metallb - kubernetes.core.k8s: - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit)}}" - context: "{{ cifmw_openshift_context | default(omit) }}" - definition: "{{ cifmw_ci_metallb_operator_config }}" - state: present - -- name: Wait for nsmtate Deployments to be ready - kubernetes.core.k8s_info: - kind: Deployment - label_selectors: - - "app=metallb" - namespace: "{{ cifmw_ci_metallb_namespace }}" - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit)}}" - context: "{{ cifmw_openshift_context | default(omit)}}" - wait: true - wait_sleep: 10 - wait_timeout: 600 - wait_condition: - type: Available - status: "True" - -- name: Wait for metallb DaemonSet to be ready - kubernetes.core.k8s_info: - kind: DaemonSet - label_selectors: - - "app=metallb" - namespace: "{{ cifmw_ci_metallb_namespace }}" - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" - api_key: "{{ cifmw_openshift_token | default(omit)}}" - context: "{{ cifmw_openshift_context | default(omit)}}" - register: _metallb_daemonset_out - retries: 12 - delay: 10 - until: - - _metallb_daemonset_out is defined - - _metallb_daemonset_out is not failed - - _metallb_daemonset_out.resources | length > 0 - - _metallb_daemonset_out.resources[0].status.numberAvailable is defined - - _metallb_daemonset_out.resources[0].status.desiredNumberScheduled is defined - - >- - _metallb_daemonset_out.resources[0].status.numberAvailable == - _metallb_daemonset_out.resources[0].status.desiredNumberScheduled diff --git a/roles/ci_metallb/templates/ipaddresspools.yaml.j2 b/roles/ci_metallb/templates/ipaddresspools.yaml.j2 deleted file mode 100644 index 9f17c9fb0c..0000000000 --- a/roles/ci_metallb/templates/ipaddresspools.yaml.j2 +++ /dev/null @@ -1,12 +0,0 @@ -{% for ipaddresspool in _cifmw_ci_metallb_ipaddresspools %} ---- -apiVersion: metallb.io/v1beta1 -kind: IPAddressPool -metadata: - namespace: {{ cifmw_ci_metallb_namespace }} - name: {{ ipaddresspool.name }} -spec: - addresses: -{{ ipaddresspool.addresses | to_nice_yaml(width=1337) - | trim | indent(width=2,first=True) }} -{% endfor %} diff --git a/roles/ci_metallb/templates/l2advertisements.yaml.j2 b/roles/ci_metallb/templates/l2advertisements.yaml.j2 deleted file mode 100644 index 3e9320f716..0000000000 --- a/roles/ci_metallb/templates/l2advertisements.yaml.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{% for l2advertisement in _cifmw_ci_metallb_l2advertisements %} ---- -apiVersion: metallb.io/v1beta1 -kind: L2Advertisement -metadata: - name: {{ l2advertisement.name }} - namespace: {{ cifmw_ci_metallb_namespace }} -spec: - ipAddressPools: - - {{ l2advertisement.name }} - interfaces: - - {{ l2advertisement.interface }} -{% endfor %} diff --git a/zuul.d/molecule.yaml b/zuul.d/molecule.yaml index 1af4750b8d..dfc27ba9f4 100644 --- a/zuul.d/molecule.yaml +++ b/zuul.d/molecule.yaml @@ -81,17 +81,6 @@ parent: cifmw-molecule-base vars: TEST_RUN: ci_local_storage -- job: - files: - - ^common-requirements.txt - - ^test-requirements.txt - - ^roles/ci_metallb/(defaults|files|handlers|library|lookup_plugins|module_utils|molecule|tasks|templates|vars).* - - ^ci/playbooks/molecule.* - - ^.config/molecule/.* - name: cifmw-molecule-ci_metallb - parent: cifmw-molecule-base-crc - vars: - TEST_RUN: ci_metallb - job: files: - ^common-requirements.txt diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 768bb33482..f0e441bce3 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -23,7 +23,6 @@ - cifmw-molecule-ci_gen_kustomize_values - cifmw-molecule-ci_local_storage - cifmw-molecule-ci_lvms_storage - - cifmw-molecule-ci_metallb - cifmw-molecule-ci_multus - cifmw-molecule-ci_network - cifmw-molecule-ci_nmstate