diff --git a/playbooks/data_plane_adoption/deploy_tripleo_run_repo_tests.yaml b/playbooks/data_plane_adoption/deploy_tripleo_run_repo_tests.yaml index 389f64a6ab..c52331255f 100644 --- a/playbooks/data_plane_adoption/deploy_tripleo_run_repo_tests.yaml +++ b/playbooks/data_plane_adoption/deploy_tripleo_run_repo_tests.yaml @@ -5,7 +5,10 @@ rdo_dir: "/home/zuul/src/review.rdoproject.org/rdo-jobs/playbooks/data_plane_adoption" framework_dir: "/home/zuul/src/github.com/openstack-k8s-operators/ci-framework" cifmw_datadir: "/home/zuul/ci-framework-data" - edpm_node_ip: 192.168.122.106 + edpm_node_ips: + - 192.168.122.106 + - 192.168.122.107 + - 192.168.122.108 source_mariadb_ip: 172.17.0.103 source_ovndb_ip: 172.17.0.103 tasks: @@ -123,23 +126,131 @@ regexp: "'^source_ovndb_ip:'" value: "source_ovndb_ip: {{ source_ovndb_ip }}" - - name: Place compute IP into vars.yaml for edpm_node_ip - ansible.builtin.lineinfile: - path: "{{ rdo_dir }}/vars.yaml" - regexp: "'^edpm_node_ip:'" - value: "edpm_node_ip: {{ edpm_node_ip }}" - - - name: Fetch compute hostname to set edpm_node_hostname var - delegate_to: "overcloud-novacompute-0" - ansible.builtin.slurp: - path: /home/zuul/ansible_hostname - register: compute_hostname + - name: Prep and insert vars for multiple computes + when: not single_compute|default('true')|bool + block: + - name: Fetch compute hostnames to set edpm_node_hostname vars + delegate_to: "overcloud-novacompute-{{ item }}" + ansible.builtin.slurp: + path: /home/zuul/ansible_hostname + register: compute_hostnames + loop: + - 0 + - 1 + - 2 + - name: Set compute hostnames facts to prevent repetition + ansible.builtin.set_fact: + compute0_hostname: "{{ compute_hostnames.results[0]['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" + compute1_hostname: "{{ compute_hostnames.results[1]['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" + compute2_hostname: "{{ compute_hostnames.results[2]['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" - - name: Set EDPM node hostname in vars.yaml - ansible.builtin.lineinfile: - path: "{{ rdo_dir }}/vars.yaml" - regexp: "'^edpm_node_hostname:'" - value: "edpm_node_hostname: {{ compute_hostname['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" + - name: Set edpm_node_ip, _hostname, edpm_nodes, edpm_computes in vars.yaml with compute hostnames + ansible.builtin.blockinfile: + marker_begin: "BEGIN edpm_node_ip hostname vars" + marker_end: "END edpm_node_ip hostname vars" + path: "{{ rdo_dir }}/vars.yaml" + block: | + edpm_node_hostname: {{ compute0_hostname }} + edpm_node_ip: {{ edpm_node_ips[0] }} + edpm_node1_hostname: {{ compute1_hostname }} + edpm_node1_ip: {{ edpm_node_ips[1] }} + edpm_node2_hostname: {{ compute2_hostname }} + edpm_node2_ip: {{ edpm_node_ips[2] }} + edpm_computes: | + ["{{ compute0_hostname }}"]="{{ edpm_node_ips[0] }}" + ["{{ compute1_hostname }}"]="{{ edpm_node_ips[1] }}" + ["{{ compute2_hostname }}"]="{{ edpm_node_ips[2] }}" + edpm_nodes: + {{ compute_hostnames.results[0]['content'] | b64decode | trim }}: + hostName: "{{ compute0_hostname }}" + ansible: + ansibleHost: {{ edpm_node_ips[0] }} + networks: + - defaultRoute: true + fixedIP: {{ edpm_node_ips[0] }} + name: ctlplane + subnetName: subnet1 + - name: internalapi + fixedIP: 172.17.0.106 + subnetName: subnet1 + - name: storage + fixedIP: 172.18.0.106 + subnetName: subnet1 + - name: tenant + fixedIP: 172.19.0.106 + subnetName: subnet1 + {{ compute_hostnames.results[1]['content'] | b64decode | trim }}: + hostName: "{{ compute1_hostname }}" + ansible: + ansibleHost: {{ edpm_node_ips[1] }} + networks: + - defaultRoute: true + fixedIP: {{ edpm_node_ips[1] }} + name: ctlplane + subnetName: subnet1 + - name: internalapi + fixedIP: 172.17.0.107 + subnetName: subnet1 + - name: storage + fixedIP: 172.18.0.107 + subnetName: subnet1 + - name: tenant + fixedIP: 172.19.0.107 + subnetName: subnet1 + {{ compute_hostnames.results[2]['content'] | b64decode | trim }}: + hostName: "{{ compute2_hostname }}" + ansible: + ansibleHost: {{ edpm_node_ips[2] }} + networks: + - defaultRoute: true + fixedIP: {{ edpm_node_ips[2] }} + name: ctlplane + subnetName: subnet1 + - name: internalapi + fixedIP: 172.17.0.108 + subnetName: subnet1 + - name: storage + fixedIP: 172.18.0.108 + subnetName: subnet1 + - name: tenant + fixedIP: 172.19.0.108 + subnetName: subnet1 + + - name: Prep and insert vars for single compute + when: single_compute|default('true')|bool + block: + - name: Fetch compute hostname to set edpm_node_hostname var + delegate_to: "overcloud-novacompute-0" + ansible.builtin.slurp: + path: /home/zuul/ansible_hostname + register: compute_hostname + - name: Set edpm_node_ip, _hostname, edpm_nodes, edpm_computes in vars.yaml with compute hostname + ansible.builtin.blockinfile: + marker_begin: "BEGIN edpm_node_ip hostname vars" + marker_end: "END edpm_node_ip hostname vars" + path: "{{ rdo_dir }}/vars.yaml" + block: | + edpm_node_ip: {{ edpm_node_ips[0] }} + edpm_node_hostname: {{ compute_hostname['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }} + edpm_nodes: + {{ compute_hostname['content'] | b64decode | trim }}: + hostName: "{{ compute_hostname['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" + ansible: + ansibleHost: {{ edpm_node_ips[0] }} + networks: + - defaultRoute: true + fixedIP: {{ edpm_node_ips[0] }} + name: ctlplane + subnetName: subnet1 + - name: internalapi + fixedIP: 172.17.0.106 + subnetName: subnet1 + - name: storage + fixedIP: 172.18.0.106 + subnetName: subnet1 + - name: tenant + fixedIP: 172.19.0.106 + subnetName: subnet1 - name: Set TLS Everywhere in vars.yaml ansible.builtin.lineinfile: @@ -161,25 +272,6 @@ edpm_user: zuul standalone_ip: "{{ standalone_ip | default('192.168.122.100') }}" neutron_physical_bridge_name: br-ex - edpm_nodes: - {{ compute_hostname['content'] | b64decode | trim }}: - hostName: "{{ compute_hostname['content'] | b64decode | trim }}.{{ cloud_domain | default('localdomain') }}" - ansible: - ansibleHost: {{ edpm_node_ip }} - networks: - - defaultRoute: true - fixedIP: {{ edpm_node_ip }} - name: ctlplane - subnetName: subnet1 - - name: internalapi - fixedIP: 172.17.0.106 - subnetName: subnet1 - - name: storage - fixedIP: 172.18.0.106 - subnetName: subnet1 - - name: tenant - fixedIP: 172.19.0.106 - subnetName: subnet1 - name: Read the ssh key downloaded from undercloud ansible.builtin.slurp: diff --git a/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 b/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 index 94e528df9e..dfc44d318d 100644 --- a/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 +++ b/playbooks/data_plane_adoption/files/hostnamemap.yaml.j2 @@ -5,3 +5,5 @@ parameter_defaults: overcloud-controller-1: "{{ controller_1_hostname }}" overcloud-controller-2: "{{ controller_2_hostname }}" overcloud-novacompute-0: "{{ compute_0_hostname }}" + overcloud-novacompute-1: "{{ compute_1_hostname }}" + overcloud-novacompute-2: "{{ compute_2_hostname }}" diff --git a/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml b/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml index 46376ac15f..7604e4158f 100644 --- a/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml +++ b/playbooks/data_plane_adoption/setup_tripleo_hostnamemap.yaml @@ -2,7 +2,7 @@ vars: rdo_dir: "review.rdoproject.org/rdo-jobs/playbooks/data_plane_adoption" tasks: - - name: Fetch ansible hostnames from the controllers + - name: Fetch ansible hostnames from the tripleo nodes delegate_to: "overcloud-{{ item }}" ansible.builtin.slurp: path: /home/zuul/ansible_hostname @@ -12,6 +12,8 @@ - controller-1 - controller-2 - novacompute-0 + - novacompute-1 + - novacompute-2 - name: Template out hostnamemap with tripleo hostnames ansible.builtin.template: @@ -22,3 +24,5 @@ controller_1_hostname: "{{ tripleo_hostnames.results[1]['content'] | b64decode | trim }}" controller_2_hostname: "{{ tripleo_hostnames.results[2]['content'] | b64decode | trim }}" compute_0_hostname: "{{ tripleo_hostnames.results[3]['content'] | b64decode | trim }}" + compute_1_hostname: "{{ tripleo_hostnames.results[4]['content'] | b64decode | trim }}" + compute_2_hostname: "{{ tripleo_hostnames.results[5]['content'] | b64decode | trim }}" diff --git a/zuul.d/_data_plane_adoption.yaml b/zuul.d/_data_plane_adoption.yaml index 82f613ded0..0f13d3f1fc 100644 --- a/zuul.d/_data_plane_adoption.yaml +++ b/zuul.d/_data_plane_adoption.yaml @@ -77,6 +77,7 @@ standalone_gateway: 192.168.122.10 standalone_private_key: /home/zuul/.ssh/id_rsa os_net_config_file: "overcloud_net_config.j2" + single_compute: false host-vars: undercloud: address_suffix: 100 @@ -89,6 +90,11 @@ address_suffix: 105 overcloud-novacompute-0: address_suffix: 106 + overcloud-novacompute-1: + address_suffix: 107 + overcloud-novacompute-2: + address_suffix: 108 + - job: name: data-plane-adoption-osp17-multinode-to-extracted-crc-with-ceph