diff --git a/playbooks/ceph.yml b/playbooks/ceph.yml index 09ed924786..d2c1f19962 100644 --- a/playbooks/ceph.yml +++ b/playbooks/ceph.yml @@ -338,27 +338,43 @@ # public network always exist because is provided by the ceph_spec role - name: Get Storage network range ansible.builtin.set_fact: - cifmw_cephadm_rgw_network: "{{ lookup('ansible.builtin.ini', 'public_network section=global file=' ~ cifmw_cephadm_bootstrap_conf) }}" + cifmw_cephadm_storage_network: "{{ lookup('ansible.builtin.ini', 'public_network section=global file=' ~ cifmw_cephadm_bootstrap_conf) }}" + + - name: Set RGW network range to storage network only if it was not provided + ansible.builtin.set_fact: + cifmw_cephadm_rgw_network: "{{ cifmw_cephadm_storage_network }}" + when: + - cifmw_cephadm_rgw_network is not defined or + cifmw_cephadm_rgw_network | length == 0 - name: Set IP address of first monitor ansible.builtin.set_fact: - cifmw_cephadm_first_mon_ip: "{{ hostvars[this_host][all_addresses] | ansible.utils.ipaddr(cifmw_cephadm_rgw_network) | first }}" + cifmw_cephadm_first_mon_ip: "{{ hostvars[this_host][all_addresses] | ansible.utils.ipaddr(cifmw_cephadm_storage_network) | first }}" vars: this_host: "{{ _target_hosts | first }}" - name: Assert if any EDPM nodes n/w interface is missing in storage network + ansible.builtin.assert: + that: + - hostvars[item][all_addresses] | ansible.utils.ipaddr(cifmw_cephadm_storage_network) | length > 0 + fail_msg: "node {{ item }} doesn't have any interface connected to network {{ cifmw_cephadm_storage_network }}" + loop: "{{ _target_hosts }}" + + - name: Assert if any EDPM nodes n/w interface is missing in RGW network ansible.builtin.assert: that: - hostvars[item][all_addresses] | ansible.utils.ipaddr(cifmw_cephadm_rgw_network) | length > 0 fail_msg: "node {{ item }} doesn't have any interface connected to network {{ cifmw_cephadm_rgw_network }}" loop: "{{ _target_hosts }}" + when: + - cifmw_cephadm_rgw_network != cifmw_cephadm_storage_network - - name: Get already assigned IP addresses + - name: Get already assigned RGW IP addresses ansible.builtin.set_fact: ips: "{{ ips | default([]) + [ hostvars[item][all_addresses] | ansible.utils.ipaddr(cifmw_cephadm_rgw_network) | first ] }}" loop: "{{ _target_hosts }}" - # cifmw_cephadm_vip is the VIP reserved in the Storage network + # cifmw_cephadm_vip is the VIP reserved in the RGW network - name: Set VIP var as empty string ansible.builtin.set_fact: cifmw_cephadm_vip: "" diff --git a/roles/cifmw_cephadm/tasks/check_vip.yml b/roles/cifmw_cephadm/tasks/check_vip.yml index 0714510e7a..d92bcc0765 100644 --- a/roles/cifmw_cephadm/tasks/check_vip.yml +++ b/roles/cifmw_cephadm/tasks/check_vip.yml @@ -22,7 +22,7 @@ ansible.builtin.set_fact: count: "{{ 2 if count is undefined else count | int + 2 }}" - - name: Get an IP address from the Storage network + - name: Get an IP address from the RGW network ansible.builtin.set_fact: cur_ip: "{{ cifmw_cephadm_rgw_network | ansible.utils.next_nth_usable(count) }}" diff --git a/roles/kustomize_deploy/tasks/execute_step.yml b/roles/kustomize_deploy/tasks/execute_step.yml index 28f81b95c3..1c29869968 100644 --- a/roles/kustomize_deploy/tasks/execute_step.yml +++ b/roles/kustomize_deploy/tasks/execute_step.yml @@ -204,6 +204,18 @@ path_join | realpath }} block: + - name: "get oc version" + register: _oc_version + environment: + PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" + ansible.builtin.command: + chdir: "{{ _chdir }}" + cmd: "oc version" + + - name: "show oc version" + ansible.builtin.debug: + var: _oc_version + # We have to use plain `oc kustomize`: lookup would # be executed locally, on the ansible-controller. In CI, # that would be the zuul-executor, and we don't manage them, diff --git a/scenarios/reproducers/networking-definition.yml b/scenarios/reproducers/networking-definition.yml index 4f0ba0ed26..671f83263f 100644 --- a/scenarios/reproducers/networking-definition.yml +++ b/scenarios/reproducers/networking-definition.yml @@ -91,6 +91,19 @@ cifmw_networking_definition: end: 250 vlan: 23 mtu: 1500 + swift: + network: "172.22.0.0/24" + tools: + netconfig: + ranges: + - start: 100 + end: 250 + multus: + ranges: + - start: 30 + end: 70 + vlan: 25 + mtu: 1500 group-templates: ocps: @@ -106,6 +119,8 @@ cifmw_networking_definition: trunk-parent: ctlplane storage: trunk-parent: ctlplane + swift: + trunk-parent: ctlplane ocp_workers: network-template: range: @@ -127,6 +142,8 @@ cifmw_networking_definition: trunk-parent: ctlplane storagemgmt: trunk-parent: ctlplane + swift: + trunk-parent: ctlplane cephs: network-template: range: