From 58bf3c67a49d6a54628ec3aeaf656ab230b8a0e1 Mon Sep 17 00:00:00 2001 From: Nils Koenig Date: Fri, 26 Jan 2024 15:45:38 +0100 Subject: [PATCH 1/2] sap_hypervisor_node_preconfigure: fix role name in example playbook to support community collection --- .../sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml b/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml index 285e60488..957fe03b5 100644 --- a/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml +++ b/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml @@ -4,8 +4,5 @@ serial: 1 vars: sap_hypervisor_node_platform: redhat_ocp_virt - - tasks: - - name: Include Role - ansible.builtin.include_role: - name: sap_hypervisor_node_preconfigure + roles: + - { role: community.sap_install.sap_hypervisor_node_preconfigure } From 4da5a296397eb352cd6dae6f4d2f54a08362536a Mon Sep 17 00:00:00 2001 From: Nils Koenig Date: Fri, 26 Jan 2024 20:02:22 +0100 Subject: [PATCH 2/2] adjusted variable path to cope with calling as collection role --- .../tasks/platform/redhat_ocp_virt/main.yml | 18 +++++++++--------- .../redhat_ocp_virt/setup-worker-nodes.yml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml index 5e4cedd53..af76697cf 100644 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml +++ b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml @@ -61,22 +61,22 @@ when: __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int >= 512 - name: Include prepare - ansible.builtin.include_tasks: prepare.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/prepare.yml" - name: Include tuned virtual host - ansible.builtin.include_tasks: tuned-virtual-host.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/tuned-virtual-host.yml" - name: Include install CNV operator - ansible.builtin.include_tasks: install-cnv-operator.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-cnv-operator.yml" when: sap_hypervisor_node_preconfigure_install_operators - name: Include install sriov operator - ansible.builtin.include_tasks: install-sriov-operator.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-sriov-operator.yml" when: sap_hypervisor_node_preconfigure_install_operators - name: Include install nmstate operator - ansible.builtin.include_tasks: install-nmstate-operator.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-nmstate-operator.yml" when: sap_hypervisor_node_preconfigure_install_operators - name: Include install virtctl - ansible.builtin.include_tasks: install-virtctl.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-virtctl.yml" - name: Include setup worker nodes - ansible.builtin.include_tasks: setup-worker-nodes.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/setup-worker-nodes.yml" when: sap_hypervisor_node_preconfigure_setup_workers # How to wait for node to be scheduleable? (NodeSchedulable) @@ -90,9 +90,9 @@ var: __sap_hypervisor_node_preconfigure_register_nodes_ready.stdout_lines - name: Include Trident installation - ansible.builtin.include_tasks: install-trident.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-trident.yml" when: sap_hypervisor_node_preconfigure_install_trident - name: Include local storage creation (HPP) - ansible.builtin.include_tasks: install-hpp.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/install-hpp.yml" when: sap_hypervisor_node_preconfigure_install_hpp diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml index 5290093d4..173d5bdba 100644 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml +++ b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml @@ -1,6 +1,6 @@ --- - name: Include configure worker - ansible.builtin.include_tasks: configure-worker-node.yml + ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_hypervisor_node_platform }}/configure-worker-node.yml" with_items: "{{ sap_hypervisor_node_preconfigure_cluster_config.workers }}" loop_control: loop_var: __sap_hypervisor_node_preconfigure_register_worker