diff --git a/.config/molecule/config.yml b/.config/molecule/config.yml index 3ade7fc20..eed745f18 100644 --- a/.config/molecule/config.yml +++ b/.config/molecule/config.yml @@ -26,6 +26,9 @@ platforms: provisioner: name: ansible + inventory: + links: + group_vars: ../../../../group_vars/ config_options: defaults: fact_caching: jsonfile diff --git a/.config/molecule/config_local.yml b/.config/molecule/config_local.yml index c931941ba..d9fb17668 100644 --- a/.config/molecule/config_local.yml +++ b/.config/molecule/config_local.yml @@ -25,6 +25,9 @@ provisioner: # all: # cifmw_discover_latest_image_qcow_prefix: "CentOS-Stream-GenericCloud-9-20240506" + inventory: + links: + group_vars: ../../../../group_vars/ config_options: defaults: fact_caching: jsonfile diff --git a/.config/molecule/config_podman.yml b/.config/molecule/config_podman.yml index 1a542f146..8fa36f559 100644 --- a/.config/molecule/config_podman.yml +++ b/.config/molecule/config_podman.yml @@ -25,6 +25,8 @@ provisioner: hosts: instance: ansible_python_interpreter: /usr/bin/python3 + links: + group_vars: ../../../../group_vars/ name: ansible log: true env: diff --git a/group_vars/molecule/cifmw_snr_nhc_molecule.yml b/group_vars/molecule/cifmw_snr_nhc_molecule.yml new file mode 100644 index 000000000..9657cd318 --- /dev/null +++ b/group_vars/molecule/cifmw_snr_nhc_molecule.yml @@ -0,0 +1,4 @@ +cifmw_snr_nhc_kubeconfig: "/tmp/kubeconfig" +cifmw_snr_nhc_kubeadmin_password_file: "/tmp/kubeadmin-password" +cifmw_snr_nhc_namespace: "test-workload-availability" +ansible_python_interpreter: /usr/bin/python3 diff --git a/group_vars/molecule/devscript_molecule.yml b/group_vars/molecule/devscript_molecule.yml new file mode 100644 index 000000000..953e7a6b9 --- /dev/null +++ b/group_vars/molecule/devscript_molecule.yml @@ -0,0 +1,2 @@ +cifmw_devscripts_config_overrides_patch_01_override_br_management: + external_bootstrap_mac: '52:54:ab:83:31:87' diff --git a/group_vars/molecule/rhol_crc_molecule.yml b/group_vars/molecule/rhol_crc_molecule.yml new file mode 100644 index 000000000..1635ea8fe --- /dev/null +++ b/group_vars/molecule/rhol_crc_molecule.yml @@ -0,0 +1,8 @@ +cifmw_rhol_crc_binary_folder: "/usr/local/bin" +# If you want to run this job on your own node, +# and if you don't have CRC pre-provisioned, you can +# uncomment and tweak the following content +# +# cifmw_manage_secrets_pullsecret_content: | +# your pull-secret +# setup_crc: true diff --git a/roles/ci_multus/molecule/default/host_vars/instance.yml b/roles/ci_multus/molecule/default/host_vars/instance.yml new file mode 100644 index 000000000..fec49b485 --- /dev/null +++ b/roles/ci_multus/molecule/default/host_vars/instance.yml @@ -0,0 +1,33 @@ +_expected_multus_networks: + - default + - patchnetwork + - bridge-to-linux-bridge +cifmw_ci_multus_net_info_patch_1: + patchnetwork: + gw_v4: 192.168.122.1 + network_name: patchnetwork + network_v4: 192.168.122.0/24 + interface_name: eth2 + tools: + multus: + ipv4_ranges: + - start: 192.168.122.30 + end: 192.168.122.70 + multus_type: macvlan +cifmw_ci_multus_net_info_patch_2: + bridge-to-linux-bridge: + gw_v4: 192.168.122.1 + network_name: bridge-to-linux-bridge + network_v4: 192.168.122.0/24 + interface_name: eth1 + tools: + multus: + ipv4_ranges: + - start: 192.168.122.30 + end: 192.168.122.70 + multus_type: bridge + multus_attach: linux-bridge + +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" +testpod_name: "pod-testnad" diff --git a/roles/ci_multus/molecule/default/molecule.yml b/roles/ci_multus/molecule/default/molecule.yml index 6f2dcb39b..1122c16fd 100644 --- a/roles/ci_multus/molecule/default/molecule.yml +++ b/roles/ci_multus/molecule/default/molecule.yml @@ -10,41 +10,8 @@ provisioner: playbooks: side_effect: side_effect.yml inventory: - host_vars: - instance: - _expected_multus_networks: - - default - - patchnetwork - - bridge-to-linux-bridge - cifmw_ci_multus_net_info_patch_1: - patchnetwork: - gw_v4: 192.168.122.1 - network_name: patchnetwork - network_v4: 192.168.122.0/24 - interface_name: eth2 - tools: - multus: - ipv4_ranges: - - start: 192.168.122.30 - end: 192.168.122.70 - multus_type: macvlan - cifmw_ci_multus_net_info_patch_2: - bridge-to-linux-bridge: - gw_v4: 192.168.122.1 - network_name: bridge-to-linux-bridge - network_v4: 192.168.122.0/24 - interface_name: eth1 - tools: - multus: - ipv4_ranges: - - start: 192.168.122.30 - end: 192.168.122.70 - multus_type: bridge - multus_attach: linux-bridge - - 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" - testpod_name: "pod-testnad" + links: + host_vars: ./host_vars/ prerun: false scenario: test_sequence: diff --git a/roles/ci_multus/molecule/local/host_vars/instance.yml b/roles/ci_multus/molecule/local/host_vars/instance.yml new file mode 100644 index 000000000..a75945670 --- /dev/null +++ b/roles/ci_multus/molecule/local/host_vars/instance.yml @@ -0,0 +1,14 @@ +_expected_multus_networks: + - default + - patchnetwork +cifmw_ci_multus_net_info_patch_1: + patchnetwork: + gw_v4: 192.168.122.1 + network_name: patchnetwork + network_v4: 192.168.122.0/24 + interface_name: eth2 + tools: + multus: + ipv4_ranges: + - start: 192.168.122.30 + end: 192.168.122.70 diff --git a/roles/ci_multus/molecule/local/molecule.yml b/roles/ci_multus/molecule/local/molecule.yml index 9ed0aa2a5..43db501d6 100644 --- a/roles/ci_multus/molecule/local/molecule.yml +++ b/roles/ci_multus/molecule/local/molecule.yml @@ -10,22 +10,8 @@ provisioner: playbooks: side_effect: side_effect.yml inventory: - host_vars: - instance: - _expected_multus_networks: - - default - - patchnetwork - cifmw_ci_multus_net_info_patch_1: - patchnetwork: - gw_v4: 192.168.122.1 - network_name: patchnetwork - network_v4: 192.168.122.0/24 - interface_name: eth2 - tools: - multus: - ipv4_ranges: - - start: 192.168.122.30 - end: 192.168.122.70 + links: + host_vars: ./host_vars/ prerun: false scenario: diff --git a/roles/ci_multus/molecule/local_ipv6/host_vars/instance.yml b/roles/ci_multus/molecule/local_ipv6/host_vars/instance.yml new file mode 100644 index 000000000..34484302c --- /dev/null +++ b/roles/ci_multus/molecule/local_ipv6/host_vars/instance.yml @@ -0,0 +1,2 @@ +_expected_multus_networks: + - default diff --git a/roles/ci_multus/molecule/local_ipv6/molecule.yml b/roles/ci_multus/molecule/local_ipv6/molecule.yml index f38939e91..43db501d6 100644 --- a/roles/ci_multus/molecule/local_ipv6/molecule.yml +++ b/roles/ci_multus/molecule/local_ipv6/molecule.yml @@ -10,10 +10,8 @@ provisioner: playbooks: side_effect: side_effect.yml inventory: - host_vars: - instance: - _expected_multus_networks: - - default + links: + host_vars: ./host_vars/ prerun: false scenario: diff --git a/roles/cifmw_snr_nhc/molecule/default/molecule.yml b/roles/cifmw_snr_nhc/molecule/default/molecule.yml index be4602e4b..869049f65 100644 --- a/roles/cifmw_snr_nhc/molecule/default/molecule.yml +++ b/roles/cifmw_snr_nhc/molecule/default/molecule.yml @@ -10,6 +10,9 @@ driver: platforms: - name: instance + groups: + - molecule + - rhol_crc_molecule image: registry.access.redhat.com/ubi9/ubi:latest pre_build_image: true volumes: @@ -24,13 +27,6 @@ platforms: provisioner: name: ansible - inventory: - group_vars: - all: - cifmw_snr_nhc_kubeconfig: "/tmp/kubeconfig" - cifmw_snr_nhc_kubeadmin_password_file: "/tmp/kubeadmin-password" - cifmw_snr_nhc_namespace: "test-workload-availability" - ansible_python_interpreter: /usr/bin/python3 verifier: name: ansible diff --git a/roles/devscripts/molecule/check_cluster_status/molecule.yml b/roles/devscripts/molecule/check_cluster_status/molecule.yml index 98cff6240..7b86095ce 100644 --- a/roles/devscripts/molecule/check_cluster_status/molecule.yml +++ b/roles/devscripts/molecule/check_cluster_status/molecule.yml @@ -6,11 +6,11 @@ log: true +platforms: + - name: instance + groups: + - devscript_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_devscripts_config_overrides_patch_01_override_br_management: - external_bootstrap_mac: '52:54:ab:83:31:87' diff --git a/roles/devscripts/molecule/default/molecule.yml b/roles/devscripts/molecule/default/molecule.yml index 98cff6240..360d8c123 100644 --- a/roles/devscripts/molecule/default/molecule.yml +++ b/roles/devscripts/molecule/default/molecule.yml @@ -6,11 +6,12 @@ log: true +platforms: + - name: instance + groups: + - molecule + - devscript_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_devscripts_config_overrides_patch_01_override_br_management: - external_bootstrap_mac: '52:54:ab:83:31:87' diff --git a/roles/libvirt_manager/molecule/check_dns/host_vars/instance.yml b/roles/libvirt_manager/molecule/check_dns/host_vars/instance.yml new file mode 100644 index 000000000..7d1ed277e --- /dev/null +++ b/roles/libvirt_manager/molecule/check_dns/host_vars/instance.yml @@ -0,0 +1,4 @@ +cifmw_libvirt_manager_configuration_patch_01_more_computes: + vms: + compute: + amount: 2 diff --git a/roles/libvirt_manager/molecule/check_dns/molecule.yml b/roles/libvirt_manager/molecule/check_dns/molecule.yml index ab2823a87..659af155b 100644 --- a/roles/libvirt_manager/molecule/check_dns/molecule.yml +++ b/roles/libvirt_manager/molecule/check_dns/molecule.yml @@ -5,9 +5,5 @@ provisioner: name: ansible log: true inventory: - host_vars: - instance: - cifmw_libvirt_manager_configuration_patch_01_more_computes: - vms: - compute: - amount: 2 + links: + host_vars: ./host_vars/ diff --git a/roles/libvirt_manager/molecule/deploy_layout/host_vars/instance.yml b/roles/libvirt_manager/molecule/deploy_layout/host_vars/instance.yml new file mode 100644 index 000000000..7d1ed277e --- /dev/null +++ b/roles/libvirt_manager/molecule/deploy_layout/host_vars/instance.yml @@ -0,0 +1,4 @@ +cifmw_libvirt_manager_configuration_patch_01_more_computes: + vms: + compute: + amount: 2 diff --git a/roles/libvirt_manager/molecule/deploy_layout/molecule.yml b/roles/libvirt_manager/molecule/deploy_layout/molecule.yml index ab2823a87..659af155b 100644 --- a/roles/libvirt_manager/molecule/deploy_layout/molecule.yml +++ b/roles/libvirt_manager/molecule/deploy_layout/molecule.yml @@ -5,9 +5,5 @@ provisioner: name: ansible log: true inventory: - host_vars: - instance: - cifmw_libvirt_manager_configuration_patch_01_more_computes: - vms: - compute: - amount: 2 + links: + host_vars: ./host_vars/ diff --git a/roles/libvirt_manager/molecule/generate_network_data/host_vars/instance.yml b/roles/libvirt_manager/molecule/generate_network_data/host_vars/instance.yml new file mode 100644 index 000000000..7d1ed277e --- /dev/null +++ b/roles/libvirt_manager/molecule/generate_network_data/host_vars/instance.yml @@ -0,0 +1,4 @@ +cifmw_libvirt_manager_configuration_patch_01_more_computes: + vms: + compute: + amount: 2 diff --git a/roles/libvirt_manager/molecule/generate_network_data/molecule.yml b/roles/libvirt_manager/molecule/generate_network_data/molecule.yml index ab2823a87..659af155b 100644 --- a/roles/libvirt_manager/molecule/generate_network_data/molecule.yml +++ b/roles/libvirt_manager/molecule/generate_network_data/molecule.yml @@ -5,9 +5,5 @@ provisioner: name: ansible log: true inventory: - host_vars: - instance: - cifmw_libvirt_manager_configuration_patch_01_more_computes: - vms: - compute: - amount: 2 + links: + host_vars: ./host_vars/ diff --git a/roles/libvirt_manager/molecule/ocp_layout/host_vars/instance.yml b/roles/libvirt_manager/molecule/ocp_layout/host_vars/instance.yml new file mode 100644 index 000000000..7d1ed277e --- /dev/null +++ b/roles/libvirt_manager/molecule/ocp_layout/host_vars/instance.yml @@ -0,0 +1,4 @@ +cifmw_libvirt_manager_configuration_patch_01_more_computes: + vms: + compute: + amount: 2 diff --git a/roles/libvirt_manager/molecule/ocp_layout/molecule.yml b/roles/libvirt_manager/molecule/ocp_layout/molecule.yml index ab2823a87..659af155b 100644 --- a/roles/libvirt_manager/molecule/ocp_layout/molecule.yml +++ b/roles/libvirt_manager/molecule/ocp_layout/molecule.yml @@ -5,9 +5,5 @@ provisioner: name: ansible log: true inventory: - host_vars: - instance: - cifmw_libvirt_manager_configuration_patch_01_more_computes: - vms: - compute: - amount: 2 + links: + host_vars: ./host_vars/ diff --git a/roles/networking_mapper/molecule/default/host_vars/instance.yml b/roles/networking_mapper/molecule/default/host_vars/instance.yml new file mode 100644 index 000000000..96308f0b3 --- /dev/null +++ b/roles/networking_mapper/molecule/default/host_vars/instance.yml @@ -0,0 +1,4 @@ +cifmw_networking_mapper_definition_patch_01: + networks: + internalapi: + vlan: 100 diff --git a/roles/networking_mapper/molecule/default/molecule.yml b/roles/networking_mapper/molecule/default/molecule.yml index 3b7f18ef6..040b9f6b1 100644 --- a/roles/networking_mapper/molecule/default/molecule.yml +++ b/roles/networking_mapper/molecule/default/molecule.yml @@ -10,9 +10,5 @@ provisioner: env: ANSIBLE_STDOUT_CALLBACK: yaml inventory: - host_vars: - instance: - cifmw_networking_mapper_definition_patch_01: - networks: - internalapi: - vlan: 100 + link: + host_vars: ./host_vars/ diff --git a/roles/rhol_crc/molecule/add_crc_creds/molecule.yml b/roles/rhol_crc/molecule/add_crc_creds/molecule.yml index fd7bbe0ce..577444e6c 100644 --- a/roles/rhol_crc/molecule/add_crc_creds/molecule.yml +++ b/roles/rhol_crc/molecule/add_crc_creds/molecule.yml @@ -1,20 +1,15 @@ --- log: true +platforms: + - name: instance + groups: + - molecule + - rhol_crc_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_rhol_crc_binary_folder: "/usr/local/bin" - # If you want to run this job on your own node, - # and if you don't have CRC pre-provisioned, you can - # uncomment and tweak the following content - # - # cifmw_manage_secrets_pullsecret_content: | - # your pull-secret - # setup_crc: true # Enforce scenario steps to NOT # run "verify" as a standalone play diff --git a/roles/rhol_crc/molecule/binary/molecule.yml b/roles/rhol_crc/molecule/binary/molecule.yml index 1fbfd9087..577444e6c 100644 --- a/roles/rhol_crc/molecule/binary/molecule.yml +++ b/roles/rhol_crc/molecule/binary/molecule.yml @@ -1,13 +1,15 @@ --- log: true +platforms: + - name: instance + groups: + - molecule + - rhol_crc_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_rhol_crc_binary_folder: "/usr/local/bin" # Enforce scenario steps to NOT # run "verify" as a standalone play diff --git a/roles/rhol_crc/molecule/default/molecule.yml b/roles/rhol_crc/molecule/default/molecule.yml index 1fbfd9087..577444e6c 100644 --- a/roles/rhol_crc/molecule/default/molecule.yml +++ b/roles/rhol_crc/molecule/default/molecule.yml @@ -1,13 +1,15 @@ --- log: true +platforms: + - name: instance + groups: + - molecule + - rhol_crc_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_rhol_crc_binary_folder: "/usr/local/bin" # Enforce scenario steps to NOT # run "verify" as a standalone play diff --git a/roles/rhol_crc/molecule/find_crc/molecule.yml b/roles/rhol_crc/molecule/find_crc/molecule.yml index 1fbfd9087..577444e6c 100644 --- a/roles/rhol_crc/molecule/find_crc/molecule.yml +++ b/roles/rhol_crc/molecule/find_crc/molecule.yml @@ -1,13 +1,15 @@ --- log: true +platforms: + - name: instance + groups: + - molecule + - rhol_crc_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_rhol_crc_binary_folder: "/usr/local/bin" # Enforce scenario steps to NOT # run "verify" as a standalone play diff --git a/roles/rhol_crc/molecule/get_versions/molecule.yml b/roles/rhol_crc/molecule/get_versions/molecule.yml index 1fbfd9087..577444e6c 100644 --- a/roles/rhol_crc/molecule/get_versions/molecule.yml +++ b/roles/rhol_crc/molecule/get_versions/molecule.yml @@ -1,13 +1,15 @@ --- log: true +platforms: + - name: instance + groups: + - molecule + - rhol_crc_molecule + provisioner: name: ansible log: true - inventory: - group_vars: - all: - cifmw_rhol_crc_binary_folder: "/usr/local/bin" # Enforce scenario steps to NOT # run "verify" as a standalone play diff --git a/roles/run_hook/molecule/default/host_vars/instance.yml b/roles/run_hook/molecule/default/host_vars/instance.yml new file mode 100644 index 000000000..ec2b240e7 --- /dev/null +++ b/roles/run_hook/molecule/default/host_vars/instance.yml @@ -0,0 +1,44 @@ +_tmp: "/tmp" +# Fill only _list_hooks +list_hooks: + - name: Run dummy-2 + source: "{{ _tmp }}/dummy-2.yml" + type: playbook + extra_vars: + foo: bar + file: "/tmp/dummy-env.yml" + - name: Run dummy-3 + source: /tmp/dummy-3.yml + type: playbook + extra_vars: + foo: bar + file: "/tmp/dummy-env.yml" +# fill up _list_hooks and _filtered_hooks +# Also ensure ordering is properly taken +run_molecule: + - name: 01 Default noop hook + source: noop.yml + type: playbook + - name: 02 Re-run noop + source: noop.yml + type: playbook +run_molecule_03_single_hook: + source: "{{ _tmp }}/dummy-1.yml" + type: playbook + extra_vars: + foo: bar + file: "/tmp/dummy-env.yml" + +# Fill only _filtered_hooks +filtered_hooks_01_my_hook: + source: "{{ _tmp }}/dummy-4.yml" + type: playbook + extra_vars: + foo: bar + file: "/tmp/dummy-env.yml" + +retry_hook: + - name: Run hook with retry + source: "/tmp/dummy-retry.yml" + type: playbook + retry_hook: true diff --git a/roles/run_hook/molecule/default/molecule.yml b/roles/run_hook/molecule/default/molecule.yml index 186751b6a..45f62a5ee 100644 --- a/roles/run_hook/molecule/default/molecule.yml +++ b/roles/run_hook/molecule/default/molecule.yml @@ -9,50 +9,5 @@ provisioner: name: ansible log: true inventory: - host_vars: - instance: - # Ensure vars are properly interpreted - _tmp: "/tmp" - # Fill only _list_hooks - list_hooks: - - name: Run dummy-2 - source: "{{ _tmp }}/dummy-2.yml" - type: playbook - extra_vars: - foo: bar - file: "/tmp/dummy-env.yml" - - name: Run dummy-3 - source: /tmp/dummy-3.yml - type: playbook - extra_vars: - foo: bar - file: "/tmp/dummy-env.yml" - # fill up _list_hooks and _filtered_hooks - # Also ensure ordering is properly taken - run_molecule: - - name: 01 Default noop hook - source: noop.yml - type: playbook - - name: 02 Re-run noop - source: noop.yml - type: playbook - run_molecule_03_single_hook: - source: "{{ _tmp }}/dummy-1.yml" - type: playbook - extra_vars: - foo: bar - file: "/tmp/dummy-env.yml" - - # Fill only _filtered_hooks - filtered_hooks_01_my_hook: - source: "{{ _tmp }}/dummy-4.yml" - type: playbook - extra_vars: - foo: bar - file: "/tmp/dummy-env.yml" - - retry_hook: - - name: Run hook with retry - source: "/tmp/dummy-retry.yml" - type: playbook - retry_hook: true + links: + host_vars: ./host_vars/